Interactive 3D Rubik's cube in the browser. Three.js rendering, drag-to-rotate face gestures, keyboard notation, scramble + timer + undo.
Live: https://tiennm99.github.io/rubik/
- Three.js (WebGL rendering)
- Svelte 5 with runes (UI shell)
- Tween.js (move animation)
- Vite (build)
npm install
npm run dev # http://localhost:8080
npm run dev:codeserver # behind code-server proxy (set CODESERVER_HOST in .env.local)
npm run build # → ../dist| Input | Action |
|---|---|
| Drag a sticker | Rotate that face |
| Drag empty space | Orbit camera |
R L U D F B M E S |
Quarter-turn moves |
| Shift + letter | Inverse (prime) |
x y z |
Cube rotations |
| Space | Scramble |
Z |
Undo |
| Esc | Reset |
src/
main.js
app.css
views/ Svelte components (UI)
lib/
core/ Pure JS — cube state, moves, scramble, parser
render/ Three.js scene + cubie meshes + animation
controls/ Pointer gesture + keyboard
plans/ Implementation plans + research reports
docs/ Project documentation
vite/ Per-environment Vite configs
Apache-2.0