Add route-based code splitting and loading skeletons
- Lazy-load Dashboard, Comparison, Slides via React.lazy + Suspense - Main bundle reduced from 606KB to 256KB - Replace full-screen spinner with skeleton cards during load - Skeleton used for both initial data fetch and route transitions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
71
src/App.css
71
src/App.css
@@ -1987,3 +1987,74 @@ html[dir="rtl"] .chart-export-btn.visible {
|
||||
direction: ltr !important;
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Loading Skeleton
|
||||
======================================== */
|
||||
|
||||
@keyframes skeleton-pulse {
|
||||
0%, 100% { opacity: 0.4; }
|
||||
50% { opacity: 1; }
|
||||
}
|
||||
|
||||
.skeleton-container {
|
||||
padding: 80px 24px 24px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.skeleton-stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 16px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.skeleton-card {
|
||||
background: #f1f5f9;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
animation: skeleton-pulse 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.skeleton-card-wide {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.skeleton-line {
|
||||
background: #e2e8f0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.skeleton-line-short {
|
||||
width: 40%;
|
||||
height: 14px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.skeleton-line-tall {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.skeleton-card-wide .skeleton-line-tall {
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.skeleton-charts {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.skeleton-stats {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
.skeleton-charts {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.skeleton-card-wide {
|
||||
grid-column: span 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user