Skip to the content

Kyuubuキューブ

Turn CSS 3D cubes by touch, keys or notation, reproduce a scramble from a seed, and follow a solve one named step at a time.

Kyuubu (キューブ) is the Japanese spelling of cube. About the name

Contents

Reference · Cube engine and views

MoveListOptionstype

How a list is set up.

Import it

import type { MoveListOptions } from "@johnmorrisdotca/kyuubu";

Definition

type MoveListOptions = {
    groups: readonly MoveListGroup[];
    current?: number | null;
    locale?: KyuubuLanguage;
    onPick?: (index: number, group: number, at: number) => void;
    label?: string;
};

Members

NameTypeDescription
groupsreadonly MoveListGroup[]

The runs of moves, in order.

current (optional)number | null | undefined

The move just made, counted across every run from 0, or null for none.

locale (optional)KyuubuLanguage | undefined

English or Japanese: for the words of each move when none is given, and for the list's own name. The page's lang when left out.

onPick (optional)((index: number, group: number, at: number) => void) | undefined

Called when a move is chosen, by a press or a key: its place counted across every run from 0, its run and its place in the run.

label (optional)string | undefined

What a screen reader calls the whole list. "The moves" in the list's language when left out.

Examples

import type { MoveListOptions } from "@johnmorrisdotca/kyuubu";


const value: MoveListOptions = { groups: [{ label: "Solve", items: ["R", "R'"] }], current: 0 };
console.log(value.current);
0

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kyuubu 1.14.1.