Files
ridebus-pwa/src/_discovery.scss
Zakhar Timoshenko 1492f179eb feat: add new components for departures, discovery, and navigation
- Implemented SCSS styles for compact board in departures.
- Created styles for feature discovery modal and its elements.
- Added navigation styles for desktop and mobile views.
- Developed FeatureDiscovery component with guided steps for user onboarding.
- Introduced freshness utility to manage data freshness based on timestamps.
- Added tests for freshness utility to ensure correct behavior across various scenarios.
2026-10-07 21:51:05 +03:00

39 lines
3.2 KiB
SCSS

@mixin components {
.featureDiscovery { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: hidden; }
.featureDiscovery::backdrop { background: transparent; }
.discoverySpotlight { position: fixed; border: 2px solid var(--focus); border-radius: 22px; box-shadow: 0 0 0 100vmax #101e385c, 0 0 0 5px color-mix(in srgb, var(--focus) 22%, transparent); pointer-events: none; }
.discoveryCard { position: fixed; left: 16px; top: 16px; display: flex; flex-direction: column; width: min(360px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--control-border); border-radius: 26px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 42px #101e3835; visibility: hidden; overflow: hidden; }
.discoveryCard.discoveryReady { visibility: visible; animation: discoveryAppear .2s ease-out both; }
.discoveryTop { flex-shrink: 0; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.discoverySymbol { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 13px; background: var(--green); color: var(--green-ink); }
.discoveryCounter { color: var(--muted); font-size: 13px; line-height: 1.5; font-weight: 700; }
.discoveryClose { min-width: 44px; min-height: 44px; width: 44px; height: 44px; padding: 12px; margin-left: auto; color: var(--muted); }
.discoveryCopy { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; animation: discoveryAppear .2s ease-out both; }
.discoveryCopy:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 5px; }
.discoveryCopy h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.3px; font-weight: 800; }
.discoveryCopy p { font-size: 15px; line-height: 1.7; color: var(--muted); margin-top: 10px; }
.discoveryScrollHint { flex-shrink: 0; margin-top: 6px; font-size: 13px; line-height: 20px; color: var(--blue-muted); }
.discoveryProgress { flex-shrink: 0; display: flex; gap: 5px; margin-top: 18px; }
.discoveryProgress span { flex: 1; height: 4px; border-radius: 4px; background: var(--lavender); }
.discoveryProgress span.seen { background: var(--blue); }
.discoveryActions { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.discoveryActions > button { min-height: 44px; }
.discoveryActions .primaryButton { padding: 11px 18px; }
@keyframes discoveryAppear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 360px) {
.discoveryCard { padding: 16px; border-radius: 22px; }
.discoveryCopy h2 { font-size: 21px; }
}
@media (max-height: 480px) {
.discoveryCard { padding: 12px; }
.discoveryTop { margin-bottom: 8px; }
.discoveryCopy h2 { font-size: 20px; }
.discoveryCopy p { font-size: 14px; line-height: 1.6; }
.discoveryProgress { display: none; }
.discoveryActions { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
.discoveryCard.discoveryReady, .discoveryCopy { animation: none; }
}
}