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 --- package-lock.json | 47 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +++ public/favicon.svg | 37 ++++++++++++++++++++++++++-------- public/images/corgi.jpg | Bin 0 -> 587671 bytes public/images/noise.png | Bin 0 -> 5812 bytes public/images/noise.svg | 7 +++++++ public/netlify-logo.svg | 22 +++++++++++++++++++++ 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 ++++++++++++++++++++++++++++++++++ tailwind.config.mjs | 35 +++++++++++++++++++++++++++++---- 15 files changed, 289 insertions(+), 25 deletions(-) create mode 100644 public/images/corgi.jpg create mode 100644 public/images/noise.png create mode 100644 public/images/noise.svg create mode 100644 public/netlify-logo.svg 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 diff --git a/package-lock.json b/package-lock.json index b89ca8a..2b65a28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,9 @@ "@astrojs/tailwind": "^5.1.0", "astro": "^4.5.14", "tailwindcss": "^3.4.3" + }, + "devDependencies": { + "daisyui": "^4.9.0" } }, "node_modules/@alloc/quick-lru": { @@ -1952,6 +1955,16 @@ "node": ">= 8" } }, + "node_modules/css-selector-tokenizer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.8.0.tgz", + "integrity": "sha512-Jd6Ig3/pe62/qe5SBPTN8h8LeUg/pT4lLgtavPf7updwwHpvFzxvOQBHYj2LZDMjUnBzgvIUSjRcf6oT5HzHFg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "fastparse": "^1.1.2" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -1963,6 +1976,34 @@ "node": ">=4" } }, + "node_modules/culori": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/culori/-/culori-3.3.0.tgz", + "integrity": "sha512-pHJg+jbuFsCjz9iclQBqyL3B2HLCBF71BwVNujUYEvCeQMvV97R59MNK3R2+jgJ3a1fcZgI9B3vYgz8lzr/BFQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/daisyui": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.9.0.tgz", + "integrity": "sha512-9JsDx4E+30kPxThE+6yEwQokqg1957uwTx/skP2RE98fG6Ten6U+S9YXeQg1a3CI958aF5aOb0oEA+KZFfrZUA==", + "dev": true, + "dependencies": { + "css-selector-tokenizer": "^0.8", + "culori": "^3", + "picocolors": "^1", + "postcss-js": "^4" + }, + "engines": { + "node": ">=16.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/daisyui" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2272,6 +2313,12 @@ "node": ">=8.6.0" } }, + "node_modules/fastparse": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", + "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", + "dev": true + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", diff --git a/package.json b/package.json index ac7d376..6db7e80 100644 --- a/package.json +++ b/package.json @@ -13,5 +13,8 @@ "@astrojs/tailwind": "^5.1.0", "astro": "^4.5.14", "tailwindcss": "^3.4.3" + }, + "devDependencies": { + "daisyui": "^4.9.0" } } diff --git a/public/favicon.svg b/public/favicon.svg index f157bd1..5e766e6 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1,9 +1,30 @@ - - - + + + + + + + + + + + diff --git a/public/images/corgi.jpg b/public/images/corgi.jpg new file mode 100644 index 0000000..402232f Binary files /dev/null and b/public/images/corgi.jpg differ diff --git a/public/images/noise.png b/public/images/noise.png new file mode 100644 index 0000000..96950c7 Binary files /dev/null and b/public/images/noise.png differ diff --git a/public/images/noise.svg b/public/images/noise.svg new file mode 100644 index 0000000..17bddaf --- /dev/null +++ b/public/images/noise.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/public/netlify-logo.svg b/public/netlify-logo.svg new file mode 100644 index 0000000..9aa5a20 --- /dev/null +++ b/public/netlify-logo.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + 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 diff --git a/tailwind.config.mjs b/tailwind.config.mjs index 19f0614..507c93e 100644 --- a/tailwind.config.mjs +++ b/tailwind.config.mjs @@ -1,8 +1,35 @@ /** @type {import('tailwindcss').Config} */ +const colors = require('tailwindcss/colors'); +const defaultTheme = require('tailwindcss/defaultTheme'); + export default { content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], - theme: { - extend: {}, - }, - plugins: [], + theme: { + extend: { + backgroundImage: { + 'grid-pattern': "linear-gradient(to bottom, theme('colors.neutral.950 / 0%'), theme('colors.neutral.950 / 100%')), url('/images/noise.png')" + }, + colors: { + neutral: colors.neutral + }, + fontFamily: { + sans: ['Inter', ...defaultTheme.fontFamily.sans] + } + } + }, + daisyui: { + themes: [ + { + lofi: { + ...require('daisyui/src/theming/themes')['lofi'], + primary: '#2bdcd2', + 'primary-content': '#171717', + secondary: '#016968', + info: '#2bdcd2', + 'info-content': '#171717', + } + } + ] + }, + plugins: [require('daisyui')], } -- cgit v1.2.3