Skip to content

Commit 204304a

Browse files
committed
update docs
1 parent af0e2bc commit 204304a

File tree

4 files changed

+91
-3
lines changed

4 files changed

+91
-3
lines changed

docs/.vuepress/components/Footer.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
<a
1212
href="https://github.com/fastapi-practices/fastapi_best_architecture"
1313
target="_blank"
14-
rel="noopener noreferrer"
1514
class="social-link"
1615
>
1716
<Icon name="line-md:github" size="2rem" />
1817
</a>
18+
<a
19+
href="https://discord.com/invite/yNN3wTbVAC"
20+
target="_blank"
21+
class="social-link"
22+
>
23+
<Icon name="line-md:discord" size="2rem" />
24+
</a>
1925
<a href="/fastapi_best_architecture_docs/blog/" class="social-link">
2026
<Icon name="la:blog" size="2rem" />
2127
</a>

docs/.vuepress/components/SponsorHome.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@
88
</section>
99
<section v-else id="special-spsr">
1010
<span class="no-brand">
11-
<a href="/fastapi_best_architecture_docs/sponsors.html" target="_self">独家赞助商席位现已空缺 - 立即咨询</a>
11+
<a href="/fastapi_best_architecture_docs/sponsors.html" target="_self">
12+
<GradientText
13+
text="独家赞助商席位现已空缺 - 立即咨询"
14+
:colors="['#009485', 'rgba(162,84,240)']"
15+
:animation-speed="3"
16+
/>
17+
</a>
1218
</span>
1319
</section>
1420
</template>
1521

1622
<script lang="ts" setup>
1723
import { homeSponsor, shouldShowSponsor } from "../data/sponsors";
24+
import GradientText from "./bits/GradientText.vue";
1825
</script>
1926

2027
<style scoped>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<script setup lang="ts">
2+
import { computed } from 'vue';
3+
4+
interface GradientTextProps {
5+
text: string;
6+
className?: string;
7+
colors?: string[];
8+
animationSpeed?: number;
9+
showBorder?: boolean;
10+
}
11+
12+
const props = withDefaults(defineProps<GradientTextProps>(), {
13+
text: '',
14+
className: '',
15+
colors: () => ['#ffaa40', '#9c40ff', '#ffaa40'],
16+
animationSpeed: 8,
17+
showBorder: false
18+
});
19+
20+
const gradientStyle = computed(() => ({
21+
backgroundImage: `linear-gradient(to right, ${ props.colors.join(', ') })`,
22+
animationDuration: `${ props.animationSpeed }s`,
23+
backgroundSize: '300% 100%',
24+
'--animation-duration': `${ props.animationSpeed }s`
25+
}));
26+
27+
const borderStyle = computed(() => ({
28+
...gradientStyle.value
29+
}));
30+
31+
const textStyle = computed(() => ({
32+
...gradientStyle.value,
33+
backgroundClip: 'text',
34+
WebkitBackgroundClip: 'text'
35+
}));
36+
</script>
37+
38+
<template>
39+
<div
40+
:class="`relative mx-auto flex max-w-fit flex-row items-center justify-center rounded-[1.25rem] font-medium backdrop-blur transition-shadow duration-500 overflow-hidden cursor-pointer ${className}`"
41+
>
42+
<div
43+
v-if="showBorder"
44+
class="absolute inset-0 bg-cover z-0 pointer-events-none animate-gradient"
45+
:style="borderStyle"
46+
>
47+
<div
48+
class="absolute inset-0 bg-black rounded-[1.25rem] z-[-1]"
49+
style="width: calc(100% - 2px); height: calc(100% - 2px); left: 50%; top: 50%; transform: translate(-50%, -50%)"
50+
/>
51+
</div>
52+
53+
<div class="inline-block relative z-2 text-transparent bg-cover animate-gradient" :style="textStyle">
54+
{{ text }}
55+
</div>
56+
</div>
57+
</template>
58+
59+
<style scoped>
60+
@keyframes gradient {
61+
0% {
62+
background-position: 0% 50%;
63+
}
64+
50% {
65+
background-position: 100% 50%;
66+
}
67+
100% {
68+
background-position: 0% 50%;
69+
}
70+
}
71+
72+
.animate-gradient {
73+
animation: gradient var(--animation-duration, 8s) linear infinite;
74+
}
75+
</style>

docs/.vuepress/styles/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
/* 公告板 */
4141
.vp-bulletin {
42-
width: 380px;
42+
width: 380px !important;
4343
}
4444

4545
/* 首页文字说明 */

0 commit comments

Comments
 (0)