-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd643e3
commit e0ae472
Showing
7 changed files
with
257 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<div> | ||
<p align="center" style="font-size:12px; margin-top:0;"> | ||
<slot></slot> | ||
</p> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<script setup> | ||
const props = defineProps({ | ||
title: { | ||
type: String, | ||
default: '这里是站点title' | ||
}, | ||
logo: { | ||
type: String, | ||
default: '这里是站点logo' | ||
}, | ||
link: { | ||
type: String, | ||
default: 'https://lusun.com' | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="main-container"> | ||
<a :href="props.link"> | ||
<slot> | ||
<div class="link-style"> | ||
<img width="50px" :src="props.logo" alt=""> | ||
<div class="title">{{ props.title }}</div> | ||
</div> | ||
</slot> | ||
</a> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.main-container { | ||
width: 100%; | ||
background-color: var(--card-bg-color); | ||
text-align: center; | ||
border-radius: 5px; | ||
padding: 10px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} | ||
.main-container:hover { | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); | ||
transform: scale(1.01); | ||
transition: transform 0.3s; | ||
} | ||
.link-style { | ||
color: var(--text-color); | ||
display: flex; | ||
justify-content: start; | ||
align-items: center; | ||
} | ||
.title { | ||
margin-left: 10px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
// .vitepress/theme/index.js | ||
import ImgDesc from "../components/ImgDesc.vue"; | ||
import Link from "../components/Link.vue"; | ||
import DefaultTheme from "vitepress/theme"; | ||
import { onMounted, watch, nextTick } from "vue"; | ||
import { useRoute } from "vitepress"; | ||
import mediumZoom from "medium-zoom"; | ||
|
||
import "./custom.css"; | ||
|
||
export default DefaultTheme; | ||
export default { | ||
...DefaultTheme, | ||
extends: DefaultTheme, | ||
enhanceApp({ app }) { | ||
app.component("ImgDesc", ImgDesc); | ||
app.component("Link", Link); | ||
}, | ||
setup() { | ||
const route = useRoute(); | ||
const initZoom = () => { | ||
// 不显式添加{data-zoomable}的情况下为所有图像启用此功能 | ||
mediumZoom(".main img", { background: "var(--vp-c-bg)" }); | ||
}; | ||
onMounted(() => { | ||
initZoom(); | ||
}); | ||
watch( | ||
() => route.path, | ||
() => nextTick(() => initZoom()) | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.