Reference · Cube engine and views
KeepScramblingOptionstype
How it is run.
Import it
import type { KeepScramblingOptions } from "@johnmorrisdotca/kyuubu";
Definition
type KeepScramblingOptions = {
pace?: number | ScramblePace;
faces?: boolean;
random?: () => number;
autoplay?: boolean;
page?: ScramblePage;
reducedMotion?: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
pace (optional) | number | "fast" | "normal" | "slow" | undefined | Seconds between turns, or a pace's name: one when left out, never under 0.2. |
faces (optional) | boolean | undefined | Turn only the six outer faces, never an inner layer. |
random (optional) | (() => number) | undefined | A number in [0, 1), like |
autoplay (optional) | boolean | undefined | Start by itself: true when left out. |
page (optional) | ScramblePage | undefined | The page, to ask whether it is hidden and to hear it change: the browser's own when left out. |
reducedMotion (optional) | boolean | undefined | Whether the device asks for reduced motion, which keeps the cube still: read from the browser when left out. |
Examples
import type { KeepScramblingOptions } from "@johnmorrisdotca/kyuubu";
const value: KeepScramblingOptions = { pace: "slow", autoplay: false, reducedMotion: true };
console.log(value.pace);slowWhat it prints (run when this page was built)