Skip to content

Commit 539ea9b

Browse files
committed
feat: add ZVMS to projects
1 parent e8fe73c commit 539ea9b

File tree

6 files changed

+171
-1
lines changed

6 files changed

+171
-1
lines changed

.vitepress/theme/Layout.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ provide("toggle-appearance", async ({ clientX: x, clientY: y }: MouseEvent) => {
5252
>
5353
<a class="back" href="/posts/"> ❮ &nbsp; 返回目录 </a>
5454
</template>
55+
<template
56+
#doc-before
57+
v-if="
58+
page.filePath.startsWith('projects/') &&
59+
page.filePath !== 'projects/index.md'
60+
"
61+
>
62+
<a class="back" href="/projects/"> ❮ &nbsp; 返回目录 </a>
63+
</template>
5564
</DefaultTheme.Layout>
5665
</template>
5766

projects/Projects.vue

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<script setup lang="ts">
2+
import { useRouter } from "vitepress";
3+
const router = useRouter();
4+
</script>
5+
<template>
6+
<h1>Projects</h1>
7+
<div class="projects">
8+
<div @click="router.go('./projects/zvms/')">
9+
<h2>ZVMS</h2>
10+
<p>镇海中学义工管理系统</p>
11+
<p>一种很新的义工管理平台,历经 4 次重构,有 7 年历史</p>
12+
</div>
13+
</div>
14+
</template>
15+
<style scoped>
16+
.projects {
17+
display: flex;
18+
flex-direction: column;
19+
gap: 1.5rem;
20+
margin-top: 28px;
21+
}
22+
.projects > div {
23+
position: relative;
24+
background-color: var(--vp-c-bg-soft);
25+
border-radius: 12px;
26+
padding: 24px 24px;
27+
padding-right: 64px;
28+
transition: cubic-bezier(0.075, 0.82, 0.165, 1);
29+
transition-duration: 0.7s;
30+
transition-property: all;
31+
box-shadow: 0 18px 56px rgba(0, 0, 0, 0.16), 0 0px 12px rgba(0, 0, 0, 0.16);
32+
}
33+
.projects > div:hover {
34+
background-color: var(--vp-c-gray-3);
35+
box-shadow: 0 18px 56px rgba(0, 0, 0, 0.16),
36+
0px 0px 12px 2px var(--vp-c-brand-1);
37+
}
38+
.projects > div > h2 {
39+
margin: 0;
40+
padding: 0;
41+
margin-bottom: 12px;
42+
border: none;
43+
}
44+
.projects > div > p {
45+
margin: 0;
46+
padding: 0;
47+
border: none;
48+
color: var(--vp-c-text-2);
49+
line-height: 1.3rem;
50+
margin-bottom: 6px;
51+
}
52+
.projects > div::after {
53+
content: "";
54+
position: absolute;
55+
display: block;
56+
right: 32px;
57+
bottom: 38px;
58+
font-size: 50px;
59+
color: var(--vp-c-text-3);
60+
}
61+
.projects > div:hover::after {
62+
color: var(--vp-c-brand-1);
63+
}
64+
.projects > div:hover > h2 {
65+
color: var(--vp-c-brand-1);
66+
}
67+
</style>

projects/Repo.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script setup lang="ts">
2+
import { defineProps } from "vue";
3+
import { useData } from "vitepress";
4+
const { isDark } = useData();
5+
const { user, repo } = defineProps<{ user: string; repo: string }>();
6+
</script>
7+
<template>
8+
<a
9+
:href="`https://github.com/${user}/${repo}`"
10+
target="_blank"
11+
style="display: block"
12+
>
13+
<img
14+
:src="`https://github-readme-stats.vercel.app/api/pin/?username=${user}&repo=${repo}${
15+
isDark ? '&theme=dark' : ''
16+
}`"
17+
/>
18+
</a>
19+
</template>

projects/RepoGroup.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script setup lang="ts">
2+
import { defineProps } from "vue";
3+
const { name } = defineProps<{ name: string }>();
4+
</script>
5+
<template>
6+
<div class="name">{{ name }}</div>
7+
<div class="repo-group">
8+
<slot></slot>
9+
</div>
10+
</template>
11+
<style scoped>
12+
.name {
13+
font-family: "Courier New", Courier, monospace;
14+
font-weight: 550;
15+
font-size: large;
16+
margin-top: 18px;
17+
margin-bottom: 4px;
18+
margin-left: 4px;
19+
}
20+
.repo-group {
21+
display: flex;
22+
gap: 12px;
23+
flex-wrap: wrap;
24+
width: 80vw;
25+
}
26+
</style>

projects/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
# Projects
1+
<script setup>
2+
import Projects from './Projects.vue';
3+
</script>
4+
5+
<Projects />

projects/zvms/index.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
page: true
3+
outline: false
4+
---
5+
6+
<script setup>
7+
import Repo from "../Repo.vue";
8+
import RepoGroup from "../RepoGroup.vue";
9+
</script>
10+
11+
# ZVMS
12+
13+
镇海中学义工管理系统
14+
15+
历时 7 年,重构 4 次
16+
17+
目前已经投入使用,完全代替了纸质的义工本。全校每位同学都可以在自己的平板上使用
18+
19+
<RepoGroup name="v4">
20+
<Repo user="zvms" repo="zvms4-frontend" />
21+
</RepoGroup>
22+
23+
<RepoGroup name="v3">
24+
<Repo user="zvmsbackend" repo="zvms3" />
25+
</RepoGroup>
26+
27+
<RepoGroup name="v2">
28+
<Repo user="zvms" repo="zvms" />
29+
</RepoGroup>
30+
31+
<RepoGroup name="v1">
32+
<Repo user="zvms" repo="zvms1-frontend" />
33+
<Repo user="zvms" repo="zvms1-backend" />
34+
<Repo user="zvms" repo="zvms1-electron" />
35+
</RepoGroup>
36+
37+
<RepoGroup name="v0">
38+
<Repo user="ZhangZisu" repo="zvms" />
39+
<Repo user="ZhangZisu" repo="zvms-frontend" />
40+
</RepoGroup>
41+
42+
<RepoGroup name="others">
43+
<Repo user="zvms" repo="SignupScript" />
44+
<Repo user="zvms" repo="zvms-weather-widget" />
45+
</RepoGroup>

0 commit comments

Comments
 (0)