You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**FrameRateHelper** is a lightweight, zero-dependency JavaScript utility that calculates the user's display refresh rate and provides a stable, clamped frame duration. It is ideal for synchronizing animations with screen refresh rates for smoother UI interactions.
3
+
**FrameRateHelper** is a lightweight, zero-dependency JavaScript utility that calculates the user's display refresh rate and provides a stable, clamped frame duration. It is ideal for synchronizing animations with screen refresh rates to produce smooth, consistent visual experiences.
4
4
5
-
## Features
5
+
---
6
+
7
+
## 🚀 Features
6
8
7
-
- 🔍 Detects real screen refresh rate using `requestAnimationFrame`
8
-
- 🧠 Includes fallback to `requestIdleCallback` and `setTimeout`
9
-
- 🧱 Clamp logic prevents frame duration spikes on low-power or inactive tabs
10
-
- 💡 Asynchronous, event-driven design
11
-
- 🪶 No dependencies, pure vanilla JS
9
+
- 🔍 Automatically detects true screen refresh rate using `requestAnimationFrame`
10
+
- 🧠 Falls back to `requestIdleCallback` or `setTimeout` when needed
11
+
- 🧱 Built-in clamping prevents duration spikes on slow devices or inactive tabs
12
+
- 📦 Offers methods for calculating precise animation timing
13
+
- 📐 Frame-based timing with optional min/max/rounding controls
14
+
- 🪶 Lightweight and dependency-free — pure vanilla JavaScript
0 commit comments