Skip to content

Commit 44a8f4e

Browse files
committed
update docs
1 parent 2afdb8b commit 44a8f4e

File tree

4 files changed

+70
-21
lines changed

4 files changed

+70
-21
lines changed

docs/.vuepress/components/SponsorHome.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { homeSponsor } from "../data/sponsors";
88
<a :href="homeSponsor.href" target="_blank">
99
<img width="121" :src="homeSponsor.link" :alt="homeSponsor.alt" />
1010
</a>
11-
<span>{{ homeSponsor.description }}</span>
11+
<span>{{ homeSponsor.text || homeSponsor.alt }}</span>
1212
</section>
1313
<section v-else id="special-spsr">
1414
<span class="no-sponsor">
15-
<a href="/fastapi_best_architecture_docs/sponsors#展位赞助商">特别赞助位目前空缺 - 现在咨询 💬</a>
15+
<a href="/fastapi_best_architecture_docs/sponsors">特别赞助位目前空缺 - 现在咨询 💬</a>
1616
</span>
1717
</section>
1818
</template>
@@ -42,8 +42,6 @@ import { homeSponsor } from "../data/sponsors";
4242
padding: 12px;
4343
display: flex;
4444
align-items: center;
45-
margin: 0 -9999px;
46-
padding: 1 9999px;
4745
}
4846
4947
#special-spsr span {
@@ -57,6 +55,10 @@ import { homeSponsor } from "../data/sponsors";
5755
text-align: right;
5856
}
5957
58+
#special-spsr a {
59+
padding: 0 24px;
60+
}
61+
6062
#special-spsr img {
6163
height: 52px;
6264
margin: -6px 0;

