Commit 69d9be3e3c

69d9be3e3cd89036cb8869d0db42f0d27373b316

parent: 7d8eb83685

Unsigned

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

Update HomeFeatures.vue

Layout: unified · split

docs/.vitepress/theme/components/HomeFeatures.vue +18 −3
@@ -1,5 +1,5 @@
11<script setup lang="ts">
2import { computed, ref, watch } from 'vue'
2import { computed, onMounted, ref, watch } from 'vue'
33import type { HomeCard } from '../../configs/constants'
44
55const props = defineProps<{ cards: HomeCard[] }>()
@@ -28,7 +28,13 @@ function loadState(): CardState {
2828 } catch { return defaultState() }
2929}
3030
31const state = ref<CardState>(loadState())
31const mounted = ref(false)
32const state = ref<CardState>(defaultState())
33
34onMounted(() => {
35 state.value = loadState()
36 mounted.value = true
37})
3238
3339function save() {
3440 localStorage.setItem(STORAGE_KEY, JSON.stringify(state.value))
@@ -198,7 +204,7 @@ function onHandlePointerUp() {
198204
199205<template>
200206 <!-- ── Feature Grid ── -->
201 <div class="home-features">
207 <div class="home-features" :class="{ 'is-mounted': mounted }">
202208 <div class="container">
203209 <div class="card-toolbar">
204210 <button class="gear-btn" aria-label="Customize cards" @click="panelOpen = true">
@@ -379,6 +385,15 @@ function onHandlePointerUp() {
379385 padding: 0 24px;
380386}
381387
388.home-features .container {
389 opacity: 0;
390 transition: opacity 0.15s ease;
391}
392
393.home-features.is-mounted .container {
394 opacity: 1;
395}
396
382397@media (min-width: 640px) {
383398 .home-features { padding: 0 48px; }
384399}