本文へ移動

Kyuubuキューブ

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

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

目次

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

GuideHandle型

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

A guide beside a cube, on the page.

インポート

import type { GuideHandle } from "@johnmorrisdotca/kyuubu";

定義

type GuideHandle = {
    readonly guide: Guide;
    takeBack(): void;
    makeNext(): void;
    load(source: GuideSource): void;
    setLocale(locale: KyuubuLanguage): void;
    destroy(): void;
};

メンバー

名前型説明
guideGuide

The guide it shows: what is next, what has been done, any detour.

takeBack(): void

Every detour taken back, on the cube.

makeNext(): void

The next movement made for the person, on the cube, after taking back any detour.

load(source: GuideSource): void

Another list or the method, from the cube as it is now.

setLocale(locale: KyuubuLanguage): void
destroy(): void

Take it off the page, and the hint off the cube. The cube stays as it is.

例

import type { GuideHandle } from "@johnmorrisdotca/kyuubu";
import { CubeView, mountGuide } from "@johnmorrisdotca/kyuubu";

const value: GuideHandle = mountGuide(document.createElement("div"), new CubeView(document.createElement("div"), { size: 3, interactive: true }), { moves: "R U" });
console.log(value.guide.next?.text);

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

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