Skip to content

Commit 9849174

Browse files
committed
chore: fix lint
Signed-off-by: ZTL-UwU <zhangtianli2006@gmail.com>
1 parent fcfc48f commit 9849174

15 files changed

Lines changed: 93 additions & 89 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,3 @@ jobs:
2828
2929
- name: Lint
3030
run: bun lint --no-fix
31-
32-
typecheck:
33-
runs-on: ubuntu-latest
34-
steps:
35-
- id: checkout
36-
name: Checkout
37-
uses: actions/checkout@v3
38-
- id: setup-bun
39-
name: Setup Bun
40-
uses: oven-sh/setup-bun@v1
41-
with:
42-
bun-version: latest
43-
- id: install-deps
44-
name: Install dependencies
45-
run: |
46-
bun install
47-
48-
- name: Typecheck
49-
run: bun run typecheck

app/layouts/article.vue

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,37 @@
22
<div class="min-h-screen bg-gradient-to-br from-blue-50 via-blue-100 to-indigo-50 relative overflow-hidden">
33
<!-- 动态粒子背景 -->
44
<div class="absolute inset-0 z-0">
5-
<div v-for="i in 30" :key="i"
6-
class="absolute rounded-full bg-blue-200/40"
7-
:style="particleStyle(i)">
8-
</div>
5+
<div
6+
v-for="i in 30" :key="i"
7+
class="absolute rounded-full bg-blue-200/40"
8+
:style="particleStyle()"
9+
/>
910
</div>
10-
11+
1112
<!-- 中央Logo区域 -->
1213
<div class="fixed inset-0 flex items-center justify-center z-10 pointer-events-none">
1314
<div class="relative">
1415
<!-- 背景光晕效果 -->
15-
<div class="absolute inset-0 bg-blue-300/20 rounded-full blur-3xl transform scale-150 opacity-60"></div>
16+
<div class="absolute inset-0 bg-blue-300/20 rounded-full blur-3xl transform scale-150 opacity-60" />
1617
<NuxtImg src="/cosmo-logo.svg" class="aspect-square h-32 mb-6 opacity-70" />
17-
<!-- <span class="text-blue-600/60 text-sm font-light tracking-widest">CONTENT PLATFORM</span> -->
18+
<!-- <span class="text-blue-600/60 text-sm font-light tracking-widest">CONTENT PLATFORM</span> -->
1819
</div>
1920
</div>
20-
21+
2122
<!-- 动态光晕效果 -->
2223
<div
2324
class="fixed right-10 top-20 h-1/3 w-1/5 bg-gradient-to-r from-blue-200 to-cyan-100 blur-[120px] -z-10 transition-all duration-1000"
24-
:style="`opacity: 0.${count/2}; transform: translate(${count/5}px, ${count/10}px) rotate(${count/2}deg);`"
25+
:style="`opacity: 0.${count / 2}; transform: translate(${count / 5}px, ${count / 10}px) rotate(${count / 2}deg);`"
2526
/>
2627
<div
2728
class="fixed bottom-20 left-20 h-1/3 w-1/5 bg-gradient-to-r from-indigo-200 to-purple-100 blur-[120px] -z-10 transition-all duration-1000"
28-
:style="`opacity: 0.${count/2}; transform: translate(-${count/5}px, -${count/10}px) rotate(-${count/2}deg);`"
29+
:style="`opacity: 0.${count / 2}; transform: translate(-${count / 5}px, -${count / 10}px) rotate(-${count / 2}deg);`"
2930
/>
30-
31+
3132
<!-- 几何装饰元素 -->
32-
<div class="absolute top-1/4 left-10 w-32 h-32 border-2 border-blue-300/40 rounded-full transform -rotate-12"></div>
33-
<div class="absolute bottom-1/4 right-10 w-40 h-40 border-2 border-indigo-300/40 rounded-lg transform rotate-12"></div>
34-
33+
<div class="absolute top-1/4 left-10 w-32 h-32 border-2 border-blue-300/40 rounded-full transform -rotate-12" />
34+
<div class="absolute bottom-1/4 right-10 w-40 h-40 border-2 border-indigo-300/40 rounded-lg transform rotate-12" />
35+
3536
<!-- 主布局容器 -->
3637
<div class="container mx-auto px-4 py-8 max-w-4xl relative z-20">
3738
<!-- 直接插入页面内容 -->
@@ -47,29 +48,32 @@ const increasing = ref(true);
4748
4849
// 背景呼吸灯效果
4950
useIntervalFn(() => {
50-
if (count.value >= 95) increasing.value = false;
51-
if (count.value <= 30) increasing.value = true;
52-
if (increasing.value) count.value += 5;
51+
if (count.value >= 95)
52+
increasing.value = false;
53+
if (count.value <= 30)
54+
increasing.value = true;
55+
if (increasing.value)
56+
count.value += 5;
5357
else count.value -= 5;
5458
}, 300);
5559
5660
// 粒子背景样式生成器
57-
const particleStyle = (index) => {
61+
function particleStyle() {
5862
const size = Math.random() * 8 + 3;
5963
const left = Math.random() * 100;
6064
const top = Math.random() * 100;
6165
const opacity = Math.random() * 0.4 + 0.2;
6266
const animationDuration = Math.random() * 25 + 15;
63-
67+
6468
return {
6569
width: `${size}px`,
6670
height: `${size}px`,
6771
left: `${left}%`,
6872
top: `${top}%`,
69-
opacity: opacity,
70-
animation: `float ${animationDuration}s infinite ease-in-out`
73+
opacity,
74+
animation: `float ${animationDuration}s infinite ease-in-out`,
7175
};
72-
};
76+
}
7377
</script>
7478

