Reference · Rockets, variants, parts and the fit check
tiltModefunction
Off under reduced motion, on a computer with a mouse, or where the browser has no orientation events; "ask" where it must ask first (iOS: a tap on "Tilt to turn" asks, never the page by itself); else on.
Import it
import { tiltMode } from "@johnmorrisdotca/uchusen-rockets";
Definition
function tiltMode(env: { reducedMotion: boolean; coarsePointer: boolean; hasOrientation: boolean; needsPermission: boolean; }): TiltMode
Parameters
| Name | Type | Description |
|---|---|---|
env | { reducedMotion: boolean; coarsePointer: boolean; hasOrientation: boolean; needsPermission: boolean; } | What the page knows: reduced motion, a coarse pointer (touch), whether the browser has orientation events, and whether it must ask permission first. |
Returns
TiltMode
off, ask or on.
Examples
import { tiltMode } from "@johnmorrisdotca/uchusen-rockets";
console.log(tiltMode({ reducedMotion: false, coarsePointer: true, hasOrientation: true, needsPermission: true }));askWhat it prints (run when this page was built)