本文へ移動

Kyuubuキューブ

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

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

目次

リファレンス · 直方体の操作

CuboidPlayerHandle型

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

A cuboid player on the page.

インポート

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

定義

type CuboidPlayerHandle = {
    readonly plan: CuboidReplayPlan | null;
    readonly fault: CuboidReplayFault | null;
    load(source: CuboidReplaySource, how?: {
        speed?: number;
        loop?: boolean;
        controls?: boolean;
        autoplay?: boolean;
    }): void;
    play(): void;
    pause(): void;
    step(by: 1 | -1): void;
    seek(position: number): void;
    restart(): void;
    setSpeed(speed: number): void;
    setLoop(loop: boolean): void;
    setLocale(locale: KyuubuLanguage): void;
    setTheme(theme: CubeTheme): void;
    setAnimateScrub(on: boolean): void;
    readonly animatingScrub: boolean;
    readonly status: ReplayStatus | null;
    readonly view: CuboidView;
    destroy(): void;
};

メンバー

名前型説明
planCuboidReplayPlan | null

The solve as it was read, or why it could not be.

faultCuboidReplayFault | null
load(source: CuboidReplaySource, how?: { speed?: number; loop?: boolean; controls?: boolean; autoplay?: boolean; }): void

Another solve on the same puzzle, in place of the one showing. The speed and the repeat are kept unless given.

play(): void
pause(): void
step(by: 1 | -1): void

One step on (1) or back (-1).

seek(position: number): void

To the puzzle after this many steps.

restart(): void
setSpeed(speed: number): void
setLoop(loop: boolean): void
setLocale(locale: KyuubuLanguage): void
setTheme(theme: CubeTheme): void
setAnimateScrub(on: boolean): void

Whether moving the slider turns the puzzle between where it was and where it goes.

animatingScrubboolean

Whether it does.

statusReplayStatus | null
viewCuboidView

The puzzle as drawn, for a page that wants to look at it.

destroy(): void

Take it off the page, with every listener.

例

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

const value: CuboidPlayerHandle = mountCuboidPlayer(document.createElement("div"), { dims: [2, 3, 3], scramble: "R", solution: "R'", autoplay: false });
console.log(value.plan?.solved);

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

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