From 7671309edf4288ee2069fa970cb9293fe21385c1 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Thu, 13 Mar 2025 21:52:24 +0000 Subject: [PATCH] refactor: fix button positions and adjust component structure --- package.json | 2 +- pnpm-lock.yaml | 32 ++--- src/components/Comments/Waline.astro | 2 + src/components/Footer.astro | 8 ++ src/components/Navbar.astro | 2 +- src/components/Widgets/LanguageSwitcher.astro | 110 +++++++++--------- src/components/Widgets/ThemeToggle.astro | 53 +-------- src/config.ts | 2 +- src/layouts/Layout.astro | 84 +++++++++++-- uno.config.ts | 3 +- 10 files changed, 161 insertions(+), 137 deletions(-) diff --git a/package.json b/package.json index f0611fc..ed5984d 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@astrojs/rss": "^4.0.11", "@astrojs/sitemap": "^3.2.1", "@rehype-pretty/transformers": "^0.13.2", - "astro": "^5.5.1", + "astro": "^5.5.2", "astro-compress": "^2.3.6", "astro-og-canvas": "^0.7.0", "astro-robots-txt": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db5a2b4..f3cc804 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: version: 0.9.4(typescript@5.8.2) '@astrojs/mdx': specifier: ^4.2.0 - version: 4.2.0(astro@5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0)) + version: 4.2.0(astro@5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0)) '@astrojs/partytown': specifier: ^2.1.4 version: 2.1.4 @@ -27,14 +27,14 @@ importers: specifier: ^0.13.2 version: 0.13.2 astro: - specifier: ^5.5.1 - version: 5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) + specifier: ^5.5.2 + version: 5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) astro-compress: specifier: ^2.3.6 version: 2.3.6(@types/node@22.13.10)(jiti@2.4.2)(rollup@4.35.0)(typescript@5.8.2)(yaml@2.7.0) astro-og-canvas: specifier: ^0.7.0 - version: 0.7.0(astro@5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0)) + version: 0.7.0(astro@5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0)) astro-robots-txt: specifier: ^1.0.0 version: 1.0.0 @@ -1267,8 +1267,8 @@ packages: astro-robots-txt@1.0.0: resolution: {integrity: sha512-6JQSLid4gMhoWjOm85UHLkgrw0+hHIjnJVIUqxjU2D6feKlVyYukMNYjH44ZDZBK1P8hNxd33PgWlHzCASvedA==} - astro@5.5.1: - resolution: {integrity: sha512-1bA4e7lbGKO0eXcuXy6GV8wjsypdrOO6EPLP3l1rNddMdkmj67VlMjWUp/3bti+kOe46ocXxJDh7Ux2L77YWjQ==} + astro@5.5.2: + resolution: {integrity: sha512-SOTJxB8mqxe/KEYEJiLIot0YULiCffyfTEclwmdeaASitDJ7eLM/KYrJ9sx3U5hq9GVI17Z4Y0P/1T2aQ0ZN3A==} engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'} hasBin: true @@ -1623,8 +1623,8 @@ packages: duplexer@0.1.2: resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==} - electron-to-chromium@1.5.116: - resolution: {integrity: sha512-mufxTCJzLBQVvSdZzX1s5YAuXsN1M4tTyYxOOL1TcSKtIzQ9rjIrm7yFK80rN5dwGTePgdoABDSHpuVtRQh0Zw==} + electron-to-chromium@1.5.117: + resolution: {integrity: sha512-G4+CYIJBiQ72N0gi868tmG4WsD8bwLE9XytBdfgXO5zdlTlvOP2ABzWYILYxCIHmsbm2HjBSgm/E/H/QfcnIyQ==} emmet@2.4.11: resolution: {integrity: sha512-23QPJB3moh/U9sT4rQzGgeyyGIrcM+GH5uVYg2C6wZIxAIJq7Ng3QLT79tl8FUwDXhyq9SusfknOrofAKqvgyQ==} @@ -3895,12 +3895,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/mdx@4.2.0(astro@5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0))': + '@astrojs/mdx@4.2.0(astro@5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0))': dependencies: '@astrojs/markdown-remark': 6.3.0 '@mdx-js/mdx': 3.1.0(acorn@8.14.1) acorn: 8.14.1 - astro: 5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) + astro: 5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) es-module-lexer: 1.6.0 estree-util-visit: 2.0.0 hast-util-to-html: 9.0.5 @@ -5007,7 +5007,7 @@ snapshots: '@playform/pipe': 0.1.2 '@types/csso': 5.0.4 '@types/html-minifier-terser': 7.0.2 - astro: 5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) + astro: 5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) commander: 13.0.0 csso: 5.0.5 deepmerge-ts: 7.1.3 @@ -5067,9 +5067,9 @@ snapshots: transitivePeerDependencies: - supports-color - astro-og-canvas@0.7.0(astro@5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0)): + astro-og-canvas@0.7.0(astro@5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0)): dependencies: - astro: 5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) + astro: 5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0) canvaskit-wasm: 0.39.1 deterministic-object-hash: 2.0.2 entities: 4.5.0 @@ -5079,7 +5079,7 @@ snapshots: valid-filename: 4.0.0 zod: 3.24.2 - astro@5.5.1(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0): + astro@5.5.2(@types/node@22.13.10)(jiti@2.4.2)(lightningcss@1.28.2)(rollup@4.35.0)(terser@5.37.0)(typescript@5.8.2)(yaml@2.7.0): dependencies: '@astrojs/compiler': 2.11.0 '@astrojs/internal-helpers': 0.6.1 @@ -5221,7 +5221,7 @@ snapshots: browserslist@4.24.4: dependencies: caniuse-lite: 1.0.30001704 - electron-to-chromium: 1.5.116 + electron-to-chromium: 1.5.117 node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.24.4) @@ -5480,7 +5480,7 @@ snapshots: duplexer@0.1.2: {} - electron-to-chromium@1.5.116: {} + electron-to-chromium@1.5.117: {} emmet@2.4.11: dependencies: diff --git a/src/components/Comments/Waline.astro b/src/components/Comments/Waline.astro index 3005141..e31c8cf 100644 --- a/src/components/Comments/Waline.astro +++ b/src/components/Comments/Waline.astro @@ -33,6 +33,8 @@ const { > + + --> diff --git a/src/components/Widgets/ThemeToggle.astro b/src/components/Widgets/ThemeToggle.astro index c0981e8..032b659 100644 --- a/src/components/Widgets/ThemeToggle.astro +++ b/src/components/Widgets/ThemeToggle.astro @@ -1,12 +1,7 @@ ---- -import { themeConfig } from '@/config' - -const { light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color ---- - - diff --git a/src/config.ts b/src/config.ts index 48af0d4..c781318 100644 --- a/src/config.ts +++ b/src/config.ts @@ -58,7 +58,7 @@ export const themeConfig: ThemeConfig = { // font styles for text fontStyle: 'sans', // sans, serif // date format for posts - dateFormat: 'MONTH DAY YYYY', // YYYY-MM-DD, MM-DD-YYYY, DD-MM-YYYY, MONTH DAY YYYY, DAY MONTH YYYY + dateFormat: 'YYYY-MM-DD', // YYYY-MM-DD, MM-DD-YYYY, DD-MM-YYYY, MONTH DAY YYYY, DAY MONTH YYYY // space between title and subtitle titleSpace: 3, // 1, 2, 3 }, diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 9c79966..b89b862 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -4,13 +4,14 @@ import Footer from '@/components/Footer.astro' import MainHeader from '@/components/MainHeader.astro' import MobileHeader from '@/components/MobileHeader.astro' import Navigation from '@/components/Navbar.astro' -// import LanguageSwitcher from '@/components/Widgets/LanguageSwitcher.astro' +import LanguageSwitcher from '@/components/Widgets/LanguageSwitcher.astro' // import PhotoSwipe from '@/components/PhotoSwipe.astro' // import Scrollbar from '@/components/Scrollbar.astro' import ThemeToggle from '@/components/Widgets/ThemeToggle.astro' import themeConfig from '@/config' import Head from '@/layouts/Head.astro' import { getPagePath } from '@/utils/path' + import '@/styles/font.css' import '@/styles/global.css' import '@/styles/heti.css' @@ -23,8 +24,8 @@ interface Props { const { postTitle, postDescription, postSlug } = Astro.props const { isHome, isPost } = getPagePath(Astro.url.pathname) +const { light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color const fontStyle = themeConfig.global.fontStyle === 'serif' ? 'font-serif' : 'font-sans' - const footerMarginClass = isPost && themeConfig.comment?.waline?.serverURL ? 'mt-8' : 'mt-12' @@ -45,31 +46,94 @@ const footerMarginClass = isPost && themeConfig.comment?.waline?.serverURL
+
+
- {!isHome && isPost && } + + {!isHome && isPost && } +
-
-
- -
- - + +
+ + +
+ + +
+ + + + diff --git a/uno.config.ts b/uno.config.ts index a85850f..3fd506d 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -33,13 +33,14 @@ export default defineConfig({ }, }, shortcuts: { - 'uno-article-underline': 'underline mx-0.25em decoration-secondary/25 font-medium underline-0.075em underline-offset-0.2em hover:(c-primary decoration-primary/60 transition)', + 'uno-article-underline': 'underline mx-0.25em decoration-secondary/50 font-medium underline-0.075em underline-offset-0.2em hover:(c-primary decoration-primary/75 transition)', 'uno-tags-style': 'inline-block whitespace-nowrap border border-secondary/25 rounded-full px-3.2 py-0.7 c-secondary transition-colors hover:(border-secondary/75 text-primary)', 'uno-tag-active': 'border-secondary/75 text-primary', 'uno-decorative-line': 'h-0.25 w-10 bg-secondary opacity-25', 'uno-mobile-time': 'mb-5.625 text-3.5 leading-6.875 font-time lg:(hidden)', 'uno-desktop-time': 'mb-5.625 hidden text-3.65 leading-6.875 font-time lg:(ml-2.5 inline)', 'uno-tags-wrapper': 'mt-4.375 w-95% flex flex-wrap gap-3', + 'uno-button': 'aspect-square w-4 c-secondary active:scale-90 hover:c-primary', }, rules: [ ['scrollbar-hidden', {