CuboidPlayerOptionstype
How a cuboid player is set up: the solve, and how it is shown.
Import it
import type { CuboidPlayerOptions } from "@johnmorrisdotca/kyuubu/cuboid/play";
Definition
type CuboidPlayerOptions = CuboidReplaySource & {
autoplay?: boolean;
loop?: boolean;
controls?: boolean;
speed?: number;
theme?: CubeTheme;
cloth?: Cloth;
readout?: boolean;
moveList?: boolean;
animateScrub?: boolean;
locale?: KyuubuLanguage;
onChange?: (status: ReplayStatus) => void;
onEnd?: () => void;
};
Members
| Name | Type | Description |
|---|---|---|
dims | CuboidDims | The puzzle's width, height and depth. |
scramble | string | The scramble, as written. |
solution | string | The solve, as written. |
timeMs (optional) | number | undefined | How long the solve took, in milliseconds, when that is known. |
stepMs (optional) | readonly number[] | undefined | How long each step took, in milliseconds, when that is known; one for every step. |
autoplay (optional) | boolean | undefined | Start playing as soon as it is drawn. |
loop (optional) | boolean | undefined | Begin again when it ends. |
controls (optional) | boolean | undefined | Show the controls: true unless said otherwise. A puzzle with none still plays when |
speed (optional) | number | undefined | The speed it starts at: 1 is the solve's own pace. |
theme (optional) | CubeTheme | undefined | The puzzle's colours. |
cloth (optional) | "green" | "blue" | "red" | "black" | "wood" | undefined | The cloth the stage behind the puzzle is laid in: "green", "blue", "red", "black" or "wood", the family's five. With none, the stage is clear. |
readout (optional) | boolean | undefined | Show the code of the move just made in large type, with what it turns in words, and say it to a screen reader as it changes. True unless said otherwise; with |
moveList (optional) | boolean | undefined | Show the moves as buttons, the one just made marked and scrolled into view, each one taking the replay to it. True unless said otherwise; with |
animateScrub (optional) | boolean | undefined | Whether moving the slider, or choosing a move, turns the puzzle between where it was and where it goes. True unless said otherwise. |
locale (optional) | KyuubuLanguage | undefined | English or Japanese; the page's |
onChange (optional) | ((status: ReplayStatus) => void) | undefined | Called after every step, and whenever it starts, stops or is moved. |
onEnd (optional) | (() => void) | undefined | Called each time the end is reached. |
Examples
import type { CuboidPlayerOptions } from "@johnmorrisdotca/kyuubu/cuboid/play";
const value: CuboidPlayerOptions = { dims: [2, 3, 3], scramble: "R", solution: "R'", autoplay: false };
console.log(value.dims);[ 2, 3, 3 ]What it prints (run when this page was built)