Mini Hands On Cube is a standalone Three.js Rubik's Cube app with direct drag solving, color-based face controls, true random-state scrambles, and solver-assisted recovery.
- Interactive 3x3x3 Rubik's Cube scene.
- Free orbit drag around the cube, including full vertical pitch, while zoom stays on explicit
-and+buttons. - A mode toggle that switches between Classic Face Turn Mode, Drag Solve Mode, and Layer Arrow Mode without resetting the cube.
- Drag Solve Mode that lets you drag visible stickers to turn rows or columns while reserving the empty space around the cube for whole-view orbiting.
- Live center-color face selection, so
Bluealways means the face whose center sticker is blue right now. - Classic mode with color-first clockwise/counterclockwise face turns that follow the live center-color mapping.
- Layer Arrow Mode with automatic flat face locking, persistent 12-arrow overlays that stay centered on the cube, row/column slice turns, and lock-follow behavior when the selected center moves to a new face.
- Utility controls for
Reset,Randomize,Solve,Show moves,Revert solve,Stop, and button-only zoom. - Solver integration powered by
cubejs. - State-aware solve planning that only reuses recorded history when it still matches the live cube state, and otherwise falls back to the
cubejssolver so repeated random scrambles still solve cleanly. - Solve move playback that presents plain-language steps with notation as a secondary hint instead of raw notation alone.
- Responsive layout that keeps the desktop shell inside the viewport, refreshes the canvas for high-DPI resize changes, and still stacks cleanly on tablet and mobile widths.
- Accessible status updates and visible keyboard focus styling for control flows.
From this folder:
npm install
npm run devOpen http://localhost:8000/ in your browser.
npm run dev
npm run build
npm run preview
npm run verifydevandstartrun the Vite development server on port8000.buildemits the production bundle intodist/with source maps enabled.previewserves the built output through Vite's production preview server.verifyruns linting, formatting checks, Vitest, the Vite production build, and the local workflow verification script.
Optional local variant:
npm run start:no-overlayUse npm run start:no-overlay when you want the cleanest view for screenshots or Three.js DevTools inspection.
npm run test
npm run test:watch
npm run lint
npm run lint:fix
npm run format:check
npm run formattestandtest:watchrun the Vitest suite for core, runtime dependency, and workflow helpers.lintandlint:fixrun ESLint with a local flat config.formatandformat:checkrun Prettier with project-local settings.
threeis bundled from the local npm dependency through Vite instead of a CDN import.- The solver ships as the local file dependency
cubejs-localundervendor/cubejsand loads lazily throughcore/loadCubeClass.js. window.THREEis exposed only in development through a dev-only helper so Playwright and Three.js DevTools can inspect the live scene without inflating the production bundle.
- Let the cube idle-spin until you are ready to solve.
- Pick
Drag Solve Modewhen you want theonlinecube.com-style interaction split. - In Drag Solve Mode, drag a visible sticker to turn its row or column, and drag the empty space around the cube when you want to orbit the whole view instead.
- Choose a center color from the face selector when you want the targeted controls used by Classic Face Turn Mode or Layer Arrow Mode.
- Pick
Classic Face Turn Modewhen you want the existing clockwise and counterclockwise direction pad. - The selector always follows live centers, so if a middle-slice move shifts the blue center to the top face, the
Bluebutton updates tocurrently on the top face. - Pick
Layer Arrow Modewhen you want the selected center color rotated into a flat 2D front view with 12 persistent row and column arrows centered around the cube. - In Layer Arrow Mode, the lock follows the selected center color after slice moves so the chosen color stays in front; drag the scene once if you want to release that lock and orbit freely again.
- Select a different color anytime you want the cube snapped to that live center again.
- Use utility controls when needed.
Randomizecreates a true random-state scramble and animates it.Solvecomputes a recovery sequence, preferring the shorter of the solver output or the inverse of your recorded move history only when that history still matches the live cube state.Show movesreveals a readable numbered move list for the last solve, with standard notation kept as a secondary hint.Revert solverestores the cube to the state it had right before the last solve playback.Stopcancels active playback safely without leaving the app in a stuck state.Resetreturns to solved state instantly.- Use
-/+when you want to change camera distance.
Status text reports current app state: warming, idle, scrambling, solving, solved, or error.
See CONTRIBUTING.md for local setup, verification, and pull request expectations. Please also review the Code of Conduct and Security Policy before contributing.
Public repo note: pull requests run the same npm run verify pipeline in GitHub Actions, and the repo now includes issue and PR templates to keep external contributions consistent.
Mini Hands On Cube is released under the MIT License.
Copyright (c) 2026 Sithu Win San.