Commit 7d8eb83685

7d8eb836857e276d877d4ba3b3dac03f4b6d436f

parent: 29f661c9a8

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-06-24 08:06 UTC

Update HomeFeatures.vue

Layout: unified · split

docs/.vitepress/theme/components/HomeFeatures.vue +26 −9
@@ -53,15 +53,24 @@ const grid = computed(() => {
5353 return undefined
5454})
5555
56const 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
5658function 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 })
5963}
6064
6165/* ── Manager panel ── */
6266const panelOpen = ref(false)
6367const dropdownOpen = ref(false)
6468
69watch(panelOpen, (open) => {
70 if (typeof document !== 'undefined')
71 document.body.style.overflow = open ? 'hidden' : ''
72})
73
6574function loadPrefs() {
6675 if (typeof window === 'undefined') return { columnMode: 'default' as const, viewMode: 'default' as const }
6776 try {
@@ -191,6 +200,11 @@ function onHandlePointerUp() {
191200 <!-- ── Feature Grid ── -->
192201 <div class="home-features">
193202 <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>
194208 <div class="items" :class="{ 'view-mini': viewMode === 'mini' }">
195209 <div
196210 v-for="card in visibleCards"
@@ -207,9 +221,6 @@ function onHandlePointerUp() {
207221 </a>
208222 </div>
209223 </div>
210 <button class="gear-btn" aria-label="Customize cards" @click="panelOpen = true">
211 <span class="i-lucide-ellipsis-vertical" />
212 </button>
213224 </div>
214225 </div>
215226
@@ -503,11 +514,13 @@ function onHandlePointerUp() {
503514}
504515
505516/* ── Gear Button ── */
517.card-toolbar {
518 display: flex;
519 justify-content: flex-end;
520 margin-bottom: 4px;
521}
522
506523.gear-btn {
507 position: absolute;
508 top: 8px;
509 right: 0;
510 transform: translateX(100%);
511524 background: none;
512525 border: none;
513526 padding: 4px;
@@ -533,6 +546,8 @@ function onHandlePointerUp() {
533546 justify-content: center;
534547 background: rgba(0, 0, 0, 0.5);
535548 backdrop-filter: blur(4px);
549 overscroll-behavior: none;
550 touch-action: none;
536551}
537552
538553/* ── Panel ── */
@@ -620,6 +635,8 @@ function onHandlePointerUp() {
620635 display: flex;
621636 flex-direction: column;
622637 gap: 2px;
638 touch-action: pan-y;
639 overscroll-behavior: contain;
623640}
624641
625642.section-label {