添加链接视图并更新路由,移除关于视图,集成 GitHub 贡献图

This commit is contained in:
2025-03-05 10:12:08 +08:00
parent d57b407df8
commit c360e53fed
9 changed files with 212 additions and 45 deletions

107
package-lock.json generated
View File

@ -11,6 +11,7 @@
"@element-plus/icons-vue": "^2.3.1",
"@fortawesome/fontawesome-free": "^6.7.2",
"element-plus": "^2.9.5",
"github-calendar": "^2.3.4",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
@ -999,6 +1000,12 @@
"node": ">=0.4.0"
}
},
"node_modules/add-subtract-date": {
"version": "1.0.16",
"resolved": "https://registry.npmjs.org/add-subtract-date/-/add-subtract-date-1.0.16.tgz",
"integrity": "sha512-pmGFYgOmVhZ7R47PB/h/BLt/f77rVZL3WXvxSUWKSd6RTe7lHu7ZalQUYWJ2RXNIuv9KKZjstyuKnNQqbqtoGw==",
"license": "MIT"
},
"node_modules/anymatch": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
@ -1081,6 +1088,15 @@
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz",
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="
},
"node_modules/days": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/days/-/days-1.1.1.tgz",
"integrity": "sha512-vzeIwVsEIyA35GH4+mPd4hjVDNI87wYANyZFs0BHjBr5kIBH5zEl7LfD6Wr4SFZca4D3CU9IH1w4DuZLlXzKRw==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
@ -1123,6 +1139,16 @@
"vue": "^3.2.0"
}
},
"node_modules/elly": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/elly/-/elly-1.1.11.tgz",
"integrity": "sha512-WFKVcEKEOjdSOhNYFKWQoJDk0Sb0re6v0fIsGkePn97dmPpKM/YoOKRdYIb34T1R13KPRNzDBDmT/Flb/54NXg==",
"license": "MIT",
"dependencies": {
"iterate-object": "^1.3.2",
"sliced": "^1.0.1"
}
},
"node_modules/entities": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
@ -1202,6 +1228,24 @@
"node": ">=8"
}
},
"node_modules/fillo": {
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/fillo/-/fillo-1.0.15.tgz",
"integrity": "sha512-AU9+1s5J2halrmGGe9On+a8TXfbaXsY9JLz/sxPsmcISaqcGn0M9Pt6cQzKPesqdzQdSQ08JJHH5RZR9HdF2Jw==",
"license": "MIT"
},
"node_modules/formatoid": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/formatoid/-/formatoid-1.2.5.tgz",
"integrity": "sha512-ADuqDTwrQd0800jF0G6tL3mWwO8aGStjypqvrwkhTnoQc2fD1hc9reGtrMiRmWK7ti1n2NUfy+6WKfJ+AJUsvA==",
"license": "MIT",
"dependencies": {
"days": "^1.0.1",
"fillo": "^1.0.0",
"months": "^1.0.0",
"parse-it": "^1.0.0"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@ -1216,6 +1260,33 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/github-calendar": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/github-calendar/-/github-calendar-2.3.4.tgz",
"integrity": "sha512-B2szQw0xVOluHYeuamkVtJXCHk5TaVyPjw2z4ynfnGlQ/jr2cb66SPgeNDcDHlGONOipQccWxv/VNVN5Gqr14A==",
"license": "MIT",
"dependencies": {
"add-subtract-date": "^1.0.15",
"elly": "^1.1.11",
"formatoid": "^1.2.4",
"github-calendar-parser": "^1.2.2"
}
},
"node_modules/github-calendar-legend": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/github-calendar-legend/-/github-calendar-legend-1.0.12.tgz",
"integrity": "sha512-dVsVt22egxG3VEkJdQTdgphQkDj4FyQ1Sen4o4GteEz4SA7s2rX9j2fDR46fZaPLU8IXfL4Ig0h3z/zmb6ORWA==",
"license": "MIT"
},
"node_modules/github-calendar-parser": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/github-calendar-parser/-/github-calendar-parser-1.2.3.tgz",
"integrity": "sha512-yd7GcKibU01nfD82h5dxLVUOaNDySABhYN/Y29OP1p03h38UpJxy23qe2hheIHbtZAwvQ15ErPAapgVGXmbYnQ==",
"license": "MIT",
"dependencies": {
"github-calendar-legend": "^1.0.11"
}
},
"node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
@ -1276,6 +1347,12 @@
"node": ">=0.12.0"
}
},
"node_modules/iterate-object": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/iterate-object/-/iterate-object-1.3.5.tgz",
"integrity": "sha512-eL23u8oFooYTq6TtJKjp2RYjZnCkUYQvC0T/6fJfWykXJ3quvdDdzKZ3CEjy8b3JGOvLTjDYMEMIp5243R906A==",
"license": "MIT"
},
"node_modules/local-pkg": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.1.1.tgz",
@ -1355,6 +1432,15 @@
"pathe": "^2.0.1"
}
},
"node_modules/months": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/months/-/months-1.2.0.tgz",
"integrity": "sha512-zFM7hUpziSYGk2DNObYGWgHdRRxAOgjl8CC1Rbl50p/q0rGDsREfk0nbxxmSIquVi/lEAuUY8nwbwkZ8biNCOQ==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@ -1392,6 +1478,15 @@
"resolved": "https://registry.npmjs.org/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
},
"node_modules/parse-it": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/parse-it/-/parse-it-1.0.11.tgz",
"integrity": "sha512-1OWDPQNF7eUxkqPdP4vFu96QnVwQjy2zag5CZcF3Ipd12s1iu8nPpgNBsda0tgZlj04vSrIZ5DQr2bqp5Cn6UQ==",
"license": "MIT",
"dependencies": {
"regex-escape": "^3.4.0"
}
},
"node_modules/path": {
"version": "0.12.7",
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
@ -1500,6 +1595,12 @@
"node": ">=8.10.0"
}
},
"node_modules/regex-escape": {
"version": "3.4.11",
"resolved": "https://registry.npmjs.org/regex-escape/-/regex-escape-3.4.11.tgz",
"integrity": "sha512-051l4Hl/0HoJwTvNztrWVjoxLiseSfCrDgWqwR1cnGM/nyQSeIjmvti5zZ7HzOmsXDPaJ2k0iFxQ6/WNpJD5wQ==",
"license": "MIT"
},
"node_modules/rollup": {
"version": "4.34.9",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.9.tgz",
@ -1538,6 +1639,12 @@
"fsevents": "~2.3.2"
}
},
"node_modules/sliced": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz",
"integrity": "sha512-VZBmZP8WU3sMOZm1bdgTadsQbcscK0UM8oKxKVBs4XAhUo2Xxzm/OFMGBkPusxw9xL3Uy8LrzEqGqJhclsr0yA==",
"license": "MIT"
},
"node_modules/source-map-js": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",

