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

GuideHandletype

A guide beside a cube, on the page.

Import it

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

Definition

type GuideHandle = {
    readonly guide: Guide;
    takeBack(): void;
    makeNext(): void;
    load(source: GuideSource): void;
    setLocale(locale: KyuubuLanguage): void;
    destroy(): void;
};

Members

NameTypeDescription
guideGuide

The guide it shows: what is next, what has been done, any detour.

takeBack(): void

Every detour taken back, on the cube.

makeNext(): void

The next movement made for the person, on the cube, after taking back any detour.

load(source: GuideSource): void

Another list or the method, from the cube as it is now.

setLocale(locale: KyuubuLanguage): void
destroy(): void

Take it off the page, and the hint off the cube. The cube stays as it is.

Examples

import type { GuideHandle } from "@johnmorrisdotca/kyuubu";
import { CubeView, mountGuide } from "@johnmorrisdotca/kyuubu";

const value: GuideHandle = mountGuide(document.createElement("div"), new CubeView(document.createElement("div"), { size: 3, interactive: true }), { moves: "R U" });
console.log(value.guide.next?.text);

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