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

keepScramblingfunction

Keep a cube turning. Starts at once unless autoplay is false.

Import it

import { keepScrambling } from "@johnmorrisdotca/kyuubu";

Definition

function keepScrambling(cube: Scrambled, options?: KeepScramblingOptions): KeepScramblingHandle

Parameters

NameTypeDescription
cubeScrambled

The cube whose state or turning is controlled.

options (optional)KeepScramblingOptions

Options for this call; omitted fields retain their documented defaults.

Returns

KeepScramblingHandle

Keep a cube turning. Starts at once unless autoplay is false.

Examples

import { CubeView, keepScrambling } from "@johnmorrisdotca/kyuubu";

const host = document.createElement("div");
host.style.cssText = "width:160px;height:160px;position:relative";
document.body.append(host);
const cube = new CubeView(host, { size: 3 });
const turning = keepScrambling(cube, { autoplay: false, pace: "slow" });
console.log(turning.running);
// turning.start() begins; turning.destroy() and cube.destroy() clean up.

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