diff --git a/.prettierrc b/.prettierrc index 3fe4b27..689b694 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,7 @@ { "plugins": [ - "prettier-plugin-astro" + "prettier-plugin-astro", + "prettier-plugin-tailwindcss" ], "overrides": [ { diff --git a/astro.config.mjs b/astro.config.mjs index 72cf507..7772610 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -11,5 +11,5 @@ export default defineConfig({ plugins: [tailwindcss()] }, - integrations: [svelte()] + integrations: [svelte()], }); \ No newline at end of file diff --git a/package.json b/package.json index 24b8b81..a3cdc07 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@skeletonlabs/skeleton-svelte": "^1.2.1", "@tailwindcss/vite": "^4.1.4", "astro": "^5.7.5", + "lucide-svelte": "^0.503.0", "svelte": "^5.28.2", "tailwindcss": "^4.1.4", "typescript": "^5.8.3" @@ -24,6 +25,7 @@ "eslint": "^9.25.1", "eslint-plugin-astro": "^1.3.1", "prettier": "3.5.3", - "prettier-plugin-astro": "0.14.1" + "prettier-plugin-astro": "0.14.1", + "prettier-plugin-tailwindcss": "^0.6.11" } } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 41ec4d5..b1f7378 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: astro: specifier: ^5.7.5 version: 5.7.5(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.40.0)(typescript@5.8.3)(yaml@2.7.1) + lucide-svelte: + specifier: ^0.503.0 + version: 0.503.0(svelte@5.28.2) svelte: specifier: ^5.28.2 version: 5.28.2 @@ -51,6 +54,9 @@ importers: prettier-plugin-astro: specifier: 0.14.1 version: 0.14.1 + prettier-plugin-tailwindcss: + specifier: ^0.6.11 + version: 0.6.11(prettier-plugin-astro@0.14.1)(prettier@3.5.3) packages: @@ -1554,6 +1560,11 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lucide-svelte@0.503.0: + resolution: {integrity: sha512-oT1idMbgJKCCLWI4U7bdUYUZqxS78fiTGJuKGZ5u0NJNyuiUErDu3G7sXkYpfDwwspeid7gZSjrlJbTINEfErw==} + peerDependencies: + svelte: ^3 || ^4 || ^5.0.0-next.42 + magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} @@ -1841,6 +1852,61 @@ packages: resolution: {integrity: sha512-RiBETaaP9veVstE4vUwSIcdATj6dKmXljouXc/DDNwBSPTp8FRkLGDSGFClKsAFeeg+13SB0Z1JZvbD76bigJw==} engines: {node: ^14.15.0 || >=16.0.0} + prettier-plugin-tailwindcss@0.6.11: + resolution: {integrity: sha512-YxaYSIvZPAqhrrEpRtonnrXdghZg1irNg4qrjboCXrpybLWVs55cW2N3juhspVJiO0JBvYJT8SYsJpc8OQSnsA==} + engines: {node: '>=14.21.3'} + peerDependencies: + '@ianvs/prettier-plugin-sort-imports': '*' + '@prettier/plugin-pug': '*' + '@shopify/prettier-plugin-liquid': '*' + '@trivago/prettier-plugin-sort-imports': '*' + '@zackad/prettier-plugin-twig': '*' + prettier: ^3.0 + prettier-plugin-astro: '*' + prettier-plugin-css-order: '*' + prettier-plugin-import-sort: '*' + prettier-plugin-jsdoc: '*' + prettier-plugin-marko: '*' + prettier-plugin-multiline-arrays: '*' + prettier-plugin-organize-attributes: '*' + prettier-plugin-organize-imports: '*' + prettier-plugin-sort-imports: '*' + prettier-plugin-style-order: '*' + prettier-plugin-svelte: '*' + peerDependenciesMeta: + '@ianvs/prettier-plugin-sort-imports': + optional: true + '@prettier/plugin-pug': + optional: true + '@shopify/prettier-plugin-liquid': + optional: true + '@trivago/prettier-plugin-sort-imports': + optional: true + '@zackad/prettier-plugin-twig': + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-css-order: + optional: true + prettier-plugin-import-sort: + optional: true + prettier-plugin-jsdoc: + optional: true + prettier-plugin-marko: + optional: true + prettier-plugin-multiline-arrays: + optional: true + prettier-plugin-organize-attributes: + optional: true + prettier-plugin-organize-imports: + optional: true + prettier-plugin-sort-imports: + optional: true + prettier-plugin-style-order: + optional: true + prettier-plugin-svelte: + optional: true + prettier@3.5.3: resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} engines: {node: '>=14'} @@ -4025,6 +4091,10 @@ snapshots: lru-cache@10.4.3: {} + lucide-svelte@0.503.0(svelte@5.28.2): + dependencies: + svelte: 5.28.2 + magic-string@0.30.17: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -4495,6 +4565,12 @@ snapshots: prettier: 3.5.3 sass-formatter: 0.7.9 + prettier-plugin-tailwindcss@0.6.11(prettier-plugin-astro@0.14.1)(prettier@3.5.3): + dependencies: + prettier: 3.5.3 + optionalDependencies: + prettier-plugin-astro: 0.14.1 + prettier@3.5.3: {} prismjs@1.30.0: {} diff --git a/public/grotesk.woff2 b/public/grotesk.woff2 new file mode 100644 index 0000000..ce2ec21 Binary files /dev/null and b/public/grotesk.woff2 differ diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte new file mode 100644 index 0000000..f1f9520 --- /dev/null +++ b/src/components/Footer.svelte @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/src/components/Header.svelte b/src/components/Header.svelte new file mode 100644 index 0000000..db5c406 --- /dev/null +++ b/src/components/Header.svelte @@ -0,0 +1,180 @@ + + +
+
+
+ + + + + + + +
+ + + + + + + + +
+
+
+ + + + {#if mobileMenuOpen} +
+
+ 首页 + 浏览 + 热门 + 最新 + 关于 + + +
+ + +
+
+
+ {/if} +
+ + \ No newline at end of file diff --git a/src/components/MirrorList.svelte b/src/components/MirrorList.svelte new file mode 100644 index 0000000..82a2a4c --- /dev/null +++ b/src/components/MirrorList.svelte @@ -0,0 +1,158 @@ + + +
+
+

镜像列表

+ + +
+
+ +
+ +
+ 排序: + +
+ + +
+ + + {#if loading} +
+
+
+ + {:else if error} +
+

加载失败: {error}

+ +
+ + {:else} +
+ + + + + + + + + + + {#each filteredMirrors as mirror (mirror.name)} + + + + + + + {:else} + + + + {/each} + +
镜像名称状态大小最后更新时间
{mirror.name} + + {mirror.status === 'success' ? '正常' : mirror.status === 'failed' ? '失败' : mirror.status === 'syncing' ? '同步中' : mirror.status} + + {mirror.size || 'N/A'}{mirror.lastUpdated}
未找到符合条件的镜像
+
+

共 {filteredMirrors.length} 个镜像

+ {/if} +
+
\ No newline at end of file diff --git a/src/components/Test.svelte b/src/components/Test.svelte index 58e5aa4..5fdb3b8 100644 --- a/src/components/Test.svelte +++ b/src/components/Test.svelte @@ -1,4 +1,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/layouts/BasicLayout.astro b/src/layouts/BasicLayout.astro new file mode 100644 index 0000000..dda9134 --- /dev/null +++ b/src/layouts/BasicLayout.astro @@ -0,0 +1,32 @@ +--- +// src/layouts/BaseLayout.astro +import Header from "../components/Header.svelte"; // 引入 Svelte 头部组件 +import Footer from "../components/Footer.svelte"; // 引入 Svelte 页脚组件 +import "@/styles/global.css"; // 引入全局样式(包含 Tailwind 和 Skeleton 基础) + +// 设置 HTML 的 data-theme 属性,让 Skeleton 主题生效 +// 注意:你可能需要 client:load 来确保 store 在客户端可用,或者在 中直接设置 +// 一个简单的示例,实际可能更复杂,取决于你的主题切换实现 +// const currentTheme = $theme; // 如果在 Astro 中直接读取 store +--- + + + + + + + + {Astro.props.title || "我的镜像站"} + + + +
+
+ +
+