# marvelous616/web_cube architecture

> Architecture diagram of the GitHub repository marvelous616/web_cube, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marvelous616/web_cube
- Repository: https://github.com/marvelous616/web_cube

## Overview

This is a browser-based Rubik’s Cube visualizer and interactive move simulator. Users can rotate and zoom the camera, enter face moves, scramble the cube, and reverse recorded moves with the solve control or Enter key; the app animates queued turns and reports move and animation state in the UI. Rendering, post-processing, and the animation loop are initialized in main.js. The sampled source shows these runtime relationships; the README is empty, and unsampled HTML and styling are not described beyond the UI element lookups visible in main.js.

Main entry points: [`main.js`](https://github.com/marvelous616/web_cube/blob/master/main.js) (App Runtime), [`RubiksCube.js`](https://github.com/marvelous616/web_cube/blob/master/RubiksCube.js) (Cube Moves), [`index.html`](https://github.com/marvelous616/web_cube/blob/master/index.html) (Status Controls), [`rubiks.glb`](https://github.com/marvelous616/web_cube/blob/master/rubiks.glb) (Cube Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App Runtime<br/>[main.js]"]
  node_ui["Status Controls<br/>[index.html]"]
end

subgraph group_cube["Cube Interaction"]
  node_cube["Cube Moves<br/>[RubiksCube.js]"]
  node_model["Cube Model<br/>[rubiks.glb]"]
end

subgraph group_view["3D View"]
  node_camera["Camera Rig<br/>[CameraRig.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_ui
node_user -->|"enters moves"| node_cube
node_app -->|"updates"| node_ui
node_app -->|"creates and updates"| node_cube
node_app -->|"creates and updates"| node_camera
node_cube -->|"loads"| node_model

click node_app "https://github.com/marvelous616/web_cube/blob/master/main.js"
click node_ui "https://github.com/marvelous616/web_cube/blob/master/index.html"
click node_cube "https://github.com/marvelous616/web_cube/blob/master/RubiksCube.js"
click node_model "https://github.com/marvelous616/web_cube/blob/master/rubiks.glb"
click node_camera "https://github.com/marvelous616/web_cube/blob/master/CameraRig.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_ui,node_user toneBlue
class node_cube,node_model toneAmber
class node_camera toneMint
```

## Components

### Application

- [App Runtime](https://github.com/marvelous616/web_cube/blob/master/main.js): `main.js`
- [Status Controls](https://github.com/marvelous616/web_cube/blob/master/index.html): `index.html`

### Cube Interaction

- [Cube Moves](https://github.com/marvelous616/web_cube/blob/master/RubiksCube.js): `RubiksCube.js`
- [Cube Model](https://github.com/marvelous616/web_cube/blob/master/rubiks.glb): `rubiks.glb`

### 3D View

- [Camera Rig](https://github.com/marvelous616/web_cube/blob/master/CameraRig.js): `CameraRig.js`

### Other components

- **User**

## Connections

- User → Status Controls: uses
- User → Cube Moves: enters moves (evidence: `RubiksCube.js`)
- App Runtime → Status Controls: updates (evidence: `main.js`)
- App Runtime → Cube Moves: creates and updates (evidence: `main.js`)
- App Runtime → Camera Rig: creates and updates (evidence: `main.js`)
- Cube Moves → Cube Model: loads (evidence: `RubiksCube.js`)
