← back to Jill Website
public/css/adaptive-loading.css
280 lines
/**
* Adaptive Loading Styles
* Styles for loading indicators and connection notifications
*/
/* Loading Indicator */
.adaptive-loading-indicator {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
z-index: 10;
background: rgba(255, 255, 255, 0.95);
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.adaptive-loading-indicator .spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid #2c5f8d;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.adaptive-loading-indicator span {
font-size: 14px;
color: #2c3e50;
font-weight: 500;
}
/* Loading State for Images */
.adaptive-loading {
opacity: 0.5;
transition: opacity 0.3s ease;
}
.adaptive-loaded {
opacity: 1;
animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.adaptive-error {
opacity: 0.3;
filter: grayscale(100%);
}
/* Video Placeholder */
.video-placeholder {
width: 100%;
height: 100%;
min-height: 300px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
position: relative;
}
.video-placeholder-content {
text-align: center;
color: white;
padding: 30px;
}
.video-placeholder-content i {
font-size: 48px;
margin-bottom: 20px;
opacity: 0.9;
}
.video-placeholder-content p {
font-size: 16px;
margin-bottom: 20px;
opacity: 0.9;
}
.video-enable-btn {
background: white;
color: #667eea;
border: none;
padding: 12px 24px;
border-radius: 25px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
font-size: 14px;
}
.video-enable-btn:hover {
background: #f8f9fa;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
/* Connection Notification */
.connection-notification {
position: fixed;
top: 80px;
right: 20px;
background: white;
padding: 15px 20px;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
display: flex;
align-items: center;
gap: 12px;
z-index: 1000;
animation: slideIn 0.3s ease;
}
@keyframes slideIn {
from {
transform: translateX(400px);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.connection-notification.fade-out {
animation: slideOut 0.3s ease;
}
@keyframes slideOut {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(400px);
opacity: 0;
}
}
.connection-notification i {
font-size: 20px;
color: #2c5f8d;
}
.connection-notification span {
font-size: 14px;
color: #2c3e50;
font-weight: 500;
}
/* Adaptive Video Enabled State */
.adaptive-video-enabled {
border: 2px solid #2c5f8d;
border-radius: 10px;
}
/* Loading Skeleton for Images */
.image-skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 1.5s ease-in-out infinite;
width: 100%;
height: 100%;
border-radius: 10px;
}
@keyframes loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
/* Connection Speed Indicator (optional debug tool) */
.connection-speed-indicator {
position: fixed;
bottom: 20px;
right: 20px;
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 10px 15px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
z-index: 1000;
display: none; /* Hidden by default, can be enabled for debugging */
}
.connection-speed-indicator.slow {
background: #e74c3c;
}
.connection-speed-indicator.medium {
background: #f39c12;
}
.connection-speed-indicator.fast {
background: #27ae60;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.connection-notification {
top: 60px;
right: 10px;
left: 10px;
font-size: 13px;
}
.adaptive-loading-indicator {
padding: 15px;
}
.adaptive-loading-indicator .spinner {
width: 30px;
height: 30px;
}
.video-placeholder {
min-height: 200px;
}
.video-placeholder-content i {
font-size: 36px;
}
.video-placeholder-content p {
font-size: 14px;
}
}
/* Print styles */
@media print {
.adaptive-loading-indicator,
.connection-notification,
.video-placeholder,
.connection-speed-indicator {
display: none !important;
}
}
/* Accessibility */
.adaptive-loading-indicator:focus,
.video-enable-btn:focus {
outline: 2px solid #2c5f8d;
outline-offset: 2px;
}
/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
.adaptive-loading-indicator .spinner,
.adaptive-loaded,
.connection-notification,
.image-skeleton {
animation: none !important;
}
}