From c441671134ceda2f646591ca963a8037ea0185a8 Mon Sep 17 00:00:00 2001 From: "Ian K. Guimaraes" Date: Tue, 20 Aug 2024 16:40:58 -0300 Subject: [PATCH] chore: UI enhancements --- research/package.json | 1 + research/pnpm-lock.yaml | 9 + research/src/components/Dropdown.svelte | 68 +++++ research/src/components/Header.svelte | 120 +++++++++ research/src/components/icons/Menu.svelte | 12 + research/src/components/icons/Moon.svelte | 6 + research/src/components/icons/Sun.svelte | 20 ++ research/src/components/layout/BaseHead.astro | 33 ++- research/src/layouts/Header.astro | 247 ------------------ research/src/layouts/Layout.astro | 29 +- research/src/pages/[id].astro | 2 +- research/src/pages/index.astro | 19 +- research/src/stores/theme.store.ts | 34 +++ research/src/utils/theme.ts | 0 research/tailwind.config.mjs | 2 + 15 files changed, 303 insertions(+), 299 deletions(-) create mode 100644 research/src/components/Dropdown.svelte create mode 100644 research/src/components/Header.svelte create mode 100644 research/src/components/icons/Menu.svelte create mode 100644 research/src/components/icons/Moon.svelte create mode 100644 research/src/components/icons/Sun.svelte delete mode 100644 research/src/layouts/Header.astro create mode 100644 research/src/stores/theme.store.ts create mode 100644 research/src/utils/theme.ts diff --git a/research/package.json b/research/package.json index 4fcb237..2def3a8 100644 --- a/research/package.json +++ b/research/package.json @@ -15,6 +15,7 @@ "@astrojs/svelte": "^5.7.0", "@astrojs/tailwind": "^5.1.0", "astro": "^4.14.2", + "nanostores": "^0.11.2", "svelte": "^4.2.18", "tailwindcss": "^3.4.10", "typescript": "^5.5.4" diff --git a/research/pnpm-lock.yaml b/research/pnpm-lock.yaml index dee6fdc..b3b18a3 100644 --- a/research/pnpm-lock.yaml +++ b/research/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: astro: specifier: ^4.14.2 version: 4.14.2(rollup@4.20.0)(sass@1.77.8)(typescript@5.5.4) + nanostores: + specifier: ^0.11.2 + version: 0.11.2 svelte: specifier: ^4.2.18 version: 4.2.18 @@ -1559,6 +1562,10 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + nanostores@0.11.2: + resolution: {integrity: sha512-6bucNxMJA5rNV554WQl+MWGng0QVMzlRgpKTHHfIbVLrhQ+yRXBychV9ECGVuuUfCMQPjfIG9bj8oJFZ9hYP/Q==} + engines: {node: ^18.0.0 || >=20.0.0} + neotraverse@0.6.18: resolution: {integrity: sha512-Z4SmBUweYa09+o6pG+eASabEpP6QkQ70yHj351pQoEXIs8uHbaU2DWVmzBANKgflPa47A50PtB2+NgRpQvr7vA==} engines: {node: '>= 10'} @@ -4098,6 +4105,8 @@ snapshots: nanoid@3.3.7: {} + nanostores@0.11.2: {} + neotraverse@0.6.18: {} nlcst-to-string@4.0.0: diff --git a/research/src/components/Dropdown.svelte b/research/src/components/Dropdown.svelte new file mode 100644 index 0000000..8f406c6 --- /dev/null +++ b/research/src/components/Dropdown.svelte @@ -0,0 +1,68 @@ +
+ + + +
diff --git a/research/src/components/Header.svelte b/research/src/components/Header.svelte new file mode 100644 index 0000000..2af048a --- /dev/null +++ b/research/src/components/Header.svelte @@ -0,0 +1,120 @@ + + +
+ +
+ + diff --git a/research/src/components/icons/Menu.svelte b/research/src/components/icons/Menu.svelte new file mode 100644 index 0000000..d4e1007 --- /dev/null +++ b/research/src/components/icons/Menu.svelte @@ -0,0 +1,12 @@ + + + + + diff --git a/research/src/components/icons/Moon.svelte b/research/src/components/icons/Moon.svelte new file mode 100644 index 0000000..dc6cf1a --- /dev/null +++ b/research/src/components/icons/Moon.svelte @@ -0,0 +1,6 @@ + + + diff --git a/research/src/components/icons/Sun.svelte b/research/src/components/icons/Sun.svelte new file mode 100644 index 0000000..027c45e --- /dev/null +++ b/research/src/components/icons/Sun.svelte @@ -0,0 +1,20 @@ + + + + + + + + + + diff --git a/research/src/components/layout/BaseHead.astro b/research/src/components/layout/BaseHead.astro index 58f44e2..2845023 100644 --- a/research/src/components/layout/BaseHead.astro +++ b/research/src/components/layout/BaseHead.astro @@ -1,5 +1,4 @@ --- -// @ts-ignore: Cannot find module 'astro:transitions' import { ViewTransitions } from 'astro:transitions' interface Props { @@ -45,22 +44,22 @@ const { title, description, ogImage } = Astro.props />