diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/Card.astro | 29 | ||||
| -rw-r--r-- | src/components/Footer.astro | 14 | ||||
| -rw-r--r-- | src/components/Header.astro | 29 | ||||
| -rw-r--r-- | src/layouts/Layout.astro | 19 | ||||
| -rw-r--r-- | src/pages/blobs.astro | 12 | ||||
| -rw-r--r-- | src/pages/index.astro | 23 | ||||
| -rw-r--r-- | src/styles/globals.css | 37 |
7 files changed, 150 insertions, 13 deletions
diff --git a/src/components/Card.astro b/src/components/Card.astro new file mode 100644 index 0000000..cbe0b0a --- /dev/null +++ b/src/components/Card.astro @@ -0,0 +1,29 @@ +--- +interface Props { + title?: string; + text?: string; + linkText?: string; + href?: string; +} + +const { title, text, linkText, href } = Astro.props; +--- + +<div class="bg-white text-neutral-600 card"> + <div class="card-body"> + {title && <h3 class="text-neutral-900 card-title">{title}</h3>} + {text && <p>{text}</p>} + { + linkText && href && ( + <div class="card-actions"> + <a + href={href} + class="transition link text-neutral-900 hover:opacity-80" + > + {linkText} + </a> + </div> + ) + } + </div> +</div> diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..dd98602 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,14 @@ +--- + +--- + +<footer class="pt-16 pb-12 sm:pt-24 sm:pb-16"> + <p class="text-sm"> + <a + href="https://docs.netlify.com/frameworks/astro/" + class="underline transition decoration-dashed text-primary underline-offset-8 hover:opacity-80" + > + Astro.js on Netlify + </a> + </p> +</footer> diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..724150e --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,29 @@ +--- +const navItems = [ + { linkText: 'Home', href: '/' }, + { linkText: 'Revalidation', href: '/revalidation' }, + { linkText: 'Image CDN', href: '/image-cdn' }, + { linkText: 'Edge Function', href: '/edge' }, + { linkText: 'Blobs', href: '/blobs' } +]; +--- + +<nav class="flex flex-wrap items-center gap-4 pt-6 pb-16 sm:pt-12 sm:pb-24"> + <a href="/"> + <img src="/netlify-logo.svg" alt="Netlify logo" /> + </a> + {!!navItems?.length && ( + <ul class="flex flex-wrap gap-x-4 gap-y-1"> + {navItems.map((item) => ( + <li> + <a + href={item.href} + class="inline-block px-1.5 py-1 transition hover:opacity-80 sm:px-3 sm:py-2" + > + {item.linkText} + </a> + </li> + ))} + </ul> + )} +</nav>
\ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 5c9eaae..4ecbd8b 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,4 +1,8 @@ --- +import '../../src/styles/globals.css'; +import Header from "../components/Header.astro"; +import Footer from "../components/Footer.astro"; + interface Props { title: string; } @@ -10,13 +14,18 @@ const { title } = Astro.props; <html lang="en"> <head> <meta charset="UTF-8" /> - <meta name="description" content="Astro description" /> + <title>{title}</title> <meta name="viewport" content="width=device-width" /> - <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <meta name="generator" content={Astro.generator} /> - <title>{title}</title> + <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> </head> - <body> - <slot /> + <body class="antialiased text-white bg-blue-900"> + <div class="flex flex-col min-h-screen px-6 bg-grid-pattern sm:px-12"> + <div class="flex flex-col w-full max-w-5xl mx-auto grow"> + <Header /> + <div class="grow"><slot /></div> + <Footer /> + </div> + </div> </body> </html>
\ No newline at end of file diff --git a/src/pages/blobs.astro b/src/pages/blobs.astro new file mode 100644 index 0000000..61da040 --- /dev/null +++ b/src/pages/blobs.astro @@ -0,0 +1,12 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + +<Layout title="Blobs"> + <main class="flex flex-col gap-8 sm:gap-16"> + <section class="flex flex-col items-start gap-3 sm:gap-4"> + <h1>Blobs x Blobs</h1> + <p class="text-lg">Get started with Astro.js and Netlify in seconds.</p> + </section> + </main> +</Layout> diff --git a/src/pages/index.astro b/src/pages/index.astro index cac48e0..2a3c105 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,13 +1,20 @@ --- -import Layout from '../layouts/Layout.astro'; +import Layout from "../layouts/Layout.astro"; +import Card from "../components/Card.astro"; --- <Layout title="Welcome to Astro."> - <main> - <h1>Welcome to Astro</h1> - <p> - To get started, open the directory <code>src/pages</code> in your project.<br /> - <strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above. - </p> - </main> + <main class="flex flex-col gap-8 sm:gap-16"> + <section class="flex flex-col items-start gap-3 sm:gap-4"> + <h1 class="mb-0">Netlify Platform Starter - Astro.js</h1> + <p class="text-lg">Get started with Astro.js and Netlify in seconds.</p> + <a + href="https://docs.netlify.com/frameworks/astro/" + class="btn btn-lg btn-primary sm:btn-wide" + > + Read the Docs + </a> + <Card title="Random Title" text="Long random text about Astro.js. Get started with Astro.js and Netlify in seconds." /> + </section> + </main> </Layout> diff --git a/src/styles/globals.css b/src/styles/globals.css new file mode 100644 index 0000000..8846f57 --- /dev/null +++ b/src/styles/globals.css @@ -0,0 +1,37 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;800&display=swap'); + +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + + :not(pre) > code { + @apply px-1 py-0.5 font-mono rounded bg-neutral-900 text-yellow-200; + font-size: 0.9em; + } + + h1 { + @apply mb-6 text-4xl font-bold tracking-tight sm:text-5xl; + } +} + +a { + @apply underline +} + +.markdown { + @apply mb-1; +} + +.alert .markdown { + @apply mb-0; +} + +.markdown p { + @apply mb-3; +} + +.btn:disabled { + @apply text-neutral-400 bg-neutral-700; +}
\ No newline at end of file |
