Skip to the content

Kyuubuキューブ

Turn CSS 3D cubes by touch, keys or notation, reproduce a scramble from a seed, and follow a solve one named step at a time.

Kyuubu (キューブ) is the Japanese spelling of cube. About the name

Contents

Reference · Cube engine and views

CubeThemetype

How a cube looks: its six colours, its plastic, and the shape of a sticker. Everything may be left out, and what is left out stays as it was.

Import it

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

Definition

type CubeTheme = {
    colours?: Partial<Record<CubeFace, string>>;
    plastic?: string;
    stickerInset?: string;
    stickerRadius?: string;
    cornerRadius?: string;
};

Members

NameTypeDescription
colours (optional)Partial<Record<"U" | "R" | "F" | "D" | "L" | "B", string>> | undefined

Colours for the six faces, by the letter a solved face carries. Any CSS colour.

plastic (optional)string | undefined

The colour of the plastic between stickers and inside the cube.

stickerInset (optional)string | undefined

How far a sticker sits in from the edge of its square, as a CSS length or percentage of the square. "6%" when left out.

stickerRadius (optional)string | undefined

How round a sticker's corners are, as a CSS length or percentage. "14%" when left out.

cornerRadius (optional)string | undefined

How round the cube's own corners are, as a CSS length on a cube drawn 300px across (it grows and shrinks with the cube): "15px" when left out, "0" for square. Never more than nearly half a sticker.

Examples

import type { CubeTheme } from "@johnmorrisdotca/kyuubu";
import { CUBE_THEMES } from "@johnmorrisdotca/kyuubu";

const value: CubeTheme = CUBE_THEMES.paper;
console.log(value.plastic);
#1f2320

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kyuubu 1.14.1.