UNPKG

create-nexaui-electron

Version:

Create Nexa App - Tool untuk membuat aplikasi Nexa Electron

406 lines (351 loc) 7.89 kB
/* Container styles */ .carousel-container { margin: 20px 0; } .carousel-preview { border: 1px solid #ddd; padding: 20px; border-radius: 8px; margin-bottom: 1rem; } /* Carousel base styles */ .nx-carousel { position: relative; width: 100%; overflow: hidden; border-radius: 8px; } .nx-carousel-inner { position: relative; width: 100%; height: 400px; } /* Carousel items */ .nx-carousel-item { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 1s ease-in-out, visibility 1s ease-in-out, transform 1s ease-in-out; transform: scale(1.1); } .nx-carousel-item.active { opacity: 1; visibility: visible; transform: scale(1); } .nx-carousel-item.preparing { opacity: 0; visibility: visible; transform: scale(0.9); } .nx-carousel-item.fade-out { opacity: 0; transform: scale(1.1); } .nx-carousel-item.fade-in { opacity: 1; transform: scale(1); } /* Optimasi performa animasi */ .nx-carousel-item { will-change: opacity, transform; backface-visibility: hidden; perspective: 1000px; } /* Pastikan gambar tidak blur saat transformasi */ .nx-carousel-item img { transform: translateZ(0); backface-visibility: hidden; } /* Tambahkan efek blur saat transisi */ .nx-carousel-item.fade-out, .nx-carousel-item.preparing { filter: blur(3px); } .nx-carousel-item.active, .nx-carousel-item.fade-in { filter: blur(0); transition: opacity 1s ease-in-out, visibility 1s ease-in-out, transform 1s ease-in-out, filter 1s ease-in-out; } .nx-carousel-item img { width: 100%; height: 100%; object-fit: cover; } /* Navigation buttons */ .nx-carousel-prev, .nx-carousel-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.5); color: white; border: none; padding: 15px; cursor: pointer; font-size: 18px; border-radius: 50%; width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; transition: background 0.3s ease; } .nx-carousel-prev:hover, .nx-carousel-next:hover { background: rgba(0, 0, 0, 0.8); } .nx-carousel-prev { left: 10px; } .nx-carousel-next { right: 10px; } /* Caption styles */ .nx-carousel-caption { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.7); color: white; padding: 20px; text-align: center; } .nx-carousel-caption h5 { margin: 0 0 10px 0; font-size: 1.25rem; } .nx-carousel-caption p { margin: 0; font-size: 1rem; } /* Indicators */ .nx-carousel-indicators { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; } .nx-carousel-indicators button { width: 10px; height: 10px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.5); cursor: pointer; padding: 0; transition: background 0.3s ease; } .nx-carousel-indicators button.active { background: white; } /* Responsive adjustments */ @media (max-width: 768px) { .nx-carousel-inner { height: 300px; } .nx-carousel-caption { padding: 10px; } .nx-carousel-caption h5 { font-size: 1rem; } .nx-carousel-caption p { font-size: 0.875rem; } .nx-carousel-prev, .nx-carousel-next { padding: 10px; width: 35px; height: 35px; font-size: 14px; } } /* Tambahkan CSS untuk loading state */ .nx-carousel-item.loading::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; } .nx-carousel-item.loading::after { content: ''; width: 40px; height: 40px; border: 4px solid #ddd; border-top-color: #666; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: spin 1s linear infinite; } @keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } } /* CSS untuk progress bar */ .nx-carousel-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: rgba(255,255,255,0.3); } .nx-carousel-progress .progress-bar { width: 0; height: 100%; background: white; transition: width 5s linear; } .nx-carousel-progress.active .progress-bar { width: 100%; } /* Mobile Optimization Styles */ .nx-carousel-mobile { touch-action: pan-y pinch-zoom; } .nx-carousel-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity 0.3s ease; } .nx-carousel-overlay .swipe-hint { color: white; font-size: 1.2rem; padding: 10px 20px; background: rgba(0,0,0,0.5); border-radius: 20px; animation: fadeInOut 2s infinite; } @keyframes fadeInOut { 0%, 100% { opacity: 0; } 50% { opacity: 1; } } /* Hide swipe hint after first interaction */ .nx-carousel-mobile.interacted .nx-carousel-overlay { opacity: 0; pointer-events: none; } /* Mobile-specific indicator styles */ .nx-carousel-indicators.mobile { bottom: 10px; } .nx-carousel-indicators.mobile button { width: 30px; height: 4px; border-radius: 2px; } /* Touch feedback */ .nx-carousel-mobile .nx-carousel-item { transition: transform 0.3s ease-out; } .nx-carousel-mobile .nx-carousel-item.swiping { transition: none; } /* Improved touch targets */ @media (max-width: 767px) { .nx-carousel-mobile .nx-carousel-prev, .nx-carousel-mobile .nx-carousel-next { min-width: 44px; /* Minimum touch target size */ min-height: 44px; } .nx-carousel-indicators.mobile button { min-width: 44px; margin: 0 4px; } } /* Gesture hint styles */ .gesture-hint { position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%); color: white; background: rgba(0,0,0,0.6); padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; pointer-events: none; opacity: 0; transition: opacity 0.3s; } .nx-carousel-mobile:not(.interacted) .gesture-hint { opacity: 1; } /* Autoplay Controls */ .nx-carousel-play-toggle { position: absolute; bottom: 10px; right: 10px; background: rgba(0, 0, 0, 0.5); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; z-index: 3; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: background 0.3s ease; } .nx-carousel-play-toggle:hover { background: rgba(0, 0, 0, 0.8); } /* Progress bar animation */ @keyframes progress { from { width: 0; } to { width: 100%; } } .nx-carousel-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: rgba(255,255,255,0.3); } .nx-carousel-progress .progress-bar { height: 100%; background: white; width: 0; } .nx-carousel-progress.active .progress-bar { animation: progress var(--interval, 3000ms) linear; } /* Pause on hover styles */ .nx-carousel-pause-hover:hover .progress-bar { animation-play-state: paused; }