Skip to content

Commit 5f04a8b

Browse files
committed
upd: add download link button in homepage
1 parent f1f90eb commit 5f04a8b

5 files changed

Lines changed: 54 additions & 35 deletions

File tree

src/client/components/download-button.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ export default class DownloadButton extends Vue {
1616
@Prop({ type: Boolean, default: false }) isHome: Boolean;
1717
@Prop({ type: String, required: true }) version!: string;
1818
19-
// 检测是否为移动设备 - 使用传入的平台信息而不是直接检测 userAgent
20-
// 避免 SSR 水合不匹配问题
2119
get isMobileDevice(): boolean {
22-
// 基于传入的平台信息判断,而不是 navigator.userAgent
23-
// 只有 windows 和 mac 被认为是桌面平台
2420
return this.platform !== 'windows' && this.platform !== 'mac';
2521
}
2622

src/client/components/home-footer.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ footer {
5353
height: auto;
5454
margin-bottom: 50px;
5555
user-select: none;
56-
margin-top: 60px;
56+
margin-top: 200px;
5757
5858
@media screen and (max-width: 768px) {
5959
height: auto;
@@ -75,7 +75,6 @@ footer {
7575
7676
&-item {
7777
font-size: var(--font-small-size);
78-
// width: 150px;
7978
height: fit-content;
8079
padding: 5px 10px;
8180
color: var(--font-secondary-color);

src/client/components/nav-bar.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class NavBar extends Vue {
2929
}
3030
3131
checkMobile() {
32-
this.isMobile = window.innerWidth < 900;
32+
this.isMobile = window.innerWidth <= 768;
3333
if (!this.isMobile) {
3434
this.mobileMenuOpen = false;
3535
}
@@ -339,7 +339,7 @@ export default class NavBar extends Vue {
339339
340340
.content-header {
341341
height: 70px;
342-
@media screen and (max-width: 1000px) {
342+
@media screen and (max-width: 768px) {
343343
position: fixed;
344344
top: 0;
345345
}
@@ -356,7 +356,7 @@ export default class NavBar extends Vue {
356356
height: 100%;
357357
border-radius: 100px;
358358
359-
@media screen and (max-width: 1000px) {
359+
@media screen and (max-width: 768px) {
360360
width: 100vw;
361361
border-radius: 0;
362362
outline: none;
@@ -379,14 +379,13 @@ export default class NavBar extends Vue {
379379
}
380380
381381
& .logo {
382-
// flex-basis: 40%;
383382
width: fit-content;
384383
height: 100%;
385384
display: flex;
386385
justify-content: left;
387386
padding-left: 40px;
388387
cursor: pointer;
389-
@media screen and (max-width: 900px) {
388+
@media screen and (max-width: 768px) {
390389
flex-basis: 100%;
391390
justify-content: center;
392391
padding-left: 0;

src/client/modules/home/home.view.vue

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ export default class Home extends Vue {
5252
// 服务端默认为非移动设备
5353
this.isMobile = false;
5454
}
55-
}; private handleResize = () => {
55+
};
56+
private handleResize = () => {
5657
this.checkIfMobile();
5758
};
5859
@@ -80,7 +81,7 @@ export default class Home extends Vue {
8081
8182
// 等待版本数据加载完成
8283
while (!this.homeState.version) {
83-
await new Promise(resolve => setTimeout(resolve, 100));
84+
await new Promise((resolve) => setTimeout(resolve, 100));
8485
}
8586
8687
// 等待图片和其他资源加载完成
@@ -171,6 +172,21 @@ export default class Home extends Vue {
171172
})
172173
"
173174
>
175+
<svg
176+
xmlns="http://www.w3.org/2000/svg"
177+
width="24"
178+
height="24"
179+
viewBox="0 0 24 24"
180+
fill="none"
181+
stroke="currentColor"
182+
stroke-width="2"
183+
stroke-linecap="round"
184+
stroke-linejoin="round"
185+
>
186+
<circle cx="12" cy="12" r="10" />
187+
<path d="M12 8v8" />
188+
<path d="m8 12 4 4 4-4" />
189+
</svg>
174190
前往下载
175191
</div>
176192
</client-only>
@@ -183,18 +199,30 @@ export default class Home extends Vue {
183199

184200
<style scoped lang="less">
185201
.to-download-button {
186-
width: fit-content;
187-
height: fit-content;
188-
padding: 5px 20px;
189-
font-size: var(--font-small-size);
190-
background-color: var(--glass-bg-color);
191-
border: 2px solid var(--glass-border-color);
202+
padding: 10px 15px;
203+
@media screen and (min-width: 768px) {
204+
padding: 15px 20px;
205+
}
206+
@media screen and (min-width: 1700px) {
207+
padding: 20px 25px;
208+
}
209+
border: none;
210+
outline: none;
192211
border-radius: 100px;
193-
cursor: pointer;
212+
font-size: var(--font-small-size);
213+
font-weight: 600;
214+
text-decoration: none;
215+
display: flex;
216+
justify-content: center;
217+
align-items: center;
218+
gap: 6px;
219+
margin-top: 100px;
220+
background-color: rgba(255, 255, 255, 0.1);
221+
backdrop-filter: blur(15px);
222+
outline: 1px solid rgba(255, 255, 255, 0.4);
194223
color: var(--font-secondary-color);
195-
z-index: 10;
196-
transition: color 0.3s ease;
197-
margin: 50px;
224+
transition: color 0.5s ease;
225+
cursor: pointer;
198226
&:hover {
199227
color: var(--font-primary-color);
200228
}
@@ -229,11 +257,13 @@ export default class Home extends Vue {
229257
}
230258
231259
/* 动态组件过渡效果 */
232-
.beams-enter-active, .beams-leave-active {
260+
.beams-enter-active,
261+
.beams-leave-active {
233262
transition: opacity 0.8s ease-in-out;
234263
}
235264
236-
.beams-enter-from, .beams-leave-to {
265+
.beams-enter-from,
266+
.beams-leave-to {
237267
opacity: 0;
238268
}
239269
</style>

src/client/modules/releases/releases.view.vue

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ export default class Releases extends Vue {
3232
const response = await axios.get('https://cdn.algoux.cn/algo-bootstrap/version.json?t=' + Date.now());
3333
return {
3434
releasesState: response.data,
35-
}
35+
};
3636
} catch (error) {
3737
console.error('Failed to load release data in asyncData:', error);
3838
return {
3939
releasesState: this.releasesState, // 使用默认值
40-
}
40+
};
4141
}
4242
}
4343
@@ -68,14 +68,13 @@ export default class Releases extends Vue {
6868
@import url('../../index.less');
6969
.release {
7070
width: 100%;
71-
height: 100vh;
71+
height: auto;
7272
gap: 70px;
7373
position: relative;
7474
@media screen and (max-width: 1200px) {
75-
height: auto;
7675
gap: 40px;
7776
}
78-
padding-top: 120px;
77+
padding-top: 150px;
7978
background-color: var(--bg-color);
8079
display: flex;
8180
flex-direction: column;
@@ -92,13 +91,9 @@ export default class Releases extends Vue {
9291
width: 100%;
9392
height: auto;
9493
display: flex;
95-
@media screen and (max-width: 1200px) {
96-
flex-direction: column;
97-
gap: 50px;
98-
margin-bottom: 100px;
99-
}
10094
10195
@media screen and (max-width: 768px) {
96+
flex-direction: column;
10297
gap: 50px;
10398
margin-bottom: 50px;
10499
}

0 commit comments

Comments
 (0)