本文へ移動

Kyuubuキューブ

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

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

目次

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

CubeOption型

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

One choice.

インポート

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

定義

type CubeOption = {
    id: string;
    group: OptionGroup;
    kind: OptionKind;
    default?: string | number | boolean;
    choices?: readonly string[];
    choiceLabels?: Readonly<Record<string, Readonly<Record<string, string>>>>;
    range?: {
        min: number;
        max: number;
        step: number;
    };
    names: {
        view?: string;
        player?: string;
        cube?: string;
        turning?: string;
        cuboid?: string;
        cuboidPlayer?: string;
        cuboidElement?: string;
    };
    factor?: {
        player?: number;
    };
    say: Record<KyuubuLanguage, {
        label: string;
        help: string;
    }>;
};

メンバー

名前型説明
idstring

Its one name, in kebab case: what the builder's controls and its address call it.

groupOptionGroup
kindOptionKind
default (省略可)string | number | boolean | undefined

What it is when nothing is said: the same as leaving it out. Absent where leaving it out is its own state (no theme, no scale).

choices (省略可)readonly string[] | undefined

The ways to choose from, for a choice.

choiceLabels (省略可)Readonly<Record<string, Readonly<Record<string, string>>>> | undefined

The words for each choice, by language; the value itself is what is written in code.

range (省略可){ min: number; max: number; step: number; } | undefined

The least, the most and the step, for a number.

names{ view?: string; player?: string; cube?: string; turning?: string; cuboid?: string; cuboidPlayer?: string; cuboidElement?: string; }

What each way of making a cube calls it: view the CubeView option (colours.U is one face), player the mountPlayer option, cube the attribute of <kyuubu-cube> and the embed's address, turning the attribute of <kyuubu-scramble>; and for a cuboid, cuboid the CuboidView option, cuboidPlayer the mountCuboidPlayer option and cuboidElement the attribute of <kyuubu-cuboid>. Absent where that way does not have it.

factor (省略可){ player?: number; } | undefined

What the player's option is worth in this option's own unit: timeMs is milliseconds and time seconds.

sayRecord<KyuubuLanguage, { label: string; help: string; }>

The label and the one plain line, in each language.

例

import type { CubeOption } from "@johnmorrisdotca/kyuubu";
import { CUBE_OPTIONS } from "@johnmorrisdotca/kyuubu";

const value: CubeOption = CUBE_OPTIONS[0]!;
console.log(value.id);
size

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

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

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