From dabbf0ec703f2ba561563157c03ad24935ddef50 Mon Sep 17 00:00:00 2001 From: xiaomai Date: Thu, 30 Apr 2026 14:20:57 +0800 Subject: [PATCH] feat(ui): replace text loading states with skeleton loaders Add skeleton CSS classes to main.css for consistent loading UI Apply skeleton loading states to Admin, Habitat, Item, Pokemon, Recipe, and Auth views Improve perceived performance and accessibility during data fetching --- frontend/src/styles/main.css | 44 ++++++++++++++ frontend/src/views/AdminView.vue | 79 ++++++++++++++++++++------ frontend/src/views/HabitatDetail.vue | 48 +++++++++++++++- frontend/src/views/HabitatList.vue | 19 ++++++- frontend/src/views/ItemDetail.vue | 55 +++++++++++++++++- frontend/src/views/PokemonDetail.vue | 59 ++++++++++++++++++- frontend/src/views/PokemonList.vue | 31 +++++++++- frontend/src/views/RecipeDetail.vue | 29 +++++++++- frontend/src/views/VerifyEmailView.vue | 9 ++- 9 files changed, 341 insertions(+), 32 deletions(-) diff --git a/frontend/src/styles/main.css b/frontend/src/styles/main.css index adc0517..45c1421 100644 --- a/frontend/src/styles/main.css +++ b/frontend/src/styles/main.css @@ -728,6 +728,50 @@ button:disabled, height: 28px; } +.page-header--skeleton { + pointer-events: none; +} + +.skeleton-detail-section { + pointer-events: none; +} + +.skeleton-detail-section .detail-section__body { + gap: 14px; +} + +.skeleton-row-list li { + min-height: 43px; +} + +.skeleton-appearance-row { + display: grid; + grid-template-columns: max-content minmax(0, 1fr); + gap: 12px; +} + +.skeleton-summary { + display: grid; + gap: 6px; + width: 100%; +} + +.skeleton-summary div { + display: grid; + grid-template-columns: 72px minmax(0, 1fr); + gap: 8px; +} + +.skeleton-form-stack { + display: grid; + gap: 14px; +} + +.skeleton-auth-state { + display: grid; + gap: 12px; +} + @keyframes shimmer { to { background-position: -200% 0; diff --git a/frontend/src/views/AdminView.vue b/frontend/src/views/AdminView.vue index 6f478ac..a806b27 100644 --- a/frontend/src/views/AdminView.vue +++ b/frontend/src/views/AdminView.vue @@ -1,6 +1,7 @@