Commit 946350e3e1

946350e3e1482dc2801e9623d0392f610916dedd

parent: 606ce65cb4

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-06-23 16:39 UTC

cards

Layout: unified · split

docs/.vitepress/configs/constants.ts +154
@@ -7,6 +7,160 @@
7 */ 7 */
8import type { DefaultTheme } from 'vitepress' 8import type { DefaultTheme } from 'vitepress'
9 9
10export interface HomeCard {
11 id: string
12 icon: string
13 title: string
14 details: string
15 link: string
16 featured?: boolean
17}
18
19// @unocss-include
20export const homeCards: HomeCard[] = [
21 {
22 id: 'websites',
23 icon: ':lucide-earth:',
24 title: 'Websites',
25 details: 'Websites for anime, manga, novels & tokusatsu',
26 link: '/websites',
27 featured: true
28 },
29 {
30 id: 'software',
31 icon: ':lucide-box:',
32 title: 'Software',
33 details: 'Software for every Operating System',
34 link: '/software',
35 featured: true
36 },
37 {
38 id: 'misc',
39 icon: ':lucide-folder-open:',
40 title: 'Misc-sites',
41 details: 'Various sites for database, info, tracking news & tools',
42 link: '/misc',
43 featured: true
44 },
45 {
46 id: 'tools',
47 icon: ':lucide-wrench:',
48 title: 'Tools',
49 details: 'Software to make life easier',
50 link: '/tools'
51 },
52 {
53 id: 'art',
54 icon: ':lucide-brush:',
55 title: 'Art',
56 details: 'Everything Art',
57 link: '/art'
58 },
59 {
60 id: 'music',
61 icon: ':lucide-music:',
62 title: 'Music',
63 details: 'Wotaku Music Megathread!',
64 link: '/music'
65 },
66 {
67 id: 'games',
68 icon: ':lucide-gamepad-2:',
69 title: 'Games',
70 details: 'Wotaku Games Megathread!',
71 link: '/games'
72 },
73 {
74 id: 'nonen',
75 icon: ':lucide-map:',
76 title: 'Non-English',
77 details: 'Otaku resources for other regions',
78 link: '/nonen'
79 },
80 {
81 id: 'nsfw',
82 icon: ':lucide-ban:',
83 title: 'NSFW',
84 details: 'hen...',
85 link: '/nsfw',
86 featured: true
87 },
88 {
89 id: 'merch',
90 icon: ':lucide-package-2:',
91 title: 'Merch',
92 details: 'Everything merch related!',
93 link: '/merch'
94 },
95 {
96 id: 'vtuber',
97 icon: ':comet:',
98 title: 'VTuber',
99 details: 'Sui-chan wa~',
100 link: '/vtuber'
101 },
102 {
103 id: 'ext',
104 icon: ':lucide-puzzle:',
105 title: 'Extensions',
106 details: 'Extensions for everything',
107 link: '/ext',
108 featured: true
109 },
110 {
111 id: 'guides',
112 icon: ':lucide-book-key:',
113 title: 'Guides',
114 details: 'Various technical guides and tutorials',
115 link: '/guides',
116 featured: true
117 },
118 {
119 id: 'glossary',
120 icon: ':lucide-book-open:',
121 title: 'Glossary',
122 details: 'Learn the most frequently used otaku terms',
123 link: '/glossary',
124 featured: true
125 },
126 {
127 id: 'torrenting',
128 icon: ':lucide-magnet:',
129 title: 'Torrenting',
130 details: 'All the basic how-tos about torrenting',
131 link: '/torrenting',
132 featured: true
133 },
134 {
135 id: 'japan',
136 icon: ':uil-letter-japanese-a:',
137 title: 'Japan',
138 details: 'Everything Japan on one page!',
139 link: '/japan'
140 },
141 {
142 id: 'faq',
143 icon: ':lucide-message-circle-question-mark:',
144 title: 'FAQs',
145 details: 'Frequently asked questions about manga and anime',
146 link: '/faq'
147 },
148 {
149 id: 'comms',
150 icon: ':lucide-messages-square:',
151 title: 'Communities',
152 details: 'More great otaku communities!',
153 link: '/comms'
154 },
155 {
156 id: 'credits',
157 icon: ':lucide-heart-handshake:',
158 title: 'Credits',
159 details: 'All the contributors of Wotaku',
160 link: '/credits'
161 }
162]
163
10export const hostname: string = 'https://wotaku.wiki' 164export const hostname: string = 'https://wotaku.wiki'
11export const excludedFiles = ['t.md', 'sandbox.md'] 165export const excludedFiles = ['t.md', 'sandbox.md']
12 166
docs/.vitepress/theme/components/HomeFeatures.vue added +794
@@ -0,0 +1,794 @@
1<script setup lang="ts">
2import { computed, ref, onMounted, watch } from 'vue'
3import { renderEmojiShortcodes } from '../../configs/markdown/emoji'
4import type { HomeCard } from '../../configs/constants'
5
6const props = defineProps<{ cards: HomeCard[] }>()
7
8const STORAGE_KEY = 'wotaku-home-cards-v1'
9const PREFS_KEY = 'wotaku-home-prefs-v1'
10
11interface CardState {
12 order: string[]
13 hidden: string[]
14}
15
16function defaultState(): CardState {
17 return {
18 order: props.cards.map((c) => c.id),
19 hidden: props.cards.filter((c) => !c.featured).map((c) => c.id)
20 }
21}
22
23const state = ref<CardState>(defaultState())
24
25onMounted(() => {
26 const raw = localStorage.getItem(STORAGE_KEY)
27 if (!raw) return
28 try {
29 const parsed: CardState = JSON.parse(raw)
30 const allIds = new Set(props.cards.map((c) => c.id))
31 const validOrder = parsed.order.filter((id) => allIds.has(id))
32 const seenIds = new Set(validOrder)
33 const newIds = props.cards.map((c) => c.id).filter((id) => !seenIds.has(id))
34 state.value = {
35 order: [...validOrder, ...newIds],
36 hidden: (parsed.hidden ?? []).filter((id: string) => allIds.has(id))
37 }
38 } catch {}
39})
40
41function save() {
42 localStorage.setItem(STORAGE_KEY, JSON.stringify(state.value))
43}
44
45const cardMap = computed(() => new Map(props.cards.map((c) => [c.id, c])))
46
47const orderedCards = computed(() =>
48 state.value.order.map((id) => cardMap.value.get(id)!).filter(Boolean)
49)
50
51const hiddenSet = computed(() => new Set(state.value.hidden))
52
53const visibleCards = computed(() =>
54 orderedCards.value.filter((c) => !hiddenSet.value.has(c.id))
55)
56
57const grid = computed(() => {
58 const n = visibleCards.value.length
59 if (n === 0) return undefined
60 if (columnMode.value === 'max') return 'grid-max'
61 if (n === 2) return 'grid-2'
62 if (n === 3) return 'grid-3'
63 if (n % 3 === 0) return 'grid-6'
64 if (n > 3) return 'grid-4'
65 return undefined
66})
67
68function cardIcon(card: HomeCard) {
69 return renderEmojiShortcodes(card.icon)
70}
71
72/* ── Manager panel ── */
73const panelOpen = ref(false)
74const dropdownOpen = ref(false)
75const sortMode = ref<'default' | 'active'>('default')
76const columnMode = ref<'default' | 'max'>('default')
77
78onMounted(() => {
79 try {
80 const prefs = JSON.parse(localStorage.getItem(PREFS_KEY) ?? '{}')
81 if (prefs.sortMode === 'active') sortMode.value = 'active'
82 if (prefs.columnMode === 'max') columnMode.value = 'max'
83 } catch {}
84})
85
86watch([sortMode, columnMode], () => {
87 localStorage.setItem(PREFS_KEY, JSON.stringify({
88 sortMode: sortMode.value,
89 columnMode: columnMode.value
90 }))
91})
92
93const panelCards = computed(() => {
94 if (sortMode.value === 'active') {
95 const visible = orderedCards.value.filter((c) => !hiddenSet.value.has(c.id))
96 const hidden = orderedCards.value.filter((c) => hiddenSet.value.has(c.id))
97 return [...visible, ...hidden]
98 }
99 return orderedCards.value
100})
101
102function toggleCard(id: string) {
103 const h = state.value.hidden
104 const i = h.indexOf(id)
105 if (i === -1) h.push(id)
106 else h.splice(i, 1)
107 save()
108}
109
110function showAll() {
111 state.value.hidden = []
112 save()
113}
114
115function hideAll() {
116 state.value.hidden = props.cards.map((c) => c.id)
117 save()
118}
119
120function resetDefaults() {
121 state.value = defaultState()
122 save()
123}
124
125/* ── Drag-to-reorder (pointer events — works on mouse & touch) ── */
126const dragging = ref<string | null>(null)
127const dragTarget = ref<string | null>(null)
128const cardListEl = ref<HTMLElement | null>(null)
129const ghostPos = ref<{ x: number; y: number } | null>(null)
130
131function onHandlePointerDown(e: PointerEvent, id: string) {
132 e.preventDefault()
133 dragging.value = id
134 dragTarget.value = null
135 ghostPos.value = { x: e.clientX, y: e.clientY }
136 ;(e.currentTarget as HTMLElement).setPointerCapture(e.pointerId)
137}
138
139function onHandlePointerMove(e: PointerEvent) {
140 if (!dragging.value) return
141 ghostPos.value = { x: e.clientX, y: e.clientY }
142 const items = cardListEl.value?.querySelectorAll<HTMLElement>('[data-card-id]')
143 if (!items) return
144 for (const item of items) {
145 const rect = item.getBoundingClientRect()
146 if (
147 e.clientX >= rect.left && e.clientX <= rect.right &&
148 e.clientY >= rect.top && e.clientY <= rect.bottom
149 ) {
150 const id = item.dataset.cardId!
151 if (id !== dragging.value) dragTarget.value = id
152 break
153 }
154 }
155}
156
157function onHandlePointerUp() {
158 if (dragging.value && dragTarget.value) {
159 const order = panelCards.value.map((c) => c.id)
160 const from = order.indexOf(dragging.value)
161 const to = order.indexOf(dragTarget.value)
162 if (from !== -1 && to !== -1) {
163 order.splice(from, 1)
164 order.splice(to, 0, dragging.value)
165 state.value.order = order
166 save()
167 }
168 }
169 dragging.value = null
170 dragTarget.value = null
171 ghostPos.value = null
172}
173</script>
174
175<template>
176 <!-- ── Feature Grid ── -->
177 <div class="home-features">
178 <div class="container">
179 <div class="items">
180 <div
181 v-for="card in visibleCards"
182 :key="card.id"
183 class="item"
184 :class="grid"
185 >
186 <a class="card" :href="card.link">
187 <article class="box">
188 <div class="icon" v-html="cardIcon(card)" />
189 <h2 class="title">{{ card.title }}</h2>
190 <p class="details">{{ card.details }}</p>
191 </article>
192 </a>
193 </div>
194 </div>
195 <button class="gear-btn" aria-label="Customize cards" @click="panelOpen = true">
196 <span class="i-lucide-ellipsis-vertical" />
197 </button>
198 </div>
199 </div>
200
201 <!-- ── Manager Panel ── -->
202 <Teleport to="body">
203 <Transition name="fade">
204 <div v-if="panelOpen" class="backdrop" @click.self="panelOpen = false">
205 <Transition name="slide-up" appear>
206 <div v-if="panelOpen" class="panel" role="dialog" aria-modal="true" aria-label="Customize cards">
207 <div class="panel-head">
208 <span class="panel-title">Customize Cards</span>
209 <button class="close-btn" aria-label="Close" @click="panelOpen = false">
210 <span class="i-lucide-x" />
211 </button>
212 </div>
213
214 <ul ref="cardListEl" class="card-list" :class="grid">
215 <li
216 v-for="card in panelCards"
217 :key="card.id"
218 :data-card-id="card.id"
219 class="card-row"
220 :class="{
221 'is-dragging': dragging === card.id,
222 'is-over': dragTarget === card.id && dragging !== card.id,
223 'is-hidden': hiddenSet.has(card.id)
224 }"
225 >
226 <span
227 class="row-handle"
228 aria-hidden="true"
229 @pointerdown="onHandlePointerDown($event, card.id)"
230 @pointermove="onHandlePointerMove"
231 @pointerup="onHandlePointerUp"
232 >
233 <span class="i-lucide-grip-vertical" />
234 </span>
235 <span class="row-icon" v-html="cardIcon(card)" />
236 <span class="row-name">{{ card.title }}</span>
237 <button
238 class="row-toggle"
239 :class="{ active: !hiddenSet.has(card.id) }"
240 :aria-label="hiddenSet.has(card.id) ? 'Show' : 'Hide'"
241 @click="toggleCard(card.id)"
242 >
243 <span :class="hiddenSet.has(card.id) ? 'i-lucide-eye-off' : 'i-lucide-eye'" />
244 </button>
245 </li>
246 </ul>
247
248 <div class="panel-foot">
249 <div class="foot-group">
250 <button class="tool-btn" aria-label="Show all" @click="showAll">
251 <span class="i-lucide-eye" />
252 </button>
253 <button class="tool-btn" aria-label="Hide all" @click="hideAll">
254 <span class="i-lucide-eye-off" />
255 </button>
256 </div>
257 <div class="foot-group">
258 <div class="settings-wrap">
259 <div v-if="dropdownOpen" class="dropdown-overlay" @click="dropdownOpen = false" />
260 <div v-if="dropdownOpen" class="settings-dropdown">
261 <div class="dropdown-section">
262 <span class="dropdown-label">Sort</span>
263 <div class="dropdown-group">
264 <button class="tool-btn" :class="{ 'is-active': sortMode === 'default' }" @click="sortMode = 'default'">Default</button>
265 <button class="tool-btn" :class="{ 'is-active': sortMode === 'active' }" @click="sortMode = 'active'">Active</button>
266 </div>
267 </div>
268 <div class="dropdown-section">
269 <span class="dropdown-label">Columns</span>
270 <div class="dropdown-group">
271 <button class="tool-btn" :class="{ 'is-active': columnMode === 'default' }" @click="columnMode = 'default'">Default</button>
272 <button class="tool-btn" :class="{ 'is-active': columnMode === 'max' }" @click="columnMode = 'max'">Max</button>
273 </div>
274 </div>
275 </div>
276 <button
277 class="tool-btn"
278 :class="{ 'is-active': dropdownOpen }"
279 aria-label="Display settings"
280 @click.stop="dropdownOpen = !dropdownOpen"
281 >
282 <span class="i-lucide-settings-2" />
283 </button>
284 </div>
285 <button class="tool-btn" aria-label="Reset to default" @click="resetDefaults">
286 <span class="i-lucide-refresh-ccw" />
287 </button>
288 </div>
289 </div>
290 </div>
291 </Transition>
292 </div>
293 </Transition>
294
295 <Transition name="ghost-fade">
296 <div
297 v-if="dragging && ghostPos"
298 class="drag-ghost"
299 :style="{ left: ghostPos.x + 'px', top: ghostPos.y + 'px' }"
300 >
301 <span class="row-icon" v-html="cardIcon(cardMap.get(dragging)!)" />
302 <span class="drag-ghost-name">{{ cardMap.get(dragging)?.title }}</span>
303 </div>
304 </Transition>
305 </Teleport>
306</template>
307
308<style scoped>
309/* ── Grid ── */
310.home-features {
311 position: relative;
312 padding: 0 24px;
313}
314
315@media (min-width: 640px) {
316 .home-features { padding: 0 48px; }
317}
318
319@media (min-width: 960px) {
320 .home-features { padding: 0 64px; }
321}
322
323.container {
324 position: relative;
325 margin: 0 auto;
326 max-width: 1152px;
327}
328
329.items {
330 display: flex;
331 flex-wrap: wrap;
332 margin: -8px;
333}
334
335.item {
336 padding: 8px;
337 width: 100%;
338}
339
340@media (min-width: 640px) {
341 .item.grid-2,
342 .item.grid-4,
343 .item.grid-6 { width: calc(100% / 2); }
344}
345
346@media (min-width: 768px) {
347 .item.grid-2,
348 .item.grid-4 { width: calc(100% / 2); }
349 .item.grid-3,
350 .item.grid-6 { width: calc(100% / 3); }
351}
352
353@media (min-width: 960px) {
354 .item.grid-4 { width: calc(100% / 4); }
355}
356
357@media (min-width: 640px) {
358 .item.grid-max { width: calc(100% / 2); }
359}
360
361@media (min-width: 768px) {
362 .item.grid-max { width: calc(100% / 3); }
363}
364
365@media (min-width: 960px) {
366 .item.grid-max { width: calc(100% / 4); }
367}
368
369/* ── Card ── */
370.card {
371 display: block;
372 border: 2px solid #3d3d3d;
373 border-radius: 12px;
374 height: 100%;
375 background-color: var(--vp-c-bg-soft);
376 transition: border-color 0.25s, background-color 0.25s;
377 text-decoration: none;
378 color: inherit;
379}
380
381.card:hover {
382 border-color: var(--vp-c-brand-1);
383}
384
385.box {
386 display: flex;
387 flex-direction: column;
388 padding: 24px;
389 height: 100%;
390}
391
392.icon {
393 display: flex;
394 justify-content: center;
395 align-items: center;
396 margin-bottom: 20px;
397 border-radius: 6px;
398 background-color: var(--vp-c-default-soft);
399 width: 48px;
400 height: 48px;
401 font-size: 27px;
402 transition: background-color 0.25s;
403}
404
405.title {
406 line-height: 24px;
407 font-size: 16px;
408 font-weight: 600;
409}
410
411.details {
412 flex-grow: 1;
413 padding-top: 8px;
414 line-height: 24px;
415 font-size: 14px;
416 font-weight: 500;
417 color: var(--vp-c-text-2);
418}
419
420/* ── Gear Button ── */
421.gear-btn {
422 position: absolute;
423 top: 8px;
424 right: 0;
425 transform: translateX(100%);
426 background: none;
427 border: none;
428 padding: 4px;
429 color: var(--vp-c-text-3, var(--vp-c-text-2));
430 font-size: 18px;
431 cursor: pointer;
432 transition: color 0.2s;
433 display: flex;
434 align-items: center;
435}
436
437.gear-btn:hover {
438 color: var(--vp-c-brand-1);
439}
440
441/* ── Backdrop ── */
442.backdrop {
443 position: fixed;
444 inset: 0;
445 z-index: 100;
446 display: flex;
447 align-items: center;
448 justify-content: center;
449 background: rgba(0, 0, 0, 0.5);
450 backdrop-filter: blur(4px);
451}
452
453/* ── Panel ── */
454.panel {
455 width: min(520px, calc(100vw - 32px));
456 max-height: 85vh;
457 display: flex;
458 flex-direction: column;
459 border-radius: 16px;
460 border: 2px solid #3d3d3d;
461 background: var(--vp-c-bg);
462}
463
464@media (min-width: 768px) {
465 .panel { width: min(720px, calc(100vw - 32px)); }
466}
467
468@media (min-width: 960px) {
469 .panel { width: min(940px, calc(100vw - 32px)); }
470}
471
472.panel-head {
473 display: flex;
474 align-items: center;
475 justify-content: space-between;
476 padding: 10px 16px;
477 border-bottom: 1px solid var(--vp-c-divider);
478 flex-shrink: 0;
479}
480
481.panel-title {
482 font-size: 15px;
483 font-weight: 600;
484 color: var(--vp-c-text-1);
485}
486
487.close-btn {
488 position: relative;
489 display: flex;
490 align-items: center;
491 justify-content: center;
492 width: 28px;
493 height: 28px;
494 border-radius: 6px;
495 border: none;
496 background: transparent;
497 color: var(--vp-c-text-2);
498 font-size: 16px;
499 cursor: pointer;
500 transition: background 0.15s, color 0.15s;
501}
502
503.close-btn:hover {
504 background: var(--vp-c-bg-soft);
505 color: var(--vp-c-text-1);
506}
507
508.close-btn::after {
509 content: attr(aria-label);
510 position: absolute;
511 top: calc(100% + 6px);
512 right: 0;
513 background: var(--vp-c-bg-soft);
514 color: var(--vp-c-text-1);
515 border: 1px solid var(--vp-c-divider);
516 border-radius: 5px;
517 padding: 3px 8px;
518 font-size: 11px;
519 white-space: nowrap;
520 pointer-events: none;
521 opacity: 0;
522 transition: opacity 0.15s;
523 z-index: 10;
524}
525
526.close-btn:hover::after {
527 opacity: 1;
528}
529
530/* ── Card List ── */
531.card-list {
532 list-style: none;
533 margin: 0;
534 padding: 8px;
535 display: grid;
536 grid-template-columns: 1fr;
537 gap: 2px;
538 overflow-y: auto;
539 min-height: 0;
540}
541
542@media (min-width: 640px) {
543 .card-list { grid-template-columns: 1fr 1fr; }
544}
545
546@media (min-width: 768px) {
547 .card-list { grid-template-columns: 1fr 1fr 1fr; }
548 .card-list.grid-2,
549 .card-list.grid-4 { grid-template-columns: 1fr 1fr; }
550}
551
552@media (min-width: 960px) {
553 .card-list.grid-4,
554 .card-list.grid-max { grid-template-columns: 1fr 1fr 1fr 1fr; }
555}
556
557.card-row {
558 display: flex;
559 align-items: center;
560 gap: 8px;
561 padding: 7px 10px;
562 border-radius: 8px;
563 transition: background 0.15s, opacity 0.15s;
564 user-select: none;
565}
566
567.card-row:hover {
568 background: var(--vp-c-bg-soft);
569}
570
571.card-row.is-dragging {
572 opacity: 0.25;
573 cursor: grabbing;
574}
575
576.card-row.is-over {
577 background: var(--vp-c-brand-soft);
578 outline: 2px solid var(--vp-c-brand-1);
579 outline-offset: -2px;
580}
581
582.card-row.is-hidden {
583 opacity: 0.45;
584}
585
586.row-handle {
587 color: var(--vp-c-text-3, var(--vp-c-text-2));
588 font-size: 16px;
589 flex-shrink: 0;
590 display: flex;
591 align-items: center;
592 cursor: grab;
593 touch-action: none;
594}
595
596.row-handle:active {
597 cursor: grabbing;
598}
599
600.row-icon {
601 font-size: 18px;
602 flex-shrink: 0;
603 display: flex;
604 align-items: center;
605 width: 20px;
606}
607
608.row-name {
609 flex: 1;
610 font-size: 14px;
611 font-weight: 500;
612 color: var(--vp-c-text-1);
613}
614
615.row-toggle {
616 display: flex;
617 align-items: center;
618 justify-content: center;
619 width: 30px;
620 height: 30px;
621 border-radius: 6px;
622 border: none;
623 background: transparent;
624 color: var(--vp-c-text-2);
625 font-size: 16px;
626 cursor: pointer;
627 flex-shrink: 0;
628 transition: background 0.15s, color 0.15s;
629}
630
631.row-toggle:hover {
632 background: var(--vp-c-bg-alt);
633 color: var(--vp-c-text-1);
634}
635
636.row-toggle.active {
637 color: var(--vp-c-brand-1);
638}
639
640/* ── Panel Footer ── */
641.panel-foot {
642 display: flex;
643 align-items: center;
644 justify-content: space-between;
645 padding: 5px 8px;
646 border-top: 1px solid var(--vp-c-divider);
647 flex-shrink: 0;
648 gap: 8px;
649}
650
651.foot-group {
652 display: flex;
653 align-items: center;
654 gap: 4px;
655}
656
657.tool-btn {
658 position: relative;
659 display: flex;
660 align-items: center;
661 gap: 5px;
662 font-size: 14px;
663 font-weight: 500;
664 color: var(--vp-c-text-2);
665 background: transparent;
666 border: none;
667 border-radius: 5px;
668 padding: 5px 6px;
669 cursor: pointer;
670 transition: color 0.15s, background 0.15s;
671}
672
673.tool-btn[aria-label]::after {
674 content: attr(aria-label);
675 position: absolute;
676 bottom: calc(100% + 6px);
677 left: 50%;
678 transform: translateX(-50%);
679 background: var(--vp-c-bg-soft);
680 color: var(--vp-c-text-1);
681 border: 1px solid var(--vp-c-divider);
682 border-radius: 5px;
683 padding: 3px 8px;
684 font-size: 11px;
685 white-space: nowrap;
686 pointer-events: none;
687 opacity: 0;
688 transition: opacity 0.15s;
689 z-index: 10;
690}
691
692.tool-btn[aria-label]:hover::after {
693 opacity: 1;
694}
695
696.tool-btn:hover {
697 color: var(--vp-c-text-1);
698 background: var(--vp-c-bg-soft);
699}
700
701.tool-btn.is-active {
702 color: var(--vp-c-brand-1);
703 background: var(--vp-c-brand-soft);
704}
705
706/* ── Settings Dropdown ── */
707.settings-wrap {
708 position: relative;
709}
710
711.dropdown-overlay {
712 position: fixed;
713 inset: 0;
714 z-index: 1;
715}
716
717.settings-dropdown {
718 position: absolute;
719 bottom: calc(100% + 8px);
720 right: 0;
721 z-index: 2;
722 min-width: 196px;
723 background: var(--vp-c-bg);
724 border: 1px solid var(--vp-c-divider);
725 border-radius: 10px;
726 padding: 10px;
727 box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
728}
729
730.dropdown-section + .dropdown-section {
731 border-top: 1px solid var(--vp-c-divider);
732 margin-top: 8px;
733 padding-top: 8px;
734}
735
736.dropdown-label {
737 display: block;
738 font-size: 11px;
739 font-weight: 600;
740 text-transform: uppercase;
741 letter-spacing: 0.06em;
742 color: var(--vp-c-text-3, var(--vp-c-text-2));
743 margin-bottom: 6px;
744}
745
746.dropdown-group {
747 display: flex;
748 gap: 4px;
749}
750
751/* ── Drag Ghost ── */
752.drag-ghost {
753 position: fixed;
754 pointer-events: none;
755 z-index: 9999;
756 display: flex;
757 align-items: center;
758 gap: 8px;
759 padding: 6px 12px 6px 10px;
760 background: var(--vp-c-bg);
761 border: 1px solid var(--vp-c-brand-1);
762 border-radius: 8px;
763 box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
764 opacity: 0.88;
765 font-size: 14px;
766 font-weight: 500;
767 color: var(--vp-c-text-1);
768 white-space: nowrap;
769 user-select: none;
770 transform: translate(12px, -50%);
771}
772
773.drag-ghost-name {
774 font-size: 14px;
775 font-weight: 500;
776 color: var(--vp-c-text-1);
777}
778
779.ghost-fade-enter-active,
780.ghost-fade-leave-active { transition: opacity 0.1s ease; }
781.ghost-fade-enter-from,
782.ghost-fade-leave-to { opacity: 0; }
783
784/* ── Transitions ── */
785.fade-enter-active,
786.fade-leave-active { transition: opacity 0.2s ease; }
787.fade-enter-from,
788.fade-leave-to { opacity: 0; }
789
790.slide-up-enter-active { transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease; }
791.slide-up-leave-active { transition: transform 0.2s ease, opacity 0.15s ease; }
792.slide-up-enter-from { transform: translateY(20px); opacity: 0; }
793.slide-up-leave-to { transform: translateY(10px); opacity: 0; }
794</style>
docs/index.md +3 −39
@@ -5,48 +5,12 @@ sidebar: false
5aside: false 5aside: false
6 6
7customDescription: A wiki that covers everything weeb-related! 7customDescription: A wiki that covers everything weeb-related!
8
9features:
10 - title: Websites
11 details: Websites for anime, manga, novels & tokusatsu
12 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M21.54 15H17a2 2 0 0 0-2 2v4.54M7 3.34V5a3 3 0 0 0 3 3v0a2 2 0 0 1 2 2v0c0 1.1.9 2 2 2v0a2 2 0 0 0 2-2v0c0-1.1.9-2 2-2h3.17M11 21.95V18a2 2 0 0 0-2-2v0a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05"/><circle cx="12" cy="12" r="10"/></g></svg>
13 link: /websites.md
14 - title: Software
15 details: Software for every Operating System
16 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7l8.7 5l8.7-5M12 22V12"/></g></svg>
17 link: /software.md
18 - title: Misc-sites
19 details: Various sites for database, info, tracking news & tools
20 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 14l1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/></svg>
21 link: /misc.md
22 - title: NSFW
23 details: hen...
24 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m4.9 4.9l14.2 14.2"/></g></svg>
25 link: /nsfw.md
26 - title: Extension Repos
27 details: Extensions for everything
28 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.39 4.39a1 1 0 0 0 1.68-.474a2.5 2.5 0 1 1 3.014 3.015a1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474a2.5 2.5 0 1 0-3.014 3.015a1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474a2.5 2.5 0 1 1-3.014-3.015a1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474a2.5 2.5 0 1 0 3.014-3.015a1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"/></svg>
29 link: /ext
30 - title: Guides
31 details: Various technical guides and tutorials
32 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m19 3l1 1m0-2l-4.5 4.5M20 7.898V21a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2h7.844"/><circle cx="14" cy="8" r="2"/></g></svg>
33 link: /guides
34 - title: Glossary
35 details: Learn the most frequently used otaku terms
36 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 7v14m-9-3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4a4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3a3 3 0 0 0-3-3z"/></svg>
37 link: /glossary
38 - title: Torrenting
39 details: All the basic how-tos about torrenting
40 icon: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Lucide by Lucide Contributors - https://github.com/lucide-icons/lucide/blob/main/LICENSE --><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m12 15l4 4M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282zM5 8l4 4"/></svg>
41 link: /torrenting
42--- 8---
43 9
44<script setup> 10<script setup>
45import { useData } from 'vitepress' 11import HomeFeatures from './.vitepress/theme/components/HomeFeatures.vue'
46import { VPFeatures } from 'vitepress/theme'
47import DevOnly from './.vitepress/theme/components/DevOnly.vue' 12import DevOnly from './.vitepress/theme/components/DevOnly.vue'
48 13import { homeCards } from './.vitepress/configs/constants'
49const { frontmatter } = useData()
50</script> 14</script>
51 15
52<main class="wotaku-home"> 16<main class="wotaku-home">
@@ -54,7 +18,7 @@ const { frontmatter } = useData()
54 <img class="wotaku-hero-logo" src="/asset/hero.svg" alt="Wotaku" /> 18 <img class="wotaku-hero-logo" src="/asset/hero.svg" alt="Wotaku" />
55 </section> 19 </section>
56 20
57 <VPFeatures :features="frontmatter.features" /> 21 <HomeFeatures :cards="homeCards" />
58</main> 22</main>
59 23
60<DevOnly> 24<DevOnly>
unocss.config.ts +37 −1
@@ -17,6 +17,41 @@ import {
17 presetWind4, 17 presetWind4,
18 transformerDirectives 18 transformerDirectives
19} from 'unocss' 19} from 'unocss'
20import { aliases } from './docs/.vitepress/configs/markdown/emoji'
21
22const iconPrefixes = [
23 'octicon-',
24 'logos-',
25 'ic-',
26 'mingcute-',
27 'mdi-',
28 'material-symbols-',
29 'simple-icons-',
30 'lucide-',
31 'uil-',
32 'akar-icons-',
33 'map-',
34 'bi-',
35 'streamline-logos-',
36 'streamline-ultimate-',
37 'streamline-sharp-',
38 'iconoir-'
39]
40
41const emojiShortcodeExtractor = {
42 name: 'emoji-shortcode',
43 extract({ code }: { code: string }) {
44 const tokens = new Set<string>()
45 for (const [, markup] of code.matchAll(/:([A-Za-z0-9_+-]+):/g)) {
46 if (aliases[markup]) {
47 tokens.add(`i-${aliases[markup]}`)
48 } else if (iconPrefixes.some((p) => markup.startsWith(p))) {
49 tokens.add(`i-${markup}`)
50 }
51 }
52 return tokens
53 }
54}
20 55
21// Custom icons collection 56// Custom icons collection
22const customIcons = { 57const customIcons = {
@@ -44,8 +79,9 @@ const safelist = [
44 79
45export default defineConfig({ 80export default defineConfig({
46 content: { 81 content: {
47 filesystem: ['.vitepress/configs/constants.ts'] 82 filesystem: ['.vitepress/configs/constants.ts', 'docs/index.md']
48 }, 83 },
84 extractors: [emojiShortcodeExtractor],
49 safelist, 85 safelist,
50 theme: { 86 theme: {
51 easing: { 87 easing: {