Commit 7d8eb83685
Unsigned
Layout: unified · split
docs/.vitepress/theme/components/HomeFeatures.vue +26 −9
| @@ -53,15 +53,24 @@ const grid = computed(() => { | |||
| 53 | return undefined | 53 | return undefined |
| 54 | }) | 54 | }) |
| 55 | 55 | ||
| 56 | const KNOWN_PREFIXES = /^(lucide|mdi|ic|mingcute|material-symbols|simple-icons|uil|octicon|logos|akar-icons|map|bi|streamline-logos|streamline-ultimate|streamline-sharp|iconoir)-/ | ||
| 57 | |||
| 56 | function cardIcon(card: HomeCard) { | 58 | function cardIcon(card: HomeCard) { |
| 57 | return card.icon.replace(/:([A-Za-z0-9_+-]+):/g, (_, markup) => | 59 | return card.icon.replace(/:([A-Za-z0-9_+-]+):/g, (_, markup) => { |
| 58 | `<span class="i-${markup}"></span>`) | 60 | const cls = KNOWN_PREFIXES.test(markup) ? markup : `twemoji-${markup}` |
| 61 | return `<span class="i-${cls}"></span>` | ||
| 62 | }) | ||
| 59 | } | 63 | } |
| 60 | 64 | ||
| 61 | /* ── Manager panel ── */ | 65 | /* ── Manager panel ── */ |
| 62 | const panelOpen = ref(false) | 66 | const panelOpen = ref(false) |
| 63 | const dropdownOpen = ref(false) | 67 | const dropdownOpen = ref(false) |
| 64 | 68 | ||
| 69 | watch(panelOpen, (open) => { | ||
| 70 | if (typeof document !== 'undefined') | ||
| 71 | document.body.style.overflow = open ? 'hidden' : '' | ||
| 72 | }) | ||
| 73 | |||
| 65 | function loadPrefs() { | 74 | function loadPrefs() { |
| 66 | if (typeof window === 'undefined') return { columnMode: 'default' as const, viewMode: 'default' as const } | 75 | if (typeof window === 'undefined') return { columnMode: 'default' as const, viewMode: 'default' as const } |
| 67 | try { | 76 | try { |
| @@ -191,6 +200,11 @@ function onHandlePointerUp() { | |||
| 191 | <!-- ── Feature Grid ── --> | 200 | <!-- ── Feature Grid ── --> |
| 192 | <div class="home-features"> | 201 | <div class="home-features"> |
| 193 | <div class="container"> | 202 | <div class="container"> |
| 203 | <div class="card-toolbar"> | ||
| 204 | <button class="gear-btn" aria-label="Customize cards" @click="panelOpen = true"> | ||
| 205 | <span class="i-lucide-ellipsis" /> | ||
| 206 | </button> | ||
| 207 | </div> | ||
| 194 | <div class="items" :class="{ 'view-mini': viewMode === 'mini' }"> | 208 | <div class="items" :class="{ 'view-mini': viewMode === 'mini' }"> |
| 195 | <div | 209 | <div |
| 196 | v-for="card in visibleCards" | 210 | v-for="card in visibleCards" |
| @@ -207,9 +221,6 @@ function onHandlePointerUp() { | |||
| 207 | </a> | 221 | </a> |
| 208 | </div> | 222 | </div> |
| 209 | </div> | 223 | </div> |
| 210 | <button class="gear-btn" aria-label="Customize cards" @click="panelOpen = true"> | ||
| 211 | <span class="i-lucide-ellipsis-vertical" /> | ||
| 212 | </button> | ||
| 213 | </div> | 224 | </div> |
| 214 | </div> | 225 | </div> |
| 215 | 226 | ||
| @@ -503,11 +514,13 @@ function onHandlePointerUp() { | |||
| 503 | } | 514 | } |
| 504 | 515 | ||
| 505 | /* ── Gear Button ── */ | 516 | /* ── Gear Button ── */ |
| 517 | .card-toolbar { | ||
| 518 | display: flex; | ||
| 519 | justify-content: flex-end; | ||
| 520 | margin-bottom: 4px; | ||
| 521 | } | ||
| 522 | |||
| 506 | .gear-btn { | 523 | .gear-btn { |
| 507 | position: absolute; | ||
| 508 | top: 8px; | ||
| 509 | right: 0; | ||
| 510 | transform: translateX(100%); | ||
| 511 | background: none; | 524 | background: none; |
| 512 | border: none; | 525 | border: none; |
| 513 | padding: 4px; | 526 | padding: 4px; |
| @@ -533,6 +546,8 @@ function onHandlePointerUp() { | |||
| 533 | justify-content: center; | 546 | justify-content: center; |
| 534 | background: rgba(0, 0, 0, 0.5); | 547 | background: rgba(0, 0, 0, 0.5); |
| 535 | backdrop-filter: blur(4px); | 548 | backdrop-filter: blur(4px); |
| 549 | overscroll-behavior: none; | ||
| 550 | touch-action: none; | ||
| 536 | } | 551 | } |
| 537 | 552 | ||
| 538 | /* ── Panel ── */ | 553 | /* ── Panel ── */ |
| @@ -620,6 +635,8 @@ function onHandlePointerUp() { | |||
| 620 | display: flex; | 635 | display: flex; |
| 621 | flex-direction: column; | 636 | flex-direction: column; |
| 622 | gap: 2px; | 637 | gap: 2px; |
| 638 | touch-action: pan-y; | ||
| 639 | overscroll-behavior: contain; | ||
| 623 | } | 640 | } |
| 624 | 641 | ||
| 625 | .section-label { | 642 | .section-label { |