docs/.vuepress/components/SponsorPanel.vue

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,35 @@
66
<Icon v-else name="iconamoon:arrow-down-2" />
77
</span>
88
</div>
9-
<div class="sponsor-container" v-if="!isCollapsed">
9+
<div class="sponsor-container">
1010
<div class="gold-sponsors">
1111
<div
1212
v-for="(sponsor, index) in goldSponsors"
1313
:key="'gold-' + index"
1414
class="sponsor-item gold"
15+
:class="{ 'collapsed-mode': isCollapsed }"
1516
@click="openSponsorLink(sponsor.href)"
17+
v-show="!isCollapsed || (isCollapsed && hasValidText(sponsor))"
1618
>
1719
<img v-if="sponsor.link" :src="sponsor.link" :alt="sponsor.alt" class="sponsor-image" />
18-
<span v-else class="sponsor-text">{{ sponsor.text }}</span>
20+
<span v-if="hasText(sponsor)" class="sponsor-text" :class="{ 'collapsed-text': isCollapsed }">
21+
{{ sponsor.text || sponsor.alt }}
22+
</span>
1923
</div>
2024
</div>
2125
<div class="general-sponsors">
2226
<div
2327
v-for="(sponsor, index) in generalSponsors"
2428
:key="'general-' + index"
2529
class="sponsor-item"
30+
:class="{ 'collapsed-mode': isCollapsed }"
2631
@click="openSponsorLink(sponsor.href)"
32+
v-show="!isCollapsed || (isCollapsed && hasValidText(sponsor))"
2733
>
2834
<img v-if="sponsor.link" :src="sponsor.link" :alt="sponsor.alt" class="sponsor-image" />
29-
<span v-else class="sponsor-text">{{ sponsor.text }}</span>
35+
<span v-if="hasText(sponsor)" class="sponsor-text" :class="{ 'collapsed-text': isCollapsed }">
36+
{{ sponsor.text || sponsor.alt }}
37+
</span>
3038
</div>
3139
</div>
3240
</div>
@@ -38,6 +46,15 @@ import { goldSponsors, generalSponsors } from "../data/sponsors";
3846
3947
const isCollapsed = ref(sessionStorage.getItem("sponsorCollapsed") === "true");
4048
49+
const hasText = (sponsor) => {
50+
return !!sponsor.text || !!sponsor.alt;
51+
};
52+
53+
const hasValidText = (sponsor) => {
54+
const text = sponsor.text || sponsor.alt || '';
55+
return hasText(sponsor) && !text.includes('成为赞助商');
56+
};
57+
4158
const toggleCollapse = () => {
4259
isCollapsed.value = !isCollapsed.value;
4360
sessionStorage.setItem("sponsorCollapsed", isCollapsed.value);
@@ -97,6 +114,8 @@ onMounted(() => {
97114
align-items: center;
98115
justify-content: center;
99116
height: 66px;
117+
transition: all 0.3s ease;
118+
position: relative;
100119
}
101120
102121
.sponsor-item:hover {
@@ -108,17 +127,46 @@ onMounted(() => {
108127
}
109128
110129
.sponsor-image {
130+
position: absolute;
111131
width: 100%;
112132
height: 100%;
113133
object-fit: fill;
134+
transition: opacity 0.3s ease;
114135
}
115136
116137
.sponsor-text {
117138
color: var(--vp-c-text-3);
118139
font-size: 10px;
140+
white-space: nowrap;
141+
text-overflow: ellipsis;
142+
overflow: hidden;
143+
max-width: 100%;
144+
padding: 0 8px;
119145
}
120146
121147
.sponsor-item.gold .sponsor-text {
122148
font-size: 12px;
123149
}
150+
151+
.sponsor-item.collapsed-mode {
152+
height: 28px;
153+
}
154+
155+
.sponsor-item.gold.collapsed-mode {
156+
height: 32px;
157+
}
158+
159+
.collapsed-mode .sponsor-image {
160+
opacity: 0;
161+
}
162+
163+
.collapsed-text {
164+
color: var(--vp-c-brand-1) !important;
165+
font-weight: 600;
166+
transform: scale(1.05);
167+
}
168+
169+
.collapsed-mode:hover .collapsed-text {
170+
color: var(--vp-c-text-1) !important;
171+
}
124172
</style>

docs/.vuepress/data/sponsors.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,28 @@ export const homeSponsor = ref(
77
link: '',
88
text: '成为赞助商',
99
href: sponsorUrl,
10-
alt: 'wu-clan',
11-
description: 'fba 官方合作伙伴',
10+
alt: 'fba 官方合作伙伴'
1211
}
1312
)
1413

1514
export const goldSponsors = ref([
1615
{
17-
link: 'https://dscache.tencent-cloud.cn/upload//rhino-design-800x450-fea2ea55b7b63624628bf9bb22454cb8f91b7d69.png',
16+
link: '',
1817
text: '【腾讯云】春季大促,助力开工,2核2G云服务器低至 68元/年',
1918
href: 'https://curl.qcloud.com/f9VMAii8',
20-
alt: 'wu-clan',
19+
alt: '',
2120
},
2221
{
2322
link: 'https://img14.360buyimg.com/ddimg/jfs/t1/284966/5/22913/37242/68023351Faddd8304/6337ad52ea02ad10.jpg',
2423
text: '302.AI',
2524
href: 'https://share.302.ai/LJojhb',
26-
alt: 'wu-clan',
25+
alt: '',
2726
},
2827
{
2928
link: '',
3029
text: '成为赞助商',
3130
href: sponsorUrl,
32-
alt: 'wu-clan',
31+
alt: '',
3332
}
3433
])
3534

@@ -38,36 +37,36 @@ export const generalSponsors = ref([
3837
link: 'https://user.by.ltd/templates/lagom/assets/img/logo/logo_big.png',
3938
text: 'Bywave',
4039
href: 'https://user.by.ltd/aff.php?aff=12215',
41-
alt: 'wu-clan',
40+
alt: '',
4241
},
4342
{
4443
link: '',
4544
text: '成为赞助商',
4645
href: sponsorUrl,
47-
alt: 'wu-clan',
46+
alt: '',
4847
},
4948
{
5049
link: '',
5150
text: '成为赞助商',
5251
href: sponsorUrl,
53-
alt: 'wu-clan',
52+
alt: '',
5453
},
5554
{
5655
link: '',
5756
text: '成为赞助商',
5857
href: sponsorUrl,
59-
alt: 'wu-clan',
58+
alt: '',
6059
},
6160
{
6261
link: '',
6362
text: '成为赞助商',
6463
href: sponsorUrl,
65-
alt: 'wu-clan',
64+
alt: '',
6665
},
6766
{
6867
link: '',
6968
text: '成为赞助商',
7069
href: sponsorUrl,
71-
alt: 'wu-clan',
70+
alt: '',
7271
}
7372
])

docs/plugin/market.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ title: 插件市场
127127
<Badge text="extra" color="var(--vp-c-text-2)" bg-color="rgb(17 170 0 / 38%)"/>
128128
</span>
129129
</LinkCard>
130-
<LinkCard icon="ant-design:wechat-work-outlined" title="配置下发" href="https://github.com/dividduang/wecom-task">
131-
<p style="color: #898989;">企业微信群聊机器人定时发送消息</p>
130+
<LinkCard icon="ant-design:wechat-work-outlined" title="企微 bot 定时任务" href="https://github.com/dividduang/wecom-task">
131+
<p style="color: #898989;">定时调用企业微信群聊机器人发送消息</p>
132132
<span>
133133
<Icon name="logos:mysql" size="1.5em" />
134134
·

0 commit comments

Comments
 (0)