A fully playable 3x3 puzzle cube as a hero, rendered in raw WebGL. Glossy black plastic bodies, raised rounded stickers with a soft specular sheen, a studio reflection map and a contact shadow. Play with the mouse or finger only: click a sticker to turn that face a quarter turn clockwise, Shift-click or right-click (long press on touch) to turn it back, drag across a face to turn any row or column in the drag direction (release past roughly 40% and it completes the turn, otherwise it springs back), drag the backdrop to spin the whole cube. The sticker under the cursor lights up and the cursor becomes a pointer. A move counter and a timer that starts on your first move after Scramble, plus a discreet Solve. Solving it by hand pulses the stickers and shows Solved in N moves with the time. A short demo plays until the first touch. Touch drags on the cube never fight page scrolling elsewhere. U D L R F B keys still work for keyboard users. Reduced motion shows a static scrambled state and a CSS cube stands in without WebGL.
Included in Pro and aboveCompare plans
Live preview. Move the mouse, scroll and click inside the frame.
import { MagicCubeHero } from "@/components/hyperblur-pro/magic-cube-hero"
<MagicCubeHero
title="Twist it. Solve it."
cta={{ label: "Start free", href: "/signup" }}
scrambleMoves={20}
onSolve={({ moves, ms }) => console.log(moves, ms)}
/>| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | string | "Interactive 3D puzzle" | Small pill above the headline. Empty string hides it. |
| title | string | "Twist it. Solve it." | Main headline. |
| subtitle | string | "A hand-built cube you can actually play..." | Supporting paragraph under the headline. |
| cta | { label: string; href?: string } | { label: "Get started", href: "#" } | Call to action button next to the headline. Pass null to hide it. |
| accent | string | "#ff5a1f" | Accent for the primary control, the eyebrow dot and the focus ring. |
| colors | [string, string, string, string, string, string] | ["#c41e3a", "#ff5800", "#f6f6f1", "#ffd500", "#0046ad", "#009b48"] | Sticker colors for the faces in the order right, left, top, bottom, front, back. |
| autoplay | boolean | true | Turns a few layers on its own until the visitor touches the cube. |
| controls | boolean | true | Shows the move counter, timer and the Scramble and Solve buttons plus a short hint. |
| interactive | boolean | true | Enables clicking, dragging and the keyboard shortcuts on the cube. When false the cube is display only and the page scrolls freely over it. |
| scrambleMoves | number | 20 | Number of animated turns the Scramble button plays. |
| onSolve | (info: { moves: number; ms: number }) => void | undefined | Called when the visitor solves a scrambled cube by hand. onSolved still works. |
| onMove | (info: { move: string; moves: number; source: "user" | "undo" }) => void | undefined | Called after every turn the visitor makes or undoes, with the move in standard notation (R, U', F2, M). |
| onSolved | (info: { moves: number; ms: number }) => void | undefined | Called when the visitor solves a scrambled cube by hand. |
| maxDpr | number | 2 | Upper limit for the canvas pixel ratio (capped at 2). |
Source code is included in Pro and above