perf: frame-rate independent animation + Scroll-Driven progress bar
- MatrixRain: add delta time for consistent speed across 60/120/144Hz displays - ReadingProgress: use Scroll-Driven Animations API with JS fallback - Fallback to scroll events for unsupported browsers (Firefox) and prefers-reduced-motion Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -97,6 +97,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Reading progress bar - Scroll-Driven Animations API (Chrome 115+, Safari 26+, Edge 115+) */
|
||||
@keyframes reading-progress-grow {
|
||||
from { transform: scaleX(0); }
|
||||
to { transform: scaleX(1); }
|
||||
}
|
||||
|
||||
.reading-progress-bar-scroll-driven {
|
||||
animation: reading-progress-grow auto linear forwards;
|
||||
animation-timeline: scroll(block root);
|
||||
}
|
||||
|
||||
:root {
|
||||
--motion-duration-short: 180ms;
|
||||
--motion-duration-medium: 260ms;
|
||||
|
||||
Reference in New Issue
Block a user