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

CubeOptiontype

One choice.

Import it

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

Definition

type CubeOption = {
    id: string;
    group: OptionGroup;
    kind: OptionKind;
    default?: string | number | boolean;
    choices?: readonly string[];
    choiceLabels?: Readonly<Record<string, Readonly<Record<string, string>>>>;
    range?: {
        min: number;
        max: number;
        step: number;
    };
    names: {
        view?: string;
        player?: string;
        cube?: string;
        turning?: string;
        cuboid?: string;
        cuboidPlayer?: string;
        cuboidElement?: string;
    };
    factor?: {
        player?: number;
    };
    say: Record<KyuubuLanguage, {
        label: string;
        help: string;
    }>;
};

Members

NameTypeDescription
idstring

Its one name, in kebab case: what the builder's controls and its address call it.

groupOptionGroup
kindOptionKind
default (optional)string | number | boolean | undefined

What it is when nothing is said: the same as leaving it out. Absent where leaving it out is its own state (no theme, no scale).

choices (optional)readonly string[] | undefined

The ways to choose from, for a choice.

choiceLabels (optional)Readonly<Record<string, Readonly<Record<string, string>>>> | undefined

The words for each choice, by language; the value itself is what is written in code.

range (optional){ min: number; max: number; step: number; } | undefined

The least, the most and the step, for a number.

names{ view?: string; player?: string; cube?: string; turning?: string; cuboid?: string; cuboidPlayer?: string; cuboidElement?: string; }

What each way of making a cube calls it: view the CubeView option (colours.U is one face), player the mountPlayer option, cube the attribute of <kyuubu-cube> and the embed's address, turning the attribute of <kyuubu-scramble>; and for a cuboid, cuboid the CuboidView option, cuboidPlayer the mountCuboidPlayer option and cuboidElement the attribute of <kyuubu-cuboid>. Absent where that way does not have it.

factor (optional){ player?: number; } | undefined

What the player's option is worth in this option's own unit: timeMs is milliseconds and time seconds.

sayRecord<KyuubuLanguage, { label: string; help: string; }>

The label and the one plain line, in each language.

Examples

import type { CubeOption } from "@johnmorrisdotca/kyuubu";
import { CUBE_OPTIONS } from "@johnmorrisdotca/kyuubu";

const value: CubeOption = CUBE_OPTIONS[0]!;
console.log(value.id);
size

What it prints (run when this page was built)

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