本文へ移動

Kyuubuキューブ

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

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

目次

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

KeepScramblingOptions型

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

How it is run.

インポート

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

定義

type KeepScramblingOptions = {
    pace?: number | ScramblePace;
    faces?: boolean;
    random?: () => number;
    autoplay?: boolean;
    page?: ScramblePage;
    reducedMotion?: boolean;
};

メンバー

名前型説明
pace (省略可)number | "fast" | "normal" | "slow" | undefined

Seconds between turns, or a pace's name: one when left out, never under 0.2.

faces (省略可)boolean | undefined

Turn only the six outer faces, never an inner layer.

random (省略可)(() => number) | undefined

A number in [0, 1), like Math.random; seeded, the same cube turns the same way.

autoplay (省略可)boolean | undefined

Start by itself: true when left out.

page (省略可)ScramblePage | undefined

The page, to ask whether it is hidden and to hear it change: the browser's own when left out.

reducedMotion (省略可)boolean | undefined

Whether the device asks for reduced motion, which keeps the cube still: read from the browser when left out.

例

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


const value: KeepScramblingOptions = { pace: "slow", autoplay: false, reducedMotion: true };
console.log(value.pace);
slow

出力(このページを作ったときに実行した結果)

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

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