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 · Cuboid player

mountCuboidPlayerfunction

A solve on a cuboid drawn in an element, with its controls.

Import it

import { mountCuboidPlayer } from "@johnmorrisdotca/kyuubu/cuboid/play";

Definition

function mountCuboidPlayer(host: HTMLElement, options: CuboidPlayerOptions): CuboidPlayerHandle

Parameters

NameTypeDescription
hostHTMLElement

The DOM element that receives the view and controls.

optionsCuboidPlayerOptions

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

Returns

CuboidPlayerHandle

A solve on a cuboid drawn in an element, with its controls.

Examples

import { mountCuboidPlayer } from "@johnmorrisdotca/kyuubu/cuboid/play";

const host = document.createElement("div");
document.body.append(host);
const player = mountCuboidPlayer(host, { dims: [2, 3, 3], scramble: "R", solution: "R'", autoplay: false });
console.log(player.plan?.solved);
// Call player.destroy() when removing the player.

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