From 4df0e4a754ea5e1fb0d05a4e08a53cd49e9fce16 Mon Sep 17 00:00:00 2001 From: Tomas Bankauskas Date: Thu, 4 Apr 2024 15:23:09 +0300 Subject: Added Daisy UI and basic components (#3) * added daisyui * added Footer.astro * updated Header.astro, added Card.astro, etc * small adjustments --- src/components/Card.astro | 29 +++++++++++++++++++++++++++++ src/components/Footer.astro | 14 ++++++++++++++ src/components/Header.astro | 29 +++++++++++++++++++++++++++++ src/layouts/Layout.astro | 19 ++++++++++++++----- src/pages/blobs.astro | 12 ++++++++++++ src/pages/index.astro | 23 +++++++++++++++-------- src/styles/globals.css | 37 +++++++++++++++++++++++++++++++++++++ 7 files changed, 150 insertions(+), 13 deletions(-) create mode 100644 src/components/Card.astro create mode 100644 src/components/Footer.astro create mode 100644 src/components/Header.astro create mode 100644 src/pages/blobs.astro create mode 100644 src/styles/globals.css (limited to 'src') 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; +--- + +
+
+ {title &&

{title}

} + {text &&

{text}

} + { + linkText && href && ( + + ) + } +
+
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 @@ +--- + +--- + + 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' } +]; +--- + + \ 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; - + {title} - - {title} + - - + +
+
+
+
+
+
+
\ 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"; +--- + + +
+
+

Blobs x Blobs

+

Get started with Astro.js and Netlify in seconds.

+
+
+
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"; --- -
-

Welcome to Astro

-

- To get started, open the directory src/pages in your project.
- Code Challenge: Tweak the "Welcome to Astro" message above. -

-
+
+
+

Netlify Platform Starter - Astro.js

+

Get started with Astro.js and Netlify in seconds.

+ + Read the Docs + + +
+
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 -- cgit v1.2.3