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