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

MoveListHandletype

A list on the page.

Import it

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

Definition

type MoveListHandle = {
    readonly element: HTMLElement;
    setCurrent(index: number | null): void;
    setGroups(groups: readonly MoveListGroup[], current?: number | null): void;
    setLocale(locale: KyuubuLanguage): void;
    focus(): void;
    destroy(): void;
};

Members

NameTypeDescription
elementHTMLElement

The element the list is drawn in.

setCurrent(index: number | null): void

Mark the move just made, counted across every run from 0, or none with null; it is scrolled into view.

setGroups(groups: readonly MoveListGroup[], current?: number | null): void

Other runs of moves in place of those showing.

setLocale(locale: KyuubuLanguage): void
focus(): void

Put the keyboard's focus on the move just made.

destroy(): void

Take it off the page, with every listener.

Examples

import type { MoveListHandle } from "@johnmorrisdotca/kyuubu";
import { mountMoveList } from "@johnmorrisdotca/kyuubu";

const value: MoveListHandle = mountMoveList(document.createElement("div"), { groups: [{ label: "Solve", items: ["R"] }] });
console.log(value.element.tagName);

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