mountPlayerfunction
A solve drawn in an element, with its controls.
Import it
import { mountPlayer } from "@johnmorrisdotca/kyuubu/player";
Definition
function mountPlayer(host: HTMLElement, options: PlayerOptions): PlayerHandle
Parameters
| Name | Type | Description |
|---|---|---|
host | HTMLElement | The DOM element that receives the view and controls. |
options | PlayerOptions | Options for this call; omitted fields retain their documented defaults. |
Returns
PlayerHandle
A solve drawn in an element, with its controls.
Examples
import { mountPlayer } from "@johnmorrisdotca/kyuubu/player";
const host = document.createElement("div");
document.body.append(host);
const player = mountPlayer(host, { size: 3, scramble: "R", solution: "R'", autoplay: false });
console.log(player.plan?.solved);
// Call player.destroy() when removing the player.