Skip to content

Commit

Permalink
style: 装饰
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamster5295 committed Jan 11, 2025
1 parent 5725806 commit 136bf5a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .vitepress/theme/components/Confitti.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
import confetti from "canvas-confetti";
confetti({
particleCount: 100,
spread: 170,
origin: { y: 0.6 },
});
</script>

<template></template>
2 changes: 2 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'
import Layout from "./Layout.vue";
import Confitti from "./components/Confitti.vue";

export default {
extends: DefaultTheme,
Expand All @@ -14,5 +15,6 @@ export default {
},
enhanceApp({ app, router, siteData }) {
// ...
app.component("Confitti", Confitti)
}
} satisfies Theme
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ features:
details: 总体积 < 1MB,无任何依赖项,开箱即用。支持使用 git 或 Unity Package Manager 引入项目。
---

<Confitti />
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"medium-zoom": "^1.1.0"
},
"devDependencies": {
"canvas-confetti": "^1.9.3",
"vitepress": "^1.5.0",
"vitepress-sidebar": "^1.30.2"
},
Expand Down

0 comments on commit 136bf5a

Please sign in to comment.