docs/.vitepress/theme/components/LegendModal.vue
191 lines · 6941 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: 'Airgap / Transfer' },
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 v-if="isOpen" class="fixed inset-0 z-9999 p-4 sm:p-6 overflow-y-auto">
144 <!-- Backdrop -->
145 <div class="fixed inset-0 bg-black/50 backdrop-blur-sm" @click="$emit('close')" />
146
147 <!-- Modal -->
148 <div
149 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">
150 <div class="flex justify-between items-center mb-4 sm:mb-6">
151 <h2 class="text-$vp-c-text-1 text-lg sm:text-xl font-bold">
152 Legend
153 </h2>
154 <button class="text-$vp-c-text-2 hover:text-$vp-c-text-1 transition-colors p-1" @click="$emit('close')">
155 <div class="i-material-symbols-close text-lg" />
156 </button>
157 </div>
158
159 <div class="space-y-8">
160 <div v-for="section in sections" :key="section.title">
161 <h3 class="text-$vp-c-text-1 font-bold mb-3">
162 {{ section.title }}
163 </h3>
164 <div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2">
165 <div v-for="item in section.items" :key="item.label"
166 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">
167 <div :class="[item.icon, 'text-2xl mb-1 text-$vp-c-text-1']" />
168 <div class="text-$vp-c-text-2 text-xs text-center">
169 {{ item.label }}
170 </div>
171 </div>
172 </div>
173 </div>
174 </div>
175 </div>
176 </div>
177 </Transition>
178 </Teleport>
179</template>
180
181<style scoped>
182.modal-enter-active,
183.modal-leave-active {
184 transition: opacity 0.3s ease;
185}
186
187.modal-enter-from,
188.modal-leave-to {
189 opacity: 0;
190}
191</style>