docs/.vitepress/theme/components/LegendModal.vue

a15d2141dc85f794fe73826dfe417e96f1f1d430
wotaku/docs/.vitepress/theme/components/LegendModal.vue history · blame · raw

215 lines · 7446 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-ic-round-money-off-csred', label: 'Has free content' },
 72      { icon: 'i-akar-icons-coin', label: 'Coin / Point' },
 73      { icon: 'i-ic-round-add-shopping-cart', label: 'Freemium' },
 74    ]
 75  },
 76  {
 77    title: 'Source',
 78    items: [
 79      { icon: 'i-simple-icons-github', label: 'GitHub' },
 80      { icon: 'i-simple-icons-gitlab', label: 'GitLab' },
 81      { icon: 'i-simple-icons-codeberg', label: 'Codeberg' },
 82      { icon: 'i-simple-icons-kde', label: 'KDE' },
 83      { icon: 'i-simple-icons-gnome', label: 'GNOME' },
 84      { icon: 'i-simple-icons-gitea', label: 'Gitea' },
 85      { icon: 'i-material-symbols-lock-outline', label: 'Closed Source' }
 86    ]
 87  },
 88  {
 89    title: 'Platform',
 90    items: [
 91      { icon: 'i-simple-icons-discord', label: 'Discord' },
 92      { icon: 'i-simple-icons-4chan', label: '4chan' },
 93      { icon: 'i-simple-icons-twitter', label: 'Twitter' },
 94      { icon: 'i-simple-icons-telegram', label: 'Telegram' },
 95      { icon: 'i-simple-icons-myanimelist', label: 'MyAnimeList' },
 96      { icon: 'i-simple-icons-anilist', label: 'AniList' },
 97      { icon: 'i-simple-icons-kitsu', label: 'Kitsu' },
 98      { icon: 'i-simple-icons-simkl', label: 'Simkl' }
 99    ]
100  },
101  {
102    title: 'Storage',
103    items: [
104      { icon: 'i-simple-icons-googledrive', label: 'Google Drive' },
105      { icon: 'i-simple-icons-mega', label: 'MEGA' },
106      { icon: 'i-simple-icons-mediafire', label: 'MediaFire' },
107      { icon: 'i-mdi-snail', label: 'Other Host' }
108    ]
109  },
110  {
111    title: 'Region',
112    items: [
113      { icon: 'i-twemoji-flag-japan', label: 'Japan' },
114      { icon: 'i-twemoji-flag-south-korea', label: 'Korea' },
115      { icon: 'i-twemoji-flag-china', label: 'China' }
116    ]
117  },
118  {
119    title: 'Code',
120    items: [
121      { icon: 'i-simple-icons-javascript', label: 'JavaScript' },
122      { icon: 'i-mdi-language-css3', label: 'CSS' },
123      { icon: 'i-simple-icons-python', label: 'Python' },
124      { icon: 'i-simple-icons-docker', label: 'Docker' }
125    ]
126  },
127  {
128    title: 'Others',
129    items: [
130      { icon: 'i-material-symbols-science', label: 'Nightly build' },
131      { icon: 'i-lucide-mail', label: 'Feedback' },
132      { icon: 'i-material-symbols-info-outline-rounded', label: 'More Info' },
133      { icon: 'i-ic-round-looks-two', label: 'Alternative' },
134      { icon: 'i-simple-icons-rss', label: 'RSS Feed' },
135      { icon: 'i-mdi-airplane', label: 'Airgap / Transfer' },
136      { icon: 'i-twemoji-check-mark-button', label: 'Yes / Available' },
137      { icon: 'i-twemoji-cross-mark', label: 'No / Unavailable' },
138      { icon: 'i-twemoji-globe-showing-asia-australia', label: 'Global' },
139      { icon: 'i-mdi-closed-caption', label: 'Subtitles / CC' },
140      { icon: 'i-mdi-hulu', label: 'Hardsubs' }
141    ]
142  }
143]
144
145</script>
146
147<template>
148  <Teleport to="body">
149    <Transition name="modal">
150      <div
151        v-if="isOpen"
152        class="fixed inset-0 z-9999 p-4 sm:p-6 overflow-y-auto"
153      >
154        <!-- Backdrop -->
155        <div
156          class="fixed inset-0 bg-black/50 backdrop-blur-sm"
157          @click="$emit('close')"
158        />
159
160        <!-- Modal -->
161        <div
162          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"
163        >
164          <div class="flex justify-between items-center mb-4 sm:mb-6">
165            <h2 class="text-$vp-c-text-1 text-lg sm:text-xl font-bold">
166              Legend
167            </h2>
168            <button
169              class="text-$vp-c-text-2 hover:text-$vp-c-text-1 transition-colors p-1"
170              @click="$emit('close')"
171            >
172              <div class="i-material-symbols-close text-lg" />
173            </button>
174          </div>
175
176          <div class="space-y-8">
177            <div v-for="section in sections" :key="section.title">
178              <h3 class="text-$vp-c-text-1 font-bold mb-3">
179                {{ section.title }}
180              </h3>
181              <div
182                class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2"
183              >
184                <div
185                  v-for="item in section.items"
186                  :key="item.label"
187                  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"
188                >
189                  <div
190                    :class="[item.icon, 'text-2xl mb-1 text-$vp-c-text-1']"
191                  />
192                  <div class="text-$vp-c-text-2 text-xs text-center">
193                    {{ item.label }}
194                  </div>
195                </div>
196              </div>
197            </div>
198          </div>
199        </div>
200      </div>
201    </Transition>
202  </Teleport>
203</template>
204
205<style scoped>
206.modal-enter-active,
207.modal-leave-active {
208  transition: opacity 0.3s ease;
209}
210
211.modal-enter-from,
212.modal-leave-to {
213  opacity: 0;
214}
215</style>