7579
<style scoped>
@@ -95,4 +99,4 @@ const particleStyle = (index) => {
9599
.fade-enter, .fade-leave-to {
96100
opacity: 0;
97101
}
98-
</style>
102+
</style>

app/layouts/default.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<!-- Window buttons -->
2525
<div class="col-start-3 mr-2 flex justify-self-end gap-3 text-zinc-5">
2626
<UIcon v-if="screen === 'full'" name="i-ph:minus" class="cursor-pointer" @click="screen = 'minimized'" />
27-
<UIcon name="i-ph:plus" v-else class="cursor-pointer" @click="screen = 'full'" />
27+
<UIcon v-else name="i-ph:plus" class="cursor-pointer" @click="screen = 'full'" />
2828
<UIcon name="i-ph:square" class="cursor-pointer" @click="toggle" />
2929
<UIcon name="i-ph:x" class="cursor-pointer" />
3030
</div>

app/pages/[...slug].vue

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
<script setup lang="ts">
1+
<template>
2+
<NuxtLayout name="article" class="bg-white dark:bg-gray-800 ring-1 ring-gray-200 dark:ring-gray-700">
3+
<ContentRenderer
4+
v-if="page"
5+
:value="page"
6+
class="prose dark:prose-invert prose-pre:bg-gray-100 dark:prose-pre:bg-gray-900"
7+
/>
8+
<div class="flex justify-center">
9+
<Button class="bg-blue-100 text-gray-500 border border-blue-300 px-4 py-3 rounded" @click="navigateTo('/')">
10+
返回主页
11+
</Button>
12+
</div>
13+
</NuxtLayout>
14+
</template>
215

3-
const route = useRoute()
16+
<script setup lang="ts">
17+
const route = useRoute();
418
519
const { data: page } = await useAsyncData(`page-${route.params.slug}`, () => {
6-
return queryCollection('history').path(route.path).first()
7-
})
20+
return queryCollection('history').path(route.path).first();
21+
});
822
923
if (!page.value) {
1024
throw createError({
1125
statusCode: 404,
1226
statusMessage: 'Page not found',
13-
})
27+
});
1428
}
1529
16-
useSeoMeta(page.value?.seo || {})
30+
useSeoMeta(page.value?.seo || {});
1731
</script>
18-
19-
<template>
20-
<NuxtLayout :name="'article'" class="bg-white dark:bg-gray-800 ring-1 ring-gray-200 dark:ring-gray-700">
21-
<ContentRenderer
22-
v-if="page"
23-
:value="page"
24-
class="prose dark:prose-invert prose-pre:bg-gray-100 dark:prose-pre:bg-gray-900"
25-
/>
26-
<div class="flex justify-center">
27-
<Button @click="navigateTo('/')" class="bg-blue-100 text-gray-500 border border-blue-300 px-4 py-3 rounded">返回主页</Button>
28-
</div>
29-
</NuxtLayout>
30-
</template>

app/pages/history.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template>
1+
<template>
22
<div>
33
<Title>组织历程</Title>
44
<Hero />
@@ -17,7 +17,7 @@
1717
</div>
1818
</div>
1919
<div class="flex justify-center gap-10">
20-
<Button @click="navigateTo('/')" class="bg-blue-400 text-gray-500 border border-blue-300 px-4 py-3 rounded">
20+
<Button class="bg-blue-400 text-gray-500 border border-blue-300 px-4 py-3 rounded" @click="navigateTo('/')">
2121
返回主页
2222
</Button>
2323
</div>

app/pages/index.vue

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,52 @@
88
<div class="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 p-8">
99
<!-- 页面标题 -->
1010
<div class="text-center mb-12">
11-
<h1 class="text-4xl font-bold text-gray-800 mb-4">COSMO 智慧校园平台文档中心</h1>
12-
<p class="text-xl text-gray-600">选择您需要查看的文档</p>
11+
<h1 class="text-4xl font-bold text-gray-800 mb-4">
12+
COSMO 智慧校园平台文档中心
13+
</h1>
14+
<p class="text-xl text-gray-600">
15+
选择您需要查看的文档
16+
</p>
1317
</div>
1418