View File

@ -12,6 +12,7 @@
"@element-plus/icons-vue": "^2.3.1",
"@fortawesome/fontawesome-free": "^6.7.2",
"element-plus": "^2.9.5",
"github-calendar": "^2.3.4",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},

BIN
src/assets/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -1,8 +1,16 @@
<template>
<el-menu mode="horizontal" router>
<el-menu-item index="/">首页</el-menu-item>
<el-menu-item @click="goToBlog">博客</el-menu-item>
<el-menu-item index="/about">关于</el-menu-item>
<el-menu mode="horizontal" router class="custom-menu">
<!-- 左侧网站名 -->
<div class="website-name">
<span style="font-weight: bold">Kisechan </span>
</div>
<!-- 右侧导航选项 -->
<div class="menu-items">
<el-menu-item index="/">首页</el-menu-item>
<el-menu-item @click="goToBlog">博客</el-menu-item>
<el-menu-item index="/links">链接</el-menu-item>
</div>
</el-menu>
</template>
@ -13,8 +21,27 @@ const goToBlog = () => {
</script>
<style scoped>
.el-menu {
.custom-menu {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
}
.menu-items {
display: flex;
justify-content: center;
}
.el-menu--horizontal > .el-menu-item:nth-child(1) {
margin-right: auto;
}
.el-menu-item {
font-size: 16px;
}
.website-name {
font-size: 1.5em;
}
</style>

View File

@ -6,6 +6,7 @@ import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/styles/global.css'
import '@fortawesome/fontawesome-free/css/all.css';
import 'github-calendar/dist/github-calendar-responsive.css';
const app = createApp(App)

View File

@ -7,9 +7,9 @@ const routes = [
component: () => import('@/views/HomeView.vue')
},
{
path: '/about',
name: 'about',
component: () => import('@/views/AboutView.vue')
path: '/links',
name: 'links',
component: () => import('@/views/LinksView.vue')
}
]

View File

@ -1,30 +0,0 @@
<template>
<div class="about-container">
<el-main>
<el-row :gutter="20">
<!-- 左侧正文 -->
<el-col :span="16">
<el-card>
<h2>ABOUT</h2>
<p>passage...</p>
</el-card>
</el-col>
<!-- 右侧作者信息 -->
<el-col :span="8">
<div class="author-info">
<!-- <el-avatar :size="150" :src="require('@/assets/avatar.jpg')" /> -->
<h3>name</h3>
<p>info...</p>
</div>
</el-col>
</el-row>
</el-main>
</div>
</template>
<style scoped>
</style>
<script setup>
</script>

View File

@ -1,17 +1,65 @@
<template>
<div class="home-container">
<!-- <NavBar /> -->
<el-main>
<div class="content">
<h1>test</h1>
<h3>Make By Vue + Vite + Element Plus</h3>
<p>Building...</p>
</div>
<el-row :gutter="20">
<!-- 左侧正文 -->
<el-col :span="16">
<el-card>
<p>passage...</p>
<div class="github-calendar-container">
<!-- 贡献图容器 -->
<div id="github-graph"></div>
</div>
</el-card>
</el-col>
<!-- 右侧作者信息 -->
<el-col :span="8">
<div class="author-info">
<el-avatar :size="120" :src="avatarUrl" />
<h3>Hello</h3>
<i>"Non est ad astra mollis e trris via."</i>
</div>
</el-col>
</el-row>
</el-main>
</div>
</template>
<script setup>
import avatarUrl from "@/assets/avatar.png";
import { onMounted } from "vue";
import GitHubCalendar from "github-calendar";
// 在组件挂载后初始化 GitHub 贡献图
onMounted(() => {
GitHubCalendar("#github-graph", "Kisechan", {
responsive: true, // 响应式设计
tooltips: true, // 显示提示信息
});
});
</script>
<style scoped></style>
<style scoped>
.home-container {
padding: 20px;
}
.author-info {
text-align: center;
}
.el-avatar {
margin-bottom: 10px;
}
.github-calendar-container {
margin: 20px;
}
#github-graph {
width: 100%;
max-width: 800px;
margin: 0 auto;
}
</style>

13
src/views/LinksView.vue Normal file
View File

@ -0,0 +1,13 @@
<template>
<div class="about-container">
<el-main>
<p>Links</p>
</el-main>
</div>
</template>
<style scoped>
</style>
<script setup>
</script>