# mohaminebrs/codrops-noise-transition architecture

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

- Interactive diagram: https://gitdiagram.com/mohaminebrs/codrops-noise-transition
- Repository: https://github.com/mohaminebrs/codrops-noise-transition

## Overview

This React/Three.js WebGL experiment renders an interactive energy-can model over a procedural radial-noise background. The user workflow enters through the app, reaches the 3D scene, and uses clicks to trigger model texture transitions or background color/progress changes; presentation controls allow the model to be manipulated. Separate shader materials implement the two visual effects, sharing procedural noise and palette data, while a small Zustand store gates animation. The README also identifies the can model and radial-noise effect as core capabilities. Arrows reflect shown imports, rendering composition, and state use; sampled files do not establish a direct connection between the frame’s button and canvas clicks.

Main entry points: [`src/Model.jsx`](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Model.jsx) (Can Model), [`src/Background.jsx`](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Background.jsx) (Radial Background), [`src/Scene.jsx`](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Scene.jsx) (Scene Canvas), [`src/App.jsx`](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/App.jsx) (App Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["React Entry<br/>[main.jsx]"]
  node_app_shell["App Shell<br/>[App.jsx]"]
  node_frame["Demo Frame<br/>[CodropsFrame.jsx]"]
end

subgraph group_scene["3D Scene"]
  node_scene_canvas["Scene Canvas<br/>[Scene.jsx]"]
  node_can_model["Can Model<br/>[Model.jsx]"]
end

subgraph group_effects["Visual Effects"]
  node_background["Radial Background<br/>[Background.jsx]"]
  node_background_shader["Background Shader"]
  node_noise["Noise Functions<br/>[Noise.js]"]
end

subgraph group_shared["Shared State and Assets"]
  node_can_asset["Can Asset<br/>[energy-can.glb]"]
  node_environment["HDR Environment"]
  node_palette["Color Palette<br/>[data.js]"]
  node_play_state["Play State<br/>[store.js]"]
end

node_visitor(("Visitor"))

node_entry -->|"renders"| node_app_shell
node_app_shell -->|"renders"| node_frame
node_app_shell -->|"renders"| node_scene_canvas
node_scene_canvas -->|"renders"| node_can_model
node_scene_canvas -->|"renders"| node_background
node_scene_canvas -->|"loads"| node_environment
node_can_model -->|"loads"| node_can_asset
node_can_model -->|"uses"| node_noise
node_background -->|"uses"| node_background_shader
node_background_shader -->|"uses"| node_noise
node_can_model -->|"reads"| node_palette
node_background -->|"reads"| node_palette
node_can_model -->|"reads and updates"| node_play_state
node_background -->|"reads"| node_play_state
node_visitor -->|"clicks to transition"| node_can_model
node_visitor -->|"clicks to recolor"| node_background

click node_entry "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/main.jsx"
click node_app_shell "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/App.jsx"
click node_frame "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/CodropsFrame.jsx"
click node_scene_canvas "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Scene.jsx"
click node_can_model "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Model.jsx"
click node_can_asset "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/assets/models/energy-can.glb"
click node_environment "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/assets/envMap/potsdamer_platz_0.256k.hdr"
click node_background "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Background.jsx"
click node_background_shader "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/BackgroundMaterial.js"
click node_noise "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Noise.js"
click node_palette "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/data.js"
click node_play_state "https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/store.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_entry,node_app_shell,node_frame toneBlue
class node_scene_canvas,node_can_model toneAmber
class node_background,node_background_shader,node_noise toneMint
class node_can_asset,node_environment,node_palette,node_play_state toneRose
class node_visitor toneIndigo
```

## Components

### Application

- [React Entry](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/main.jsx): `src/main.jsx`
- [App Shell](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/App.jsx): `src/App.jsx`
- [Demo Frame](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/CodropsFrame.jsx): `src/CodropsFrame.jsx`

### 3D Scene

- [Scene Canvas](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Scene.jsx): `src/Scene.jsx`
- [Can Model](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Model.jsx): `src/Model.jsx`

### Visual Effects

- [Radial Background](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Background.jsx): `src/Background.jsx`
- [Background Shader](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/BackgroundMaterial.js): `src/BackgroundMaterial.js`
- [Noise Functions](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/Noise.js): `src/Noise.js`

### Shared State and Assets

- [Can Asset](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/assets/models/energy-can.glb): `src/assets/models/energy-can.glb`
- [HDR Environment](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/assets/envMap/potsdamer_platz_0.256k.hdr): `src/assets/envMap/potsdamer_platz_0.256k.hdr`
- [Color Palette](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/data.js): `src/data.js`
- [Play State](https://github.com/mohaminebrs/codrops-noise-transition/blob/main/src/store.js): `src/store.js`

### Other components

- **Visitor**

## Connections

- React Entry → App Shell: renders (evidence: `src/main.jsx`)
- App Shell → Demo Frame: renders (evidence: `src/App.jsx`)
- App Shell → Scene Canvas: renders (evidence: `src/App.jsx`)
- Scene Canvas → Can Model: renders (evidence: `src/Scene.jsx`)
- Scene Canvas → Radial Background: renders (evidence: `src/Scene.jsx`)
- Scene Canvas → HDR Environment: loads (evidence: `src/Scene.jsx`)
- Can Model → Can Asset: loads (evidence: `src/Model.jsx`)
- Can Model → Noise Functions: uses (evidence: `src/Model.jsx`)
- Radial Background → Background Shader: uses (evidence: `src/Background.jsx`)
- Background Shader → Noise Functions: uses (evidence: `src/BackgroundMaterial.js`)
- Can Model → Color Palette: reads (evidence: `src/Model.jsx`)
- Radial Background → Color Palette: reads (evidence: `src/Background.jsx`)
- Can Model → Play State: reads and updates (evidence: `src/Model.jsx`)
- Radial Background → Play State: reads (evidence: `src/Background.jsx`)
- Visitor → Can Model: clicks to transition (evidence: `src/Model.jsx`)
- Visitor → Radial Background: clicks to recolor (evidence: `src/Background.jsx`)
