本文へ移動

Kyuubuキューブ

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

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

目次

リファレンス · リプレイプレーヤー

PlayerHandle型

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

A player on the page.

インポート

import type { PlayerHandle } from "@johnmorrisdotca/kyuubu/player";

定義

type PlayerHandle = {
    readonly plan: ReplayPlan | null;
    readonly fault: ReplayFault | null;
    load(source: ReplaySource, how?: {
        speed?: number;
        loop?: boolean;
        controls?: boolean;
        autoplay?: boolean;
        guide?: 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;
    follow(on: boolean): void;
    readonly following: boolean;
    readonly status: ReplayStatus | null;
    destroy(): void;
};

メンバー

名前型説明
planReplayPlan | null

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

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

Another solve on the same cube, 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 cube 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 cube between where it was and where it goes.

animatingScrubboolean

Whether it does.

follow(on: boolean): void

Hand the cube to the viewer to turn, the next move shown on it (true), or take it back to be played (false).

followingboolean

Whether the viewer is turning it themselves.

statusReplayStatus | null
destroy(): void

Take it off the page, with every listener.

例

import type { PlayerHandle } from "@johnmorrisdotca/kyuubu/player";
import { mountPlayer } from "@johnmorrisdotca/kyuubu/player";

const value: PlayerHandle = mountPlayer(document.createElement("div"), { scramble: "R", solution: "R'", autoplay: false });
console.log(value.plan?.solved);

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

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