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 · Cuboid engine

cuboidQuartersForReleasefunction

What letting go makes of a dragged layer, as quarter turns from −2 to 2, where 0 is back where it was. A layer that turns by quarters is read as the cube's is (quartersForRelease). One that only half turns is a half turn from HALF_TURN_COMMIT on, or from a flick (speed, in degrees a millisecond, signed like the angle) that has gone at least four times FLICK_ANGLE degrees the same way, and otherwise goes back.

Import it

import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";

Definition

function cuboidQuartersForRelease(angle: number, speed: number, halfOnly: boolean, commitAngle?: number): -2 | -1 | 0 | 1 | 2

Parameters

NameTypeDescription
anglenumber

The signed drag angle in degrees.

speednumber

The signed drag speed in degrees per millisecond.

halfOnlyboolean

Whether the layer can only make a half turn.

commitAngle (optional)number

The drag angle in degrees at which a resting release commits a turn.

Returns

0 | 1 | -1 | 2 | -2

What letting go makes of a dragged layer, as quarter turns from −2 to 2, where 0 is back where it was. A layer that turns by quarters is read as the cube's is (quartersForRelease). One that only half turns is a half turn from HALF_TURN_COMMIT on, or from a flick (speed, in degrees a millisecond, signed like the angle) that has gone at least four times FLICK_ANGLE degrees the same way, and otherwise goes back.

Examples

import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";

console.log(cuboidQuartersForRelease(100, 0, true));
2

What it prints (run when this page was built)

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