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