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