chore: restyles start page (#114)
* restyles start page * chore: start page style tweaks * chore: adjust codeblock overflow * chore: satisfies the design gods
This commit is contained in:
@ -1,37 +1,191 @@
|
||||
html,
|
||||
body {
|
||||
font-family: 'Roboto', 'Inter', sans-serif;
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 37.5rem;
|
||||
padding: 0 2rem;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
body {
|
||||
color: #ffffff;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
main {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding-block: 80px;
|
||||
border-inline-width: 1px;
|
||||
border-inline-style: solid;
|
||||
border-image: linear-gradient(180deg, #ffffff00, #ffffff00, #ffffff1a, #ffffff00) 1;
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
padding-block: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
article {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
padding: 60px 80px;
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
padding: 40px 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2.6px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #ffffff;
|
||||
font-size: 4rem;
|
||||
}
|
||||
font-weight: 600;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.02rem;
|
||||
margin: 0;
|
||||
|
||||
.rainbow {
|
||||
font-family: monospace;
|
||||
letter-spacing: 5px;
|
||||
background: linear-gradient(to right, #6666ff, #0099ff, #00ff00, #ff3399, #6666ff);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
animation: rainbow_animation 6s ease-in-out infinite;
|
||||
background-size: 400% 100%;
|
||||
}
|
||||
|
||||
@keyframes rainbow_animation {
|
||||
0%,
|
||||
100% {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-position: 100% 0;
|
||||
@media screen and (max-width: 600px) {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
line-height: 28px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #ffffff;
|
||||
text-decoration: underline;
|
||||
transition: color 0.2s ease-out;
|
||||
|
||||
&:hover {
|
||||
color: #ffffff80;
|
||||
}
|
||||
}
|
||||
|
||||
.codeBlock {
|
||||
position: relative;
|
||||
background-color: #00000066;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
pre {
|
||||
margin: 0;
|
||||
padding: 60px 80px;
|
||||
overflow-x: scroll;
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
padding: 40px 40px;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: calc(50% - 50vw);
|
||||
width: 100vw;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, #ffffff00, #ffffff1a, #ffffff1a, #ffffff00);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: url('/crosshair.svg');
|
||||
display: block;
|
||||
height: 19px;
|
||||
width: 19px;
|
||||
position: absolute;
|
||||
top: -9px;
|
||||
left: -10px;
|
||||
}
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 14px;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: calc(50% - 50vw);
|
||||
width: 100vw;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, #ffffff00, #ffffff1a, #ffffff1a, #ffffff00);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: url('/crosshair.svg');
|
||||
display: block;
|
||||
height: 19px;
|
||||
width: 19px;
|
||||
position: absolute;
|
||||
bottom: -9px;
|
||||
right: -10px;
|
||||
}
|
||||
}
|
||||
|
||||
.background {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
|
||||
div.blur {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url('/blur.png');
|
||||
background-repeat: repeat;
|
||||
background-size: 400px 400px;
|
||||
background-blend-mode: soft-light, normal;
|
||||
backdrop-filter: blur(60px);
|
||||
}
|
||||
|
||||
div.gradient {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url('/gradient.webp');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
z-index: -2;
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,17 @@
|
||||
import React from 'react'
|
||||
import './globals.scss'
|
||||
import { Inter } from 'next/font/google'
|
||||
|
||||
const inter = Inter({
|
||||
subsets: ['latin'],
|
||||
display: 'swap',
|
||||
})
|
||||
|
||||
/* Our app sits here to not cause any conflicts with payload's root layout */
|
||||
const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
return (
|
||||
<html>
|
||||
<body>
|
||||
<main>{children}</main>
|
||||
</body>
|
||||
<html className={inter.className}>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
|
@ -1,56 +1,51 @@
|
||||
import Example from '@/components/Example'
|
||||
import { Badge } from '@/components/Badge'
|
||||
import { Background } from '@/components/Background'
|
||||
import Link from 'next/link'
|
||||
import React from 'react'
|
||||
|
||||
const Page = () => {
|
||||
return (
|
||||
<article className={['container'].filter(Boolean).join(' ')}>
|
||||
<h1>
|
||||
Payload 3.0 <span className="rainbow">BETA</span>!
|
||||
</h1>
|
||||
<p>
|
||||
This BETA is rapidly evolving, you can report any bugs against{' '}
|
||||
<a href="https://github.com/payloadcms/payload-3.0-demo/issues" target="_blank">
|
||||
the repo
|
||||
</a>{' '}
|
||||
or in the{' '}
|
||||
<a
|
||||
href="https://discord.com/channels/967097582721572934/1215659716538273832"
|
||||
target="_blank"
|
||||
>
|
||||
dedicated channel in Discord
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>
|
||||
Payload is running at <Link href="/admin">/admin</Link>
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<Link href="/my-route" target="_blank">
|
||||
/my-route
|
||||
</Link>{' '}
|
||||
contains an example of a custom route running the Local API.
|
||||
</p>
|
||||
|
||||
<Example />
|
||||
|
||||
<p>You can use the Local API in your server components like this:</p>
|
||||
<pre>
|
||||
<code>
|
||||
{`import { getPayload } from 'payload'
|
||||
<>
|
||||
<main>
|
||||
<article>
|
||||
<Badge />
|
||||
<h1>Payload 3.0</h1>
|
||||
<p>
|
||||
This BETA is rapidly evolving, you can report any bugs against{' '}
|
||||
<Link href="https://github.com/payloadcms/payload-3.0-demo/issues" target="_blank">
|
||||
the repo
|
||||
</Link>{' '}
|
||||
or in the{' '}
|
||||
<Link
|
||||
href="https://discord.com/channels/967097582721572934/1215659716538273832"
|
||||
target="_blank"
|
||||
>
|
||||
dedicated channel in Discord
|
||||
</Link>
|
||||
. Payload is running at <Link href="/admin">/admin</Link>. An example of a custom route
|
||||
running the Local API can be found at <Link href="/my-route">/my-route</Link>.
|
||||
</p>
|
||||
<p>You can use the Local API in your server components like this:</p>
|
||||
</article>
|
||||
<div className="codeBlock">
|
||||
<pre>
|
||||
<code>
|
||||
{`import { getPayload } from 'payload'
|
||||
import configPromise from "@payload-config";
|
||||
const payload = await getPayload({ config: configPromise })
|
||||
|
||||
const data = await payload.find({
|
||||
collection: 'posts',
|
||||
})`}
|
||||
</code>
|
||||
</pre>
|
||||
</article>
|
||||
})
|
||||
|
||||
return <Posts data={data} />
|
||||
`}
|
||||
</code>
|
||||
</pre>
|
||||
</div>
|
||||
</main>
|
||||
<Background />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
8
src/components/Background.tsx
Normal file
8
src/components/Background.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
export const Background = () => {
|
||||
return (
|
||||
<div className="background">
|
||||
<div className="blur" />
|
||||
<div className="gradient" />
|
||||
</div>
|
||||
)
|
||||
}
|
20
src/components/Badge.tsx
Normal file
20
src/components/Badge.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
export const Badge = () => {
|
||||
return (
|
||||
<span className="badge">
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 20 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M9.35899 1.59033L16.956 6.233V15.0452L11.2355 18.4097V9.59751L3.62941 4.96095L9.35899 1.59033Z"
|
||||
fill="#ffffff"
|
||||
/>
|
||||
<path d="M8.77667 17.9211V11.0447L3.04407 14.4153L8.77667 17.9211Z" fill="#ffffff" />
|
||||
</svg>
|
||||
Beta
|
||||
</span>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user