littleshop/LittleShop/wwwroot/css/mobile-admin.css
SysAdmin 7f4a502fe1 Feature: Add elegant PWA loading screen
Implemented a professional loading screen for the PWA to eliminate the
"hang and wait" experience during app initialization.

Changes:
- Added full-screen gradient loading overlay with TeleShop branding
- Implemented animated triple-ring spinner with smooth animations
- Added automatic removal after PWA initialization (500ms fade-out)
- Included 5-second fallback timeout to prevent infinite loading
- Updated service worker cache version to v2
- Enhanced JWT validation to detect test/temporary keys
- Updated appsettings.json with secure JWT key

Design Features:
- Purple/blue gradient background matching brand colors
- Pulsing logo animation for visual interest
- Staggered spinner rings with cubic-bezier easing
- Fade-in-out loading text animation
- Mobile-responsive design (scales appropriately on all devices)

Technical Implementation:
- Loading screen visible by default (no FOUC)
- Removed via JavaScript when PWA manager initialization completes
- Graceful fade-out animation before DOM removal
- Console logging for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 16:39:47 +01:00

603 lines
11 KiB
CSS

/* Mobile-First Admin Styles */
:root {
--mobile-nav-height: 60px;
--touch-target-size: 44px;
--primary-color: #2563eb;
--success-color: #10b981;
--warning-color: #f59e0b;
--danger-color: #ef4444;
}
/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: var(--mobile-nav-height);
background: white;
border-top: 1px solid #e5e7eb;
display: none;
z-index: 1000;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}
.mobile-bottom-nav-items {
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
padding: 0;
margin: 0;
list-style: none;
}
.mobile-nav-item {
flex: 1;
height: 100%;
}
.mobile-nav-link {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: #6b7280;
text-decoration: none;
font-size: 10px;
transition: all 0.2s;
}
.mobile-nav-link i {
font-size: 20px;
margin-bottom: 2px;
}
.mobile-nav-link.active {
color: var(--primary-color);
}
.mobile-nav-link:active {
background: rgba(37, 99, 235, 0.1);
}
.mobile-nav-badge {
position: absolute;
top: 5px;
right: calc(50% - 15px);
background: var(--danger-color);
color: white;
border-radius: 10px;
padding: 2px 6px;
font-size: 9px;
font-weight: bold;
min-width: 16px;
text-align: center;
}
/* Settings Menu Drawer */
.settings-drawer {
position: fixed;
top: 0;
right: -300px;
width: 300px;
height: 100%;
background: white;
box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
transition: right 0.3s ease;
z-index: 1001;
overflow-y: auto;
}
.settings-drawer.open {
right: 0;
}
.settings-drawer-header {
padding: 20px;
border-bottom: 1px solid #e5e7eb;
display: flex;
justify-content: space-between;
align-items: center;
}
.settings-drawer-close {
background: none;
border: none;
font-size: 24px;
color: #6b7280;
padding: 0;
width: var(--touch-target-size);
height: var(--touch-target-size);
}
.settings-menu-list {
list-style: none;
padding: 0;
margin: 0;
}
.settings-menu-item {
border-bottom: 1px solid #f3f4f6;
}
.settings-menu-link {
display: flex;
align-items: center;
padding: 15px 20px;
color: #374151;
text-decoration: none;
min-height: var(--touch-target-size);
}
.settings-menu-link i {
margin-right: 15px;
width: 20px;
text-align: center;
}
.settings-menu-link:active {
background: #f3f4f6;
}
/* Drawer Overlay */
.drawer-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: none;
z-index: 1000;
}
.drawer-overlay.show {
display: block;
}
/* Touch-Friendly Forms */
@media (max-width: 768px) {
.form-control, .form-select, .btn {
min-height: var(--touch-target-size);
font-size: 16px; /* Prevents zoom on iOS */
}
.btn {
padding: 12px 20px;
}
/* Larger checkboxes and radios */
.form-check-input {
width: 24px;
height: 24px;
margin-top: 0;
}
.form-check-label {
padding-left: 10px;
line-height: 24px;
}
}
/* Mobile Cards for Orders/Products */
.mobile-card {
background: white;
border-radius: 8px;
padding: 15px;
margin-bottom: 15px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
position: relative;
}
.mobile-card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.mobile-card-title {
font-weight: 600;
font-size: 16px;
}
.mobile-card-status {
padding: 4px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 500;
}
.status-pending {
background: #fef3c7;
color: #92400e;
}
.status-accepted {
background: #d1fae5;
color: #065f46;
}
.status-packing {
background: #dbeafe;
color: #1e40af;
}
.status-dispatched {
background: #e9d5ff;
color: #6b21a8;
}
/* Swipe Actions */
.swipeable {
position: relative;
overflow: hidden;
}
.swipe-actions {
position: absolute;
top: 0;
right: -200px;
width: 200px;
height: 100%;
display: flex;
transition: right 0.3s ease;
}
.swipeable.swiped .swipe-actions {
right: 0;
}
.swipe-action {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: 500;
border: none;
}
.swipe-action-accept {
background: var(--success-color);
}
.swipe-action-reject {
background: var(--danger-color);
}
/* Responsive adjustments */
@media (max-width: 768px) {
/* Hide desktop nav on mobile */
.navbar-collapse {
display: none !important;
}
/* Show mobile bottom nav */
.mobile-bottom-nav {
display: block;
}
/* Adjust main content for bottom nav */
main {
padding-bottom: calc(var(--mobile-nav-height) + 20px) !important;
}
/* Full-width buttons on mobile */
.btn-group-mobile {
display: flex;
gap: 10px;
}
.btn-group-mobile .btn {
flex: 1;
}
/* Responsive tables to cards */
.table-responsive-mobile {
display: none;
}
.cards-responsive-mobile {
display: block;
}
}
@media (min-width: 769px) {
/* Hide mobile-only elements on desktop */
.mobile-bottom-nav,
.settings-drawer,
.drawer-overlay,
.cards-responsive-mobile {
display: none !important;
}
.table-responsive-mobile {
display: block;
}
}
/* Pull to Refresh */
.pull-to-refresh {
position: absolute;
top: -60px;
left: 0;
right: 0;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
transition: top 0.3s ease;
}
.pull-to-refresh.active {
top: 0;
}
.pull-to-refresh-spinner {
width: 30px;
height: 30px;
border: 3px solid #e5e7eb;
border-top-color: var(--primary-color);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Floating Action Button */
.fab {
position: fixed;
bottom: calc(var(--mobile-nav-height) + 20px);
right: 20px;
width: 56px;
height: 56px;
border-radius: 50%;
background: var(--primary-color);
color: white;
border: none;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
transition: transform 0.2s;
z-index: 999;
}
.fab:active {
transform: scale(0.95);
}
/* Tab Navigation - Mobile Optimized */
.nav-tabs-mobile {
display: flex;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
border-bottom: 1px solid #e5e7eb;
margin-bottom: 20px;
}
.nav-tabs-mobile::-webkit-scrollbar {
display: none;
}
.nav-tabs-mobile .nav-link {
white-space: nowrap;
padding: 12px 20px;
color: #6b7280;
border: none;
border-bottom: 2px solid transparent;
min-width: fit-content;
}
.nav-tabs-mobile .nav-link.active {
color: var(--primary-color);
border-bottom-color: var(--primary-color);
background: none;
}
/* Improved Touch Feedback */
button, a, .clickable {
-webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
}
/* Loading States */
.skeleton {
background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
background-size: 200% 100%;
animation: loading 1.5s ease-in-out infinite;
}
@keyframes loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* Product Variants Tab */
.variants-container {
padding: 20px 0;
}
.variant-card {
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 15px;
margin-bottom: 15px;
}
.variant-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.variant-quantity {
font-size: 24px;
font-weight: bold;
color: var(--primary-color);
}
.variant-price {
font-size: 20px;
font-weight: 600;
}
.variant-unit-price {
color: #6b7280;
font-size: 14px;
margin-top: 5px;
}
/* ========================================
PWA Loading Screen
======================================== */
.pwa-loading-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
opacity: 1;
transition: opacity 0.5s ease-out;
}
.pwa-loading-screen.fade-out {
opacity: 0;
pointer-events: none;
}
.pwa-loading-content {
text-align: center;
color: white;
animation: slideUp 0.6s ease-out;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.pwa-loading-logo {
font-size: 80px;
margin-bottom: 20px;
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.1);
opacity: 0.8;
}
}
.pwa-loading-title {
font-size: 36px;
font-weight: 700;
margin-bottom: 30px;
letter-spacing: 2px;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.pwa-loading-spinner {
position: relative;
width: 80px;
height: 80px;
margin: 0 auto 30px;
}
.spinner-ring {
position: absolute;
width: 100%;
height: 100%;
border: 3px solid transparent;
border-top-color: white;
border-radius: 50%;
animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}
.spinner-ring:nth-child(2) {
width: 90%;
height: 90%;
top: 5%;
left: 5%;
border-top-color: rgba(255, 255, 255, 0.7);
animation-delay: 0.2s;
}
.spinner-ring:nth-child(3) {
width: 80%;
height: 80%;
top: 10%;
left: 10%;
border-top-color: rgba(255, 255, 255, 0.5);
animation-delay: 0.4s;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.pwa-loading-text {
font-size: 16px;
font-weight: 400;
opacity: 0.9;
animation: fadeInOut 2s ease-in-out infinite;
}
@keyframes fadeInOut {
0%, 100% {
opacity: 0.6;
}
50% {
opacity: 1;
}
}
/* Mobile optimizations */
@media (max-width: 768px) {
.pwa-loading-logo {
font-size: 60px;
}
.pwa-loading-title {
font-size: 28px;
}
.pwa-loading-spinner {
width: 60px;
height: 60px;
}
.pwa-loading-text {
font-size: 14px;
}
}