diff options
| author | Tomas Bankauskas <tbdizainas@gmail.com> | 2024-04-04 15:23:09 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-04 15:23:09 +0300 |
| commit | 4df0e4a754ea5e1fb0d05a4e08a53cd49e9fce16 (patch) | |
| tree | d695b3f987ccf7113ba73b467a94082457be63ea /src/components | |
| parent | 5c66b0550a6e3bd6b558da4229bcb6be2d9244f6 (diff) | |
Added Daisy UI and basic components (#3)
* added daisyui
* added Footer.astro
* updated Header.astro, added Card.astro, etc
* small adjustments
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Card.astro | 29 | ||||
| -rw-r--r-- | src/components/Footer.astro | 14 | ||||
| -rw-r--r-- | src/components/Header.astro | 29 |
3 files changed, 72 insertions, 0 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 |
