|
1 | 1 | <script setup lang="ts"> |
2 | | -import { ref } from 'vue' |
| 2 | +import { ref, type Component } from 'vue' |
3 | 3 | import PageContainer from '../components/PageContainer.vue' |
4 | 4 | import ProductCard from '../components/ProductCard.vue' |
5 | 5 | 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' |
6 | 10 |
|
7 | 11 | let showDownload = ref(false) |
8 | 12 |
|
9 | 13 | const latestVersion = '1.5.0' |
10 | 14 | const oldestVersion = '1.5.0' |
11 | 15 |
|
12 | | -const downloadList = [ |
| 16 | +const downloadList: { icons: Component[], platform: string, subtitle: string, link: string }[] = [ |
13 | 17 | { |
14 | | - platform: 'iOS / iPadOS / macOS (Apple Silicon)', |
15 | | - channel: 'AppStore', |
| 18 | + icons: [IconApple], |
| 19 | + platform: 'iOS / iPadOS / macOS', |
| 20 | + subtitle: 'Download from App Store', |
16 | 21 | link: 'https://apps.apple.com/cn/app/%E6%97%A6%E5%A4%95/id1568629997' |
17 | 22 | }, { |
| 23 | + icons: [IconAndroid], |
18 | 24 | platform: 'Android', |
19 | | - channel: 'Download', |
| 25 | + subtitle: 'Download from CDN', |
20 | 26 | link: 'https://static.fduhole.com/danxi-latest.apk' |
21 | 27 | }, { |
| 28 | + icons: [IconWindows], |
22 | 29 | platform: 'Windows', |
23 | | - channel: 'GitHub Release', |
| 30 | + subtitle: 'Download from GitHub Release', |
24 | 31 | link: 'https://github.com/DanXi-Dev/DanXi/releases/latest' |
25 | 32 | }, { |
| 33 | + icons: [IconAndroid, IconOSI], |
26 | 34 | platform: 'Android FOSS', |
27 | | - channel: 'F-Droid', |
| 35 | + subtitle: 'Download from F-Droid', |
28 | 36 | link: 'https://f-droid.org/packages/io.github.danxi_dev.dan_xi/' |
29 | 37 | } |
30 | 38 | ] |
@@ -76,16 +84,17 @@ const userComment = [ |
76 | 84 | 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> |
77 | 85 | </div> |
78 | 86 | </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> |
89 | 98 | </div> |
90 | 99 | </PageContainer> |
91 | 100 |
|
|
0 commit comments