本文へ移動

Kyuubuキューブ

CSS 3Dのキューブをタッチ、キー、回転記号で回します。シードでスクランブルを再現し、名前付きの手順で解き方を追えます。

「キューブ」は、英語のcubeを表す日本語の表記です。 名前について(英語)

目次

リファレンス · キューブのエンジンと表示

keepScrambling関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

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

定義

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

引数

名前型説明
cubeScrambled

The cube whose state or turning is controlled.

options (省略可)KeepScramblingOptions

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

戻り値

KeepScramblingHandle

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

例

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.

ソースを見るGitHub で編集@johnmorrisdotca/kyuubu 1.14.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。