tiltMode関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { tiltMode } from "@johnmorrisdotca/uchusen-rockets";
定義
function tiltMode(env: { reducedMotion: boolean; coarsePointer: boolean; hasOrientation: boolean; needsPermission: boolean; }): TiltMode
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
TiltMode
off, ask or on.
例
import { tiltMode } from "@johnmorrisdotca/uchusen-rockets";
console.log(tiltMode({ reducedMotion: false, coarsePointer: true, hasOrientation: true, needsPermission: true }));ask出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。