docs/.vitepress/theme/components/LegendModal.vue
211 lines · 7300 bytes
1<!--
2 All Rights Reserved
3
4 Copyright (c) 2025 taskylizard
5
6 All rights reserved. This code and its associated files may not be copied, modified, distributed, sublicensed, or used in any form, in whole or in part, without prior written permission from the copyright holder.
7-->
8<script setup lang="ts">
9defineProps<{
10 isOpen: boolean
11}>()
12
13defineEmits<{
14 (e: 'close'): void
15}>()
16
17const sections = [
18 {
19 title: 'Frequent',
20 items: [
21 { icon: 'i-twemoji-glowing-star', label: 'Favorite' },
22 { icon: 'i-mdi-puzzle', label: 'Extension / Plugin' },
23 { icon: 'i-material-symbols-directions-alt', label: 'Proxies' },
24 { icon: 'i-twemoji-no-one-under-eighteen', label: 'R18' },
25 { icon: 'i-material-symbols-person-add', label: 'Needs account' },
26 { icon: 'i-material-symbols-help', label: 'Help / Docs' },
27 { icon: 'i-mdi-arrow-right-bold', label: 'Related' }
28 ]
29 },
30 {
31 title: 'System',
32 items: [
33 { icon: 'i-simple-icons-windows', label: 'Windows' },
34 { icon: 'i-simple-icons-android', label: 'Android' },
35 { icon: 'i-simple-icons-apple', label: 'Apple' },
36 { icon: 'i-simple-icons-linux', label: 'Linux' },
37 { icon: 'i-simple-icons-freebsd', label: 'BSD' },
38 { icon: 'i-material-symbols-terminal-rounded', label: 'CLI / TUI' },
39 { icon: 'i-simple-icons-firefoxbrowser', label: 'Firefox' },
40 { icon: 'i-simple-icons-googlechrome', label: 'Chromium' },
41 { icon: 'i-mdi-web', label: 'Web' }
42 ]
43 },
44 {
45 title: 'Type',
46 items: [
47 { icon: 'i-material-symbols-play-circle-outline', label: 'Stream' },
48 {
49 icon: 'i-material-symbols-cloud-download-outline-rounded',
50 label: 'Online / DDL'
51 },
52 { icon: 'i-lucide-magnet', label: 'Torrent / p2p' },
53 { icon: 'i-iconoir-floppy-disk', label: 'Local file' },
54 { icon: 'i-material-symbols-package-2-outline', label: 'Batch Download' },
55 { icon: 'i-lucide-file', label: 'Single Page Mode' },
56 { icon: 'i-lucide-book-open', label: 'Double Page Mode' },
57 { icon: 'i-lucide-scroll', label: 'Long-Strip Mode' }
58 ]
59 },
60 {
61 title: 'Price',
62 items: [
63 { icon: 'i-ic-round-attach-money', label: 'Paid' },
64 { icon: 'i-ic-round-currency-exchange', label: 'Subscription' },
65 { icon: 'i-ic-round-money-off-csred', label: 'Has free content' },
66 { icon: 'i-akar-icons-coin', label: 'Coin / Point' },
67 { icon: 'i-ic-round-add-shopping-cart', label: 'Freemium' }
68 ]
69 },
70 {
71 title: 'Source',
72 items: [
73 { icon: 'i-simple-icons-github', label: 'GitHub' },
74 { icon: 'i-simple-icons-gitlab', label: 'GitLab' },
75 { icon: 'i-simple-icons-codeberg', label: 'Codeberg' },
76 { icon: 'i-simple-icons-kde', label: 'KDE' },
77 { icon: 'i-simple-icons-gnome', label: 'GNOME' },
78 { icon: 'i-simple-icons-gitea', label: 'Gitea' },
79 { icon: 'i-material-symbols-lock-outline', label: 'Closed Source' }
80 ]
81 },
82 {
83 title: 'Platform',
84 items: [
85 { icon: 'i-simple-icons-discord', label: 'Discord' },
86 { icon: 'i-simple-icons-4chan', label: '4chan' },
87 { icon: 'i-simple-icons-twitter', label: 'Twitter' },
88 { icon: 'i-simple-icons-telegram', label: 'Telegram' },
89 { icon: 'i-simple-icons-myanimelist', label: 'MyAnimeList' },
90 { icon: 'i-simple-icons-anilist', label: 'AniList' },
91 { icon: 'i-simple-icons-kitsu', label: 'Kitsu' },
92 { icon: 'i-simple-icons-simkl', label: 'Simkl' }
93 ]
94 },
95 {
96 title: 'Storage',
97 items: [
98 { icon: 'i-simple-icons-googledrive', label: 'Google Drive' },
99 { icon: 'i-simple-icons-mega', label: 'MEGA' },
100 { icon: 'i-simple-icons-mediafire', label: 'MediaFire' },
101 { icon: 'i-mdi-snail', label: 'Other Host' }
102 ]
103 },
104 {
105 title: 'Region',
106 items: [
107 { icon: 'i-twemoji-flag-japan', label: 'Japan' },
108 { icon: 'i-twemoji-flag-south-korea', label: 'Korea' },
109 { icon: 'i-twemoji-flag-china', label: 'China' }
110 ]
111 },
112 {
113 title: 'Code',
114 items: [
115 { icon: 'i-simple-icons-javascript', label: 'JavaScript' },
116 { icon: 'i-mdi-language-css3', label: 'CSS' },
117 { icon: 'i-simple-icons-python', label: 'Python' },
118 { icon: 'i-simple-icons-docker', label: 'Docker' }
119 ]
120 },
121 {
122 title: 'Others',
123 items: [
124 { icon: 'i-material-symbols-science', label: 'Nightly build' },
125 { icon: 'i-lucide-mail', label: 'Feedback' },
126 { icon: 'i-material-symbols-info-outline-rounded', label: 'More Info' },
127 { icon: 'i-ic-round-looks-two', label: 'Alternative' },
128 { icon: 'i-simple-icons-rss', label: 'RSS Feed' },
129 { icon: 'i-mdi-airplane', label: 'Testflight' },
130 { icon: 'i-twemoji-check-mark-button', label: 'Yes / Available' },
131 { icon: 'i-twemoji-cross-mark', label: 'No / Unavailable' },
132 { icon: 'i-twemoji-globe-showing-asia-australia', label: 'Global' },
133 { icon: 'i-mdi-closed-caption', label: 'Subtitles / CC' },
134 { icon: 'i-mdi-hulu', label: 'Hardsubs' }
135 ]
136 }
137]
138</script>
139
140<template>
141 <Teleport to="body">
142 <Transition name="modal">
143 <div
144 v-if="isOpen"
145 class="fixed inset-0 z-9999 p-4 sm:p-6 overflow-y-auto"
146 >
147 <!-- Backdrop -->
148 <div
149 class="fixed inset-0 bg-black/50 backdrop-blur-sm"
150 @click="$emit('close')"
151 />
152
153 <!-- Modal -->
154 <div
155 class="relative mx-auto bg-$vp-c-bg rounded-lg border-2 border-$vp-c-default-soft p-4 sm:p-6 shadow-xl w-full max-w-4xl mt-16 mb-8"
156 >
157 <div class="flex justify-between items-center mb-4 sm:mb-6">
158 <h2
159 class="text-$vp-c-text-1 text-lg sm:text-xl font-bold align-center vl-middle flex items-center"
160 >
161 <div class="i-lucide-badge-info text-$vp-c-text-1 mr-2" />
162 Icon key
163 </h2>
164 <button
165 class="text-$vp-c-text-2 hover:text-$vp-c-text-1 transition-colors p-1"
166 @click="$emit('close')"
167 >
168 <div class="i-material-symbols-close text-lg" />
169 </button>
170 </div>
171
172 <div class="space-y-8">
173 <div v-for="section in sections" :key="section.title">
174 <h3 class="text-$vp-c-text-1 font-bold mb-3">
175 {{ section.title }}
176 </h3>
177 <div
178 class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2"
179 >
180 <div
181 v-for="item in section.items"
182 :key="item.label"
183 class="flex flex-col items-center justify-center p-3 rounded-lg bg-$vp-c-bg-alt hover:bg-$vp-c-bg-elv transition-colors"
184 >
185 <div
186 :class="[item.icon, 'text-2xl mb-1 text-$vp-c-text-1']"
187 />
188 <div class="text-$vp-c-text-2 text-xs text-center">
189 {{ item.label }}
190 </div>
191 </div>
192 </div>
193 </div>
194 </div>
195 </div>
196 </div>
197 </Transition>
198 </Teleport>
199</template>
200
201<style scoped>
202.modal-enter-active,
203.modal-leave-active {
204 transition: opacity 0.3s ease;
205}
206
207.modal-enter-from,
208.modal-leave-to {
209 opacity: 0;
210}
211</style>