From 4a866495cf26b2c49551a5de9380dec491714f2e Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Mon, 17 Nov 2025 17:16:58 +0800 Subject: [PATCH] [F] App bar --- .gitignore | 4 +++- bun.lock | 5 +++++ package.json | 3 +++ src/components/IconButton.svelte | 7 +++++++ src/components/SongInfo.svelte | 0 src/components/appbar/AppBar.svelte | 22 ++++++++++++++++++++++ src/routes/+layout.svelte | 20 +++++++++++++------- src/routes/+page.svelte | 5 ++--- src/routes/app.sass | 8 ++++++-- src/routes/material.scss | 4 ++-- uno.config.ts | 6 ++++++ vite.config.ts | 17 +++++++++++++---- 12 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 src/components/IconButton.svelte create mode 100644 src/components/SongInfo.svelte create mode 100644 src/components/appbar/AppBar.svelte diff --git a/.gitignore b/.gitignore index 7eb4781..115d9dd 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,6 @@ Thumbs.db # Vite vite.config.js.timestamp-* vite.config.ts.timestamp-* -data/ \ No newline at end of file +data/ + +public/assets/fonts/cache \ No newline at end of file diff --git a/bun.lock b/bun.lock index f2c6702..badb99f 100644 --- a/bun.lock +++ b/bun.lock @@ -6,10 +6,13 @@ "name": "kashi-dash", "dependencies": { "@fontsource/roboto": "^5.2.8", + "@iconify-json/material-symbols": "^1.2.46", "@neteasecloudmusicapienhanced/api": "^4.29.17", "@unocss/core": "^66.5.6", "@unocss/extractor-svelte": "^66.5.6", + "@unocss/preset-attributify": "^66.5.6", "@unocss/preset-icons": "^66.5.6", + "@unocss/reset": "^66.5.6", "m3-svelte": "^5.14.1", "openai": "^6.9.0", "sass": "^1.94.0", @@ -142,6 +145,8 @@ "@humanwhocodes/retry": ["@humanwhocodes/retry@0.4.3", "", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="], + "@iconify-json/material-symbols": ["@iconify-json/material-symbols@1.2.46", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-cNWdSAa5Z3f0TlqdCt28rmeYWGKwe68J1ORdyHyqC4D6H7CWiVKBJXV3TDTocOQVDO372bz+cmsFeo4+pbRy+A=="], + "@iconify/types": ["@iconify/types@2.0.0", "", {}, "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg=="], "@iconify/utils": ["@iconify/utils@3.0.2", "", { "dependencies": { "@antfu/install-pkg": "^1.1.0", "@antfu/utils": "^9.2.0", "@iconify/types": "^2.0.0", "debug": "^4.4.1", "globals": "^15.15.0", "kolorist": "^1.8.0", "local-pkg": "^1.1.1", "mlly": "^1.7.4" } }, "sha512-EfJS0rLfVuRuJRn4psJHtK2A9TqVnkxPpHY6lYHiB9+8eSuudsxbwMiavocG45ujOo6FJ+CIRlRnlOGinzkaGQ=="], diff --git a/package.json b/package.json index 19c9ecd..88c6876 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,13 @@ }, "dependencies": { "@fontsource/roboto": "^5.2.8", + "@iconify-json/material-symbols": "^1.2.46", "@neteasecloudmusicapienhanced/api": "^4.29.17", "@unocss/core": "^66.5.6", "@unocss/extractor-svelte": "^66.5.6", + "@unocss/preset-attributify": "^66.5.6", "@unocss/preset-icons": "^66.5.6", + "@unocss/reset": "^66.5.6", "m3-svelte": "^5.14.1", "openai": "^6.9.0", "sass": "^1.94.0", diff --git a/src/components/IconButton.svelte b/src/components/IconButton.svelte new file mode 100644 index 0000000..0e6a0e9 --- /dev/null +++ b/src/components/IconButton.svelte @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/src/components/SongInfo.svelte b/src/components/SongInfo.svelte new file mode 100644 index 0000000..e69de29 diff --git a/src/components/appbar/AppBar.svelte b/src/components/appbar/AppBar.svelte new file mode 100644 index 0000000..b4f426b --- /dev/null +++ b/src/components/appbar/AppBar.svelte @@ -0,0 +1,22 @@ + + +
+ {#if account} + + {:else} + history.back()} aria-label="Account" /> + {/if} +
{title}
+ {#if settings} + + {/if} +
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6e2e6d6..0451abd 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,15 +1,21 @@ - + {@render children()} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 34ce61f..ef7c6aa 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,8 +1,7 @@ -

Welcome to SvelteKit

-

Visit svelte.dev/docs/kit to read the documentation

- \ No newline at end of file + alert('Account clicked')} settings={() => alert('Settings clicked')} /> diff --git a/src/routes/app.sass b/src/routes/app.sass index 93bf7ae..c81e989 100644 --- a/src/routes/app.sass +++ b/src/routes/app.sass @@ -1,3 +1,7 @@ -html +:root font-family: 'Roboto', system-ui, sans-serif - color-scheme: light \ No newline at end of file + // color-scheme: light + +body + margin: 0 + background: rgb(var(--m3-scheme-background)) \ No newline at end of file diff --git a/src/routes/material.scss b/src/routes/material.scss index 6910b7c..2c9f377 100644 --- a/src/routes/material.scss +++ b/src/routes/material.scss @@ -5,9 +5,9 @@ color-scheme: light; } :root, ::backdrop { - --m3-scheme-background: 253 247 254; + --m3-scheme-background: 254 247 255; --m3-scheme-on-background: 52 49 58; - --m3-scheme-surface: 253 247 254; + --m3-scheme-surface: 254 247 255; --m3-scheme-surface-dim: 222 215 228; --m3-scheme-surface-bright: 253 247 254; --m3-scheme-surface-container-lowest: 255 255 255; diff --git a/uno.config.ts b/uno.config.ts index 20311ce..c8749bf 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -105,6 +105,12 @@ export default defineConfig({ })] ], shortcuts: { + // Azalea's shortcuts + 'hbox': 'flex flex-row items-center', + 'vbox': 'flex flex-col items-center', + 'cbox': 'flex justify-center items-center', + + // Marina 'form-error': 'text-3.5 font-medium text-destructive', 'form-warning': 'text-3.5 font-medium text-warning', 'form-info': 'text-3.5 font-medium text-muted-foreground', diff --git a/vite.config.ts b/vite.config.ts index bbf8c7d..b6226c6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,15 @@ -import { sveltekit } from '@sveltejs/kit/vite'; -import { defineConfig } from 'vite'; +import { sveltekit } from '@sveltejs/kit/vite' +import extractorSvelte from '@unocss/extractor-svelte' +import UnoCSS from 'unocss/vite' +import { defineConfig } from 'vite' export default defineConfig({ - plugins: [sveltekit()] -}); + plugins: [ + UnoCSS({ + extractors: [ + extractorSvelte(), + ], + }), + sveltekit(), + ], +}) \ No newline at end of file