Same page.
Lighter on weak phones.
captier sets data-tier="low|mid|high" on <html> before first paint, so your CSS can turn off blur, heavy animation and 3D on weak devices — and your JS can skip heavy imports entirely. Under 2 KB. No dependencies.
The heavy stage — real weight, not a mockup
Three giant blurred gradient blobs drifting, a spinning 3D glass cube, 130 canvas particles, floating orbs, glass cards, and a liquid-glass lens that refracts what's behind it — all of it real, all of it gated by the tier. On high everything moves. On mid the blobs and orbs freeze. On low the background goes plain white, the blobs and particles vanish, the cube flattens and the glass goes solid. Try it — tap the FPS pill in the header:
SVG refraction — the blobs bend through this lens. Only on high.
backdrop-filter: blur(18px). Solid tint on low.
Blobs + orbs drift forever. Frozen on mid and low.
A spinning cube, preserve-3d. Flat on low.
The particles are JS-gated too: they only animate when the tier isn't low — the same if (Captier.tier() !== "low") pattern you'd use for a 3D library. Watch the live FPS in the header while the stage is running.
Liquid glass, for real — glisse
This panel is glisse — Apple's Liquid Glass for the web, as React components. It only mounts on high: the ~300 KB of React + glisse in vendor/ never downloads on weaker tiers. That's the JS-gating pattern captier is for — skip the heavy import entirely. (expo-glass-effect is the native iOS version for Expo apps — it can't run in a web page at all, so it's not here; glisse is the web equivalent.)
Glisse isn't loaded on this tier — the heavy components stay unmounted.
Live demo — this page is running captier
| Signal | Value |
|---|---|
CPU cores (hardwareConcurrency) | – |
Device memory (deviceMemory) | – |
Connection (effectiveType) | – |
Data Saver (saveData) | – |
prefers-reduced-motion | – |
| Live FPS (this page) | – |
| Override | – |
Force a tier
Or open with ?cap=low · ?cap=mid · ?cap=high. An override locks the tier — the FPS check won't change it. The header pill does the same thing: tap it to cycle low → mid → high.
Stress test — watch the tier drop
This burns ~45 ms per frame on purpose, so FPS falls under 30 — then Captier.recheck() runs and the tier drops one level. It never goes back up (downgrade-only). Turn it off to stop the load; the tier stays where it dropped.
| Tier | Background | Blur | Heavy animation | 3D |
|---|---|---|---|---|
| low | plain white | solid tint | off | off |
| mid | gradient | kept | off | kept |
| high | animated liquid | kept | kept | kept |
Install
Two tags in <head>. The script must come before your CSS so the tier is set before first paint — that's the whole trick.
<script src="https://cdn.jsdelivr.net/gh/MrtinMlr/captier@main/captier.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/MrtinMlr/captier@main/captier.css">
Or download the files and self-host:
git clone https://github.com/MrtinMlr/captier.git
# or download the zip:
# https://github.com/MrtinMlr/captier/archive/refs/heads/main.zip
npm install captier — the name is free on npm but the package isn't published yet. Until then, the CDN links above are the install.
Working with an AI agent? Install the skill so it knows how to use captier: npx skills add MrtinMlr/captier — see skills/captier/SKILL.md.
Usage
1. Put the script first in <head>
Before any render-blocking CSS. If it loads after first paint, the tier still works — but users may see one flash of heavy effects.
2. Add the companion CSS after your stylesheet
It maps the tiers to plain CSS. Define --glass-fallback to choose the solid color low-tier devices get instead of blur:
:root { --glass-fallback: rgba(20, 20, 28, .94); }
3. Use the hooks
/* Your own rules per tier */
[data-tier="low"] .glass { backdrop-filter: none; background: var(--glass-fallback); }
[data-tier="low"] .hero-video { display: none; }
/* Or use the built-in classes: .glass, .anim-heavy, .anim-3d */
/* JS: skip heavy work entirely */
if (Captier.tier() !== "low") {
import("./heavy-3d.js");
}
API
| Call | Does what |
|---|---|
Captier.tier() | returns "low" | "mid" | "high" |
Captier.set("low") | forces a tier, remembers it in localStorage |
Captier.recheck() | re-runs the ~2 s FPS check on demand (downgrade-only) |
?cap=low | URL override — handy for testing |
How the tier is picked: hardwareConcurrency + deviceMemory (+ saveData / slow connection). prefers-reduced-motion: reduce forces low. Chromium-only signals are guarded — other browsers fall back to mid-range defaults. Then a ~2 s FPS sample after load can only drop the tier, never raise it.