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

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

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