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

cubeWidthPxfunction

The width in pixels a cube is drawn at: width when it is a number above zero, and otherwise the scale's. Null when neither is given, which leaves the cube filling whatever box it is in.

Import it

import { cubeWidthPx } from "@johnmorrisdotca/kyuubu";

Definition

function cubeWidthPx(scale?: CubeScale, width?: number): number | null

Parameters

NameTypeDescription
scale (optional)"small" | "medium" | "large" | undefined

The named drawing size, or null to leave the host in control.

width (optional)number | undefined

An explicit width in pixels; invalid or omitted widths use the scale.

Returns

number | null

The width in pixels a cube is drawn at: width when it is a number above zero, and otherwise the scale's. null when neither is given, which leaves the cube filling whatever box it is in.

Examples

import { cubeWidthPx } from "@johnmorrisdotca/kyuubu";

console.log(cubeWidthPx("small"));
72

What it prints (run when this page was built)

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