1519
<!-- 文档目录 -->
1620
<div class="max-w-4xl mx-auto">
1721
<!-- 加载状态 -->
1822
<div v-if="pending" class="text-center py-12">
19-
<div class="inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500"></div>
20-
<p class="mt-4 text-gray-600">加载文档目录中...</p>
23+
<div class="inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500" />
24+
<p class="mt-4 text-gray-600">
25+
加载文档目录中...
26+
</p>
2127
</div>
2228

2329
<!-- 目录内容 -->
2430
<div v-else-if="navigationData" class="bg-white/80 backdrop-blur-lg rounded-2xl shadow-xl border border-white/30 overflow-hidden">
2531
<!-- 目录头部 -->
2632
<div class="p-6 border-b border-gray-200/50">
27-
<h2 class="text-2xl font-bold text-gray-800">文档目录</h2>
28-
<p class="text-gray-600 mt-2">点击以下链接查看详细内容</p>
33+
<h2 class="text-2xl font-bold text-gray-800">
34+
文档目录
35+
</h2>
36+
<p class="text-gray-600 mt-2">
37+
点击以下链接查看详细内容
38+
</p>
2939
</div>
3040

3141
<!-- 目录列表 -->
3242
<div class="p-6">
3343
<ul class="space-y-3">
3444
<li v-for="item in navigationData" :key="item.path" class="group">
35-
<NuxtLink
36-
:to="item.path"
45+
<NuxtLink
46+
:to="item.path"
3747
class="flex items-center p-4 rounded-lg transition-all duration-300 group-hover:bg-blue-50 group-hover:shadow-md"
3848
active-class="bg-blue-100 border-l-4 border-blue-500"
3949
>
4050
<!-- 文档图标 -->
4151
<div class="flex-shrink-0 w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-4 group-hover:bg-blue-200 transition-colors">
4252
<svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
43-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
53+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
4454
</svg>
4555
</div>
46-
56+
4757
<!-- 文档标题和描述 -->
4858
<div class="flex-1">
4959
<h3 class="font-semibold text-gray-800 group-hover:text-blue-600 transition-colors">
@@ -56,11 +66,11 @@
5666
点击查看详细内容
5767
</p>
5868
</div>
59-
69+
6070
<!-- 导航箭头 -->
6171
<div class="flex-shrink-0 text-gray-400 group-hover:text-blue-500 transition-colors">
6272
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
63-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
73+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
6474
</svg>
6575
</div>
6676
</NuxtLink>
@@ -72,10 +82,14 @@
7282
<!-- 无数据状态 -->
7383
<div v-else class="text-center py-12 bg-white/80 backdrop-blur-lg rounded-2xl shadow-xl border border-white/30">
7484
<svg class="w-16 h-16 text-gray-400 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
75-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
85+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
7686
</svg>
77-
<h3 class="text-xl font-semibold text-gray-700 mb-2">暂无文档</h3>
78-
<p class="text-gray-600">当前没有可用的文档内容</p>
87+
<h3 class="text-xl font-semibold text-gray-700 mb-2">
88+
暂无文档
89+
</h3>
90+
<p class="text-gray-600">
91+
当前没有可用的文档内容
92+
</p>
7993
</div>
8094
</div>
8195

@@ -111,5 +125,5 @@ const texts = [
111125
},
112126
];
113127
// 获取导航数据
114-
const { data: navigationData,pending } = await useAsyncData('history', () => queryCollection('history').all())
128+
const { data: navigationData, pending } = await useAsyncData('history', () => queryCollection('history').all());
115129
</script>

app/pages/introduction.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template>
1+
<template>
22
<div>
33
<Title>详细介绍</Title>
44
<Hero />
@@ -17,7 +17,7 @@
1717
</div>
1818
</div>
1919
<div class="flex justify-center gap-10">
20-
<Button @click="navigateTo('/')" class="bg-blue-400 text-gray-500 border border-blue-300 px-4 py-3 rounded">
20+
<Button class="bg-blue-400 text-gray-500 border border-blue-300 px-4 py-3 rounded" @click="navigateTo('/')">
2121
返回主页
2222
</Button>
2323
</div>

content.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineCollection, defineContentConfig, z } from '@nuxt/content';
1+
import { defineCollection, defineContentConfig, z } from '@nuxt/content';
22

33
export default defineContentConfig({
44
collections: {

content/history/test1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# COSMO第七届
1+
# COSMO第七届
22
## 人员
33
**总负责人**
44
**技术部**

content/history/test2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: '我的第二篇文档'
33
date: '2025-9-28'
44
---

0 commit comments

Comments
 (0)