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

KeepScramblingOptionstype

How it is run.

Import it

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

Definition

type KeepScramblingOptions = {
    pace?: number | ScramblePace;
    faces?: boolean;
    random?: () => number;
    autoplay?: boolean;
    page?: ScramblePage;
    reducedMotion?: boolean;
};

Members

NameTypeDescription
pace (optional)number | "fast" | "normal" | "slow" | undefined

Seconds between turns, or a pace's name: one when left out, never under 0.2.

faces (optional)boolean | undefined

Turn only the six outer faces, never an inner layer.

random (optional)(() => number) | undefined

A number in [0, 1), like Math.random; seeded, the same cube turns the same way.

autoplay (optional)boolean | undefined

Start by itself: true when left out.

page (optional)ScramblePage | undefined

The page, to ask whether it is hidden and to hear it change: the browser's own when left out.

reducedMotion (optional)boolean | undefined

Whether the device asks for reduced motion, which keeps the cube still: read from the browser when left out.

Examples

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


const value: KeepScramblingOptions = { pace: "slow", autoplay: false, reducedMotion: true };
console.log(value.pace);
slow

What it prints (run when this page was built)

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