Skip to content

Commit 0bfd417

Browse files
committed
feat: redesign download section with card layout and platform icons
1 parent f5b4456 commit 0bfd417

3 files changed

Lines changed: 32 additions & 17 deletions

File tree

.vitepress/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineConfig } from 'vitepress'
2+
import Icons from 'unplugin-icons/vite'
23
import nav from './nav'
34
// import sidebar from './sidebar'
45
// import socialLinks from './social-links'
@@ -27,6 +28,9 @@ export default defineConfig({
2728
}
2829
},
2930
vite: {
31+
plugins: [
32+
Icons({ compiler: 'vue3' })
33+
],
3034
server: {
3135
proxy: {
3236
"/api": {

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
"r": "vitepress serve"
1313
},
1414
"devDependencies": {
15+
"@iconify-json/simple-icons": "^1.2.70",
1516
"autoprefixer": "^10.4.21",
1617
"postcss": "^8.5.3",
1718
"tailwindcss": "^3.4.17",
19+
"unplugin-icons": "^23.0.1",
1820
"vitepress": "^1.6.3",
1921
"vue": "^3.5.13"
2022
},

src/views/ProjectAppView.vue

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,38 @@
11
<script setup lang="ts">
2-
import { ref } from 'vue'
2+
import { ref, type Component } from 'vue'
33
import PageContainer from '../components/PageContainer.vue'
44
import ProductCard from '../components/ProductCard.vue'
55
import Saying from '../components/Saying.vue'
6+
import IconApple from '~icons/simple-icons/apple'
7+
import IconAndroid from '~icons/simple-icons/android'
8+
import IconWindows from '~icons/simple-icons/windows'
9+
import IconOSI from '~icons/simple-icons/opensourceinitiative'
610
711
let showDownload = ref(false)
812
913
const latestVersion = '1.5.0'
1014
const oldestVersion = '1.5.0'
1115
12-
const downloadList = [
16+
const downloadList: { icons: Component[], platform: string, subtitle: string, link: string }[] = [
1317
{
14-
platform: 'iOS / iPadOS / macOS (Apple Silicon)',
15-
channel: 'AppStore',
18+
icons: [IconApple],
19+
platform: 'iOS / iPadOS / macOS',
20+
subtitle: 'Download from App Store',
1621
link: 'https://apps.apple.com/cn/app/%E6%97%A6%E5%A4%95/id1568629997'
1722
}, {
23+
icons: [IconAndroid],
1824
platform: 'Android',
19-
channel: 'Download',
25+
subtitle: 'Download from CDN',
2026
link: 'https://static.fduhole.com/danxi-latest.apk'
2127
}, {
28+
icons: [IconWindows],
2229
platform: 'Windows',
23-
channel: 'GitHub Release',
30+
subtitle: 'Download from GitHub Release',
2431
link: 'https://github.com/DanXi-Dev/DanXi/releases/latest'
2532
}, {
33+
icons: [IconAndroid, IconOSI],
2634
platform: 'Android FOSS',
27-
channel: 'F-Droid',
35+
subtitle: 'Download from F-Droid',
2836
link: 'https://f-droid.org/packages/io.github.danxi_dev.dan_xi/'
2937
}
3038
]
@@ -76,16 +84,17 @@ const userComment = [
7684
class="mx-2 mt-5 rounded-2xl bg-gray-800 text-gray-50 px-5 py-2 hover:bg-gray-500 text-lg">GitHub</button></a>
7785
</div>
7886
</div>
79-
<div class="p-5" v-show="showDownload">
80-
<table class="m-auto">
81-
<tr>
82-
<td class="px-5 font-bold">Danta</td>
83-
</tr>
84-
<tr v-for="d in downloadList">
85-
<td class="px-5">{{ d.platform }}</td>
86-
<td class="px-5"><a class="font-semibold" :href="d.link">{{ d.channel }}</a></td>
87-
</tr>
88-
</table>
87+
<div class="mt-6 flex flex-col items-center gap-3 max-w-md mx-auto" v-show="showDownload">
88+
<a v-for="d in downloadList" :key="d.platform" :href="d.link"
89+
class="w-full flex items-center gap-4 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-5 py-3.5 transition hover:shadow-md hover:border-gray-400 dark:hover:border-gray-500 no-underline group">
90+
<span class="flex items-center justify-center gap-1.5 shrink-0 w-10 text-gray-600 dark:text-gray-300">
91+
<component v-for="(icon, i) in d.icons" :key="i" :is="icon" class="w-5 h-5" />
92+
</span>
93+
<span class="flex flex-col">
94+
<span class="text-sm font-medium text-gray-800 dark:text-gray-100 group-hover:text-black dark:group-hover:text-white transition">{{ d.platform }}</span>
95+
<span class="text-xs text-gray-400 dark:text-gray-500">{{ d.subtitle }}</span>
96+
</span>
97+
</a>
8998
</div>
9099
</PageContainer>
91100

0 commit comments

Comments
 (0)