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
| Name | Type | Description |
|---|---|---|
host | HTMLElement | The DOM element that receives the view and controls. |
options | CuboidPlayerOptions | 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.