diff options
| -rw-r--r-- | package-lock.json | 47 | ||||
| -rw-r--r-- | package.json | 3 | ||||
| -rw-r--r-- | public/favicon.svg | 37 | ||||
| -rw-r--r-- | public/images/corgi.jpg | bin | 0 -> 587671 bytes | |||
| -rw-r--r-- | public/images/noise.png | bin | 0 -> 5812 bytes | |||
| -rw-r--r-- | public/images/noise.svg | 7 | ||||
| -rw-r--r-- | public/netlify-logo.svg | 22 | ||||
| -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 | ||||
| -rw-r--r-- | tailwind.config.mjs | 35 |
15 files changed, 289 insertions, 25 deletions
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 @@ -<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128"> - <path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" /> - <style> - path { fill: #000; } - @media (prefers-color-scheme: dark) { - path { fill: #FFF; } - } - </style> +<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> + <style> + .favicon-center-dot { + fill: #014847; + } + + .favicon-lines { + fill: #05BDBA; + } + + @media (prefers-color-scheme: dark) { + .favicon-center-dot { + fill: #fff; + } + + .favicon-lines { + fill: #05BDBA; + } + } + </style> + <path class="favicon-center-dot" stroke="none" d="M17.9922 18.3225H14.005L13.6746 17.9921V14.005L14.005 13.6746H17.9922L18.3226 14.005V17.9921L17.9922 18.3225Z" /> + <g class="favicon-lines" stroke="none"> + <path d="M9.6958 24.3311H9.35705L7.6661 22.6401V22.3041L10.2511 19.7164L12.042 19.7191L12.2808 19.9552V21.7461L9.6958 24.3311Z" /> + <path d="M7.6661 9.69576V9.35701L9.35705 7.66606H9.6958L12.2808 10.2511V12.0392L12.042 12.2808H10.2511L7.6661 9.69576Z" /> + <path d="M10.0457 17.4369H0.205466L0 17.2314V14.7658L0.205466 14.5603H10.0457L10.2511 14.7658V17.2314L10.0457 17.4369Z" /> + <path d="M31.7945 17.4369H21.9544L21.7489 17.2314V14.7658L21.9544 14.5603H31.7945L32 14.7658V17.2314L31.7945 17.4369Z" /> + <path d="M14.5631 10.0456V2.66547L14.7686 2.46001H17.2343L17.4396 2.66547V10.0456L17.2343 10.2511H14.7686L14.5631 10.0456Z" /> + <path d="M14.5631 29.3316V21.9515L14.7686 21.746H17.2343L17.4396 21.9515V29.3316L17.2343 29.5371H14.7686L14.5631 29.3316Z" /> + </g> </svg> diff --git a/public/images/corgi.jpg b/public/images/corgi.jpg Binary files differnew file mode 100644 index 0000000..402232f --- /dev/null +++ b/public/images/corgi.jpg diff --git a/public/images/noise.png b/public/images/noise.png Binary files differnew file mode 100644 index 0000000..96950c7 --- /dev/null +++ b/public/images/noise.png 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 @@ +<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.dev/svgjs" viewBox="0 0 700 700" width="700" height="700"><defs><filter id="nnnoise-filter" x="-20%" y="-20%" width="140%" height="140%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" color-interpolation-filters="linearRGB"> + <feTurbulence type="fractalNoise" baseFrequency="0.102" numOctaves="4" seed="15" stitchTiles="stitch" x="0%" y="0%" width="100%" height="100%" result="turbulence"></feTurbulence> + <feSpecularLighting surfaceScale="15" specularConstant="0.75" specularExponent="20" lighting-color="#ffffff" x="0%" y="0%" width="100%" height="100%" in="turbulence" result="specularLighting"> + <feDistantLight azimuth="3" elevation="100"></feDistantLight> + </feSpecularLighting> + +</filter></defs><rect width="700" height="700" fill="transparent"></rect><rect width="700" height="700" fill="#ffffff" filter="url(#nnnoise-filter)" opacity="0.2"></rect></svg>
\ 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 @@ +<svg width="122" height="50" viewBox="0 0 122 50" fill="none" xmlns="http://www.w3.org/2000/svg"> +<g clip-path="url(#clip0_175_3110)"> +<path d="M27.9828 49.0799V36.6502L28.2433 36.391H30.8459L31.1065 36.6502V49.0799L30.8459 49.3391H28.2433L27.9828 49.0799Z" fill="#32E6E2"/> +<path d="M27.9828 12.688V0.259198L28.2433 0H30.8459L31.1065 0.259198V12.688L30.8459 12.9472H28.2433L27.9828 12.688Z" fill="#32E6E2"/> +<path d="M16.6687 40.1195H16.3007L14.4605 38.2879V37.9217L18.7575 33.6477L20.7061 33.6486L20.9675 33.9069V35.8454L16.6687 40.1195Z" fill="#32E6E2"/> +<path d="M16.6669 9.21965H16.2988L14.4587 11.0513V11.4174L18.7557 15.6914L20.7042 15.6905L20.9657 15.4322V13.4937L16.6669 9.21965Z" fill="#32E6E2"/> +<path d="M0.260534 23.1157H17.9595L18.2201 23.3749V25.9642L17.9595 26.2234H0.260534L0 25.9642V23.3749L0.260534 23.1157Z" fill="#32E6E2"/> +<path d="M105.082 23.1157H121.74L122.001 23.3749V25.9642L121.74 26.2234H104.041L103.781 25.9642L104.821 23.3749L105.082 23.1157Z" fill="#32E6E2"/> +<path d="M50.529 25.7748L50.2685 26.034H42.1946L41.9341 26.2932C41.9341 26.8116 42.4552 28.3659 44.5385 28.3659C45.3201 28.3659 46.1008 28.1067 46.3614 27.5883L46.6219 27.3291H49.7474L50.0079 27.5883C49.7474 29.1425 48.4456 31.4753 44.5385 31.4753C40.1113 31.4753 38.027 28.3659 38.027 24.7389C38.027 21.1119 40.1104 18.0025 44.278 18.0025C48.4456 18.0025 50.529 21.1119 50.529 24.7389V25.7757V25.7748ZM46.6219 23.1837C46.6219 22.9245 46.3614 21.111 44.278 21.111C42.1946 21.111 41.9341 22.9245 41.9341 23.1837L42.1946 23.4429H46.3614L46.6219 23.1837Z" fill="white"/> +<path d="M57.8212 27.3291C57.8212 27.8475 58.0818 28.1067 58.6028 28.1067H60.9467L61.2073 28.3659V30.9569L60.9467 31.2161H58.6028C56.2589 31.2161 54.1756 30.1793 54.1756 27.3291V21.6285L53.915 21.3693H52.0922L51.8317 21.1101V18.5191L52.0922 18.2599H53.915L54.1756 18.0007V15.6688L54.4361 15.4096H57.5616L57.8221 15.6688V18.0007L58.0827 18.2599H60.9476L61.2082 18.5191V21.1101L60.9476 21.3693H58.0827L57.8221 21.6285V27.3291H57.8212Z" fill="white"/> +<path d="M67.4573 31.2161H64.3318L64.0713 30.9569V13.3378L64.3318 13.0786H67.4573L67.7178 13.3378V30.9569L67.4573 31.2161Z" fill="white"/> +<path d="M74.489 16.1881H71.3635L71.103 15.9289V13.3378L71.3635 13.0786H74.489L74.7495 13.3378V15.9289L74.489 16.1881ZM74.489 31.2161H71.3635L71.103 30.9569V18.52L71.3635 18.2608H74.489L74.7495 18.52V30.9569L74.489 31.2161Z" fill="white"/> +<path d="M86.7295 13.3378V15.9289L86.469 16.1881H84.1251C83.604 16.1881 83.3435 16.4473 83.3435 16.9657V18.0025L83.604 18.2617H86.2085L86.469 18.5209V21.1119L86.2085 21.3711H83.604L83.3435 21.6303V30.9578L83.083 31.217H79.9575L79.6969 30.9578V21.6303L79.4364 21.3711H77.6136L77.353 21.1119V18.5209L77.6136 18.2617H79.4364L79.6969 18.0025V16.9657C79.6969 14.1154 81.7803 13.0786 84.1242 13.0786H86.4681L86.7286 13.3378H86.7295Z" fill="white"/> +<path d="M96.3657 31.4753C95.3235 34.0664 94.2823 35.6207 90.6357 35.6207H89.3331L89.0725 35.3615V32.7704L89.3331 32.5112H90.6357C91.9375 32.5112 92.198 32.252 92.4586 31.4744V31.2152L88.2918 21.1101V18.5191L88.5524 18.2599H90.8963L91.1568 18.5191L94.2823 27.3291H94.5428L97.6683 18.5191L97.9289 18.2599H100.273L100.533 18.5191V21.1101L96.3666 31.4744L96.3657 31.4753Z" fill="white"/> +<path d="M32.2761 31.2161L32.0156 30.9569L32.0174 23.4492C32.0174 22.1542 31.5055 21.15 29.9341 21.1174C29.1261 21.0965 28.2014 21.1156 27.2139 21.1573L27.0664 21.3077L27.0682 30.9569L26.8077 31.2161H23.6831L23.4225 30.9569V18.3813L23.6831 18.1221L30.7148 18.0587C34.2374 18.0587 35.6631 20.4667 35.6631 23.1846V30.9569L35.4025 31.2161H32.2761Z" fill="white"/> +</g> +<defs> +<clipPath id="clip0_175_3110"> +<rect width="122" height="49.3382" fill="white"/> +</clipPath> +</defs> +</svg> 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 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')], } |
