# tohaveadream/softlab architecture

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

- Interactive diagram: https://gitdiagram.com/tohaveadream/softlab
- Repository: https://github.com/tohaveadream/softlab

## Overview

SOFT LAB is a static collection of playable visual experiments and button interactions, presented through a hash-routed site. Visitors browse sections, open an experiment or button showcase, and manipulate live canvas/WebGL/CSS effects; other branches cover the destroy-game entry point, growth notes, and version history. The graph follows documented capabilities and visible imports/calls. Some unsampled panels and experiment internals are represented by their exact source files, with links omitted where implementation evidence is unavailable.

Main entry points: [`src/home/Home.tsx`](https://github.com/tohaveadream/softlab/blob/main/src/home/Home.tsx) (Home deck), [`src/experiments/registry.ts`](https://github.com/tohaveadream/softlab/blob/main/src/experiments/registry.ts) (Experiment catalogue), [`src/App.tsx`](https://github.com/tohaveadream/softlab/blob/main/src/App.tsx) (Route app), [`src/experiments/cloud-train/CloudTrain.tsx`](https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/CloudTrain.tsx) (Cloud Train)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Site shell"]
  node_app["Route app<br/>[App.tsx]"]
  node_home["Home deck<br/>[Home.tsx]"]
  node_tabs["Tab deck<br/>[TabDeck.tsx]"]
  node_header["Site header<br/>[SiteHeader.tsx]"]
  node_footer["Site footer<br/>[SiteFooter.tsx]"]
  node_hero["Hero visuals<br/>[HeroField.tsx]"]
  node_orb["Hero orb<br/>[HeroOrb.tsx]"]
end

subgraph group_catalog["Collection and history"]
  node_sectiondata["Section catalogue<br/>[sections.ts]"]
  node_explist["Experiment catalogue<br/>[registry.ts]"]
  node_buttonlist["Button catalogue<br/>[registry.ts]"]
  node_panels["Section panels"]
  node_growth["Growth notes<br/>[GrowthPanel.tsx]"]
  node_destroy["Destroy entry<br/>[DestroyPanel.tsx]"]
  node_devlog["Version history<br/>[DevLogPanel.tsx]"]
  node_changelog["Changelog data<br/>[changelog.ts]"]
end

subgraph group_experiments["Playable experiments"]
  node_softmatter["Soft Matter<br/>[SoftMatter.tsx]"]
  node_softengine["Soft-body renderer<br/>[engine.ts]"]
  node_canvaslab["Canvas Lab<br/>[CanvasLab.tsx]"]
  node_canvasfx["Canvas effects"]
  node_splitchars["Split characters<br/>[SplitChars.tsx]"]
  node_cloudtrain["Cloud Train<br/>[CloudTrain.tsx]"]
  node_cloudengine["Cloud renderer<br/>[engine.ts]"]
  node_palettes["Cloud palettes<br/>[palettes.ts]"]
  node_cloudexport["HTML export<br/>[exportHtml.ts]"]
  node_softcat["Soft Cat WIP<br/>[CatLab.tsx]"]
  node_catmodel["Cat model<br/>[cat.ts]"]
  node_metaball["Metaball helper<br/>[metaball.ts]"]
end

subgraph group_buttons["Button interactions"]
  node_buttonpage["Button showcase<br/>[ButtonPage.tsx]"]
  node_motionbutton["Motion button<br/>[MotionButton.tsx]"]
  node_water["Liquid effect<br/>[water.ts]"]
  node_motionjs["Button motion runtime<br/>[motion.buttons.js]"]
end

subgraph group_shared["Shared runtime"]
  node_tokens["Motion tokens<br/>[tokens.ts]"]
end

node_visitor(("Visitor"))
node_game["External game"]

node_visitor -->|"opens site"| node_app
node_app -->|"renders home"| node_home
node_app -->|"resolves experiment"| node_explist
node_app -->|"resolves button"| node_buttonlist
node_app -->|"renders header"| node_header
node_app -->|"renders footer"| node_footer
node_home -->|"renders tabs"| node_tabs
node_home -->|"renders field"| node_hero
node_home -->|"renders orb"| node_orb
node_home -->|"renders panels"| node_panels
node_home -->|"renders panel"| node_growth
node_home -->|"renders panel"| node_destroy
node_home -->|"renders panel"| node_devlog
node_sectiondata -->|"reads catalogue"| node_explist
node_sectiondata -->|"reads catalogue"| node_buttonlist
node_sectiondata -->|"counts entries"| node_changelog
node_devlog -->|"shows history"| node_changelog
node_destroy -->|"links to game"| node_game
node_panels -->|"lists experiments"| node_explist
node_panels -->|"lists buttons"| node_buttonlist
node_explist -->|"loads experiment"| node_softmatter
node_explist -->|"loads experiment"| node_canvaslab
node_explist -->|"loads experiment"| node_cloudtrain
node_explist -->|"loads WIP"| node_softcat
node_softmatter -->|"drives renderer"| node_softengine
node_canvaslab -->|"selects effects"| node_canvasfx
node_canvaslab -->|"renders text"| node_splitchars
node_cloudtrain -->|"drives renderer"| node_cloudengine
node_cloudtrain -->|"uses palettes"| node_palettes
node_cloudtrain -->|"exports scene"| node_cloudexport
node_softcat -.->|"uses model"| node_catmodel
node_catmodel -->|"uses helper"| node_metaball
node_buttonpage -->|"reads entries"| node_buttonlist
node_buttonpage -->|"renders buttons"| node_motionbutton
node_motionbutton -->|"creates liquid"| node_water
node_motionbutton -->|"reads duration"| node_tokens

click node_app "https://github.com/tohaveadream/softlab/blob/main/src/App.tsx"
click node_home "https://github.com/tohaveadream/softlab/blob/main/src/home/Home.tsx"
click node_tabs "https://github.com/tohaveadream/softlab/blob/main/src/home/TabDeck.tsx"
click node_header "https://github.com/tohaveadream/softlab/blob/main/src/shell/SiteHeader.tsx"
click node_footer "https://github.com/tohaveadream/softlab/blob/main/src/shell/SiteFooter.tsx"
click node_hero "https://github.com/tohaveadream/softlab/blob/main/src/shell/HeroField.tsx"
click node_orb "https://github.com/tohaveadream/softlab/blob/main/src/shell/HeroOrb.tsx"
click node_sectiondata "https://github.com/tohaveadream/softlab/blob/main/src/lib/sections.ts"
click node_explist "https://github.com/tohaveadream/softlab/blob/main/src/experiments/registry.ts"
click node_buttonlist "https://github.com/tohaveadream/softlab/blob/main/src/buttons/registry.ts"
click node_panels "https://github.com/tohaveadream/softlab/blob/main/src/home/ExperimentsPanel.tsx"
click node_growth "https://github.com/tohaveadream/softlab/blob/main/src/home/GrowthPanel.tsx"
click node_destroy "https://github.com/tohaveadream/softlab/blob/main/src/home/DestroyPanel.tsx"
click node_devlog "https://github.com/tohaveadream/softlab/blob/main/src/home/DevLogPanel.tsx"
click node_changelog "https://github.com/tohaveadream/softlab/blob/main/src/lib/changelog.ts"
click node_softmatter "https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-matter/SoftMatter.tsx"
click node_softengine "https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-matter/engine.ts"
click node_canvaslab "https://github.com/tohaveadream/softlab/blob/main/src/experiments/canvas-lab/CanvasLab.tsx"
click node_canvasfx "https://github.com/tohaveadream/softlab/tree/main/src/experiments/canvas-lab/effects"
click node_splitchars "https://github.com/tohaveadream/softlab/blob/main/src/experiments/canvas-lab/SplitChars.tsx"
click node_cloudtrain "https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/CloudTrain.tsx"
click node_cloudengine "https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/engine.ts"
click node_palettes "https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/palettes.ts"
click node_cloudexport "https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/exportHtml.ts"
click node_softcat "https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-cat/CatLab.tsx"
click node_catmodel "https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-cat/cat.ts"
click node_metaball "https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-cat/metaball.ts"
click node_buttonpage "https://github.com/tohaveadream/softlab/blob/main/src/home/ButtonPage.tsx"
click node_motionbutton "https://github.com/tohaveadream/softlab/blob/main/src/buttons/MotionButton.tsx"
click node_water "https://github.com/tohaveadream/softlab/blob/main/src/buttons/water.ts"
click node_motionjs "https://github.com/tohaveadream/softlab/blob/main/src/motion/motion.buttons.js"
click node_tokens "https://github.com/tohaveadream/softlab/blob/main/src/motion/tokens.ts"

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_home,node_tabs,node_header,node_footer,node_hero,node_orb toneBlue
class node_sectiondata,node_explist,node_buttonlist,node_panels,node_growth,node_destroy,node_devlog,node_changelog toneAmber
class node_softmatter,node_softengine,node_canvaslab,node_canvasfx,node_splitchars,node_cloudtrain,node_cloudengine,node_palettes,node_cloudexport,node_softcat,node_catmodel,node_metaball toneMint
class node_buttonpage,node_motionbutton,node_water,node_motionjs toneRose
class node_tokens,node_visitor,node_game toneIndigo
```

## Components

### Site shell

- [Route app](https://github.com/tohaveadream/softlab/blob/main/src/App.tsx): `src/App.tsx`
- [Home deck](https://github.com/tohaveadream/softlab/blob/main/src/home/Home.tsx): `src/home/Home.tsx`
- [Tab deck](https://github.com/tohaveadream/softlab/blob/main/src/home/TabDeck.tsx): `src/home/TabDeck.tsx`
- [Site header](https://github.com/tohaveadream/softlab/blob/main/src/shell/SiteHeader.tsx): `src/shell/SiteHeader.tsx`
- [Site footer](https://github.com/tohaveadream/softlab/blob/main/src/shell/SiteFooter.tsx): `src/shell/SiteFooter.tsx`
- [Hero visuals](https://github.com/tohaveadream/softlab/blob/main/src/shell/HeroField.tsx): `src/shell/HeroField.tsx`
- [Hero orb](https://github.com/tohaveadream/softlab/blob/main/src/shell/HeroOrb.tsx): `src/shell/HeroOrb.tsx`

### Collection and history

- [Section catalogue](https://github.com/tohaveadream/softlab/blob/main/src/lib/sections.ts): `src/lib/sections.ts`
- [Experiment catalogue](https://github.com/tohaveadream/softlab/blob/main/src/experiments/registry.ts): `src/experiments/registry.ts`
- [Button catalogue](https://github.com/tohaveadream/softlab/blob/main/src/buttons/registry.ts): `src/buttons/registry.ts`
- [Section panels](https://github.com/tohaveadream/softlab/blob/main/src/home/ExperimentsPanel.tsx): `src/home/ExperimentsPanel.tsx`
- [Growth notes](https://github.com/tohaveadream/softlab/blob/main/src/home/GrowthPanel.tsx): `src/home/GrowthPanel.tsx`
- [Destroy entry](https://github.com/tohaveadream/softlab/blob/main/src/home/DestroyPanel.tsx): `src/home/DestroyPanel.tsx`
- [Version history](https://github.com/tohaveadream/softlab/blob/main/src/home/DevLogPanel.tsx): `src/home/DevLogPanel.tsx`
- [Changelog data](https://github.com/tohaveadream/softlab/blob/main/src/lib/changelog.ts): `src/lib/changelog.ts`

### Playable experiments

- [Soft Matter](https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-matter/SoftMatter.tsx): `src/experiments/soft-matter/SoftMatter.tsx`
- [Soft-body renderer](https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-matter/engine.ts): `src/experiments/soft-matter/engine.ts`
- [Canvas Lab](https://github.com/tohaveadream/softlab/blob/main/src/experiments/canvas-lab/CanvasLab.tsx): `src/experiments/canvas-lab/CanvasLab.tsx`
- [Canvas effects](https://github.com/tohaveadream/softlab/tree/main/src/experiments/canvas-lab/effects): `src/experiments/canvas-lab/effects`
- [Split characters](https://github.com/tohaveadream/softlab/blob/main/src/experiments/canvas-lab/SplitChars.tsx): `src/experiments/canvas-lab/SplitChars.tsx`
- [Cloud Train](https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/CloudTrain.tsx): `src/experiments/cloud-train/CloudTrain.tsx`
- [Cloud renderer](https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/engine.ts): `src/experiments/cloud-train/engine.ts`
- [Cloud palettes](https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/palettes.ts): `src/experiments/cloud-train/palettes.ts`
- [HTML export](https://github.com/tohaveadream/softlab/blob/main/src/experiments/cloud-train/exportHtml.ts): `src/experiments/cloud-train/exportHtml.ts`
- [Soft Cat WIP](https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-cat/CatLab.tsx): `src/experiments/soft-cat/CatLab.tsx`
- [Cat model](https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-cat/cat.ts): `src/experiments/soft-cat/cat.ts`
- [Metaball helper](https://github.com/tohaveadream/softlab/blob/main/src/experiments/soft-cat/metaball.ts): `src/experiments/soft-cat/metaball.ts`

### Button interactions

- [Button showcase](https://github.com/tohaveadream/softlab/blob/main/src/home/ButtonPage.tsx): `src/home/ButtonPage.tsx`
- [Motion button](https://github.com/tohaveadream/softlab/blob/main/src/buttons/MotionButton.tsx): `src/buttons/MotionButton.tsx`
- [Liquid effect](https://github.com/tohaveadream/softlab/blob/main/src/buttons/water.ts): `src/buttons/water.ts`
- [Button motion runtime](https://github.com/tohaveadream/softlab/blob/main/src/motion/motion.buttons.js): `src/motion/motion.buttons.js`

### Shared runtime

- [Motion tokens](https://github.com/tohaveadream/softlab/blob/main/src/motion/tokens.ts): `src/motion/tokens.ts`

### Other components

- **Visitor**
- **External game**

## Connections

- Visitor → Route app: opens site (evidence: `src/App.tsx`)
- Route app → Home deck: renders home (evidence: `src/App.tsx`)
- Route app → Experiment catalogue: resolves experiment (evidence: `src/App.tsx`)
- Route app → Button catalogue: resolves button (evidence: `src/App.tsx`)
- Route app → Site header: renders header (evidence: `src/App.tsx`)
- Route app → Site footer: renders footer (evidence: `src/App.tsx`)
- Home deck → Tab deck: renders tabs (evidence: `src/home/Home.tsx`)
- Home deck → Hero visuals: renders field (evidence: `src/home/Home.tsx`)
- Home deck → Hero orb: renders orb (evidence: `src/home/Home.tsx`)
- Home deck → Section panels: renders panels (evidence: `src/home/Home.tsx`)
- Home deck → Growth notes: renders panel (evidence: `src/home/Home.tsx`)
- Home deck → Destroy entry: renders panel (evidence: `src/home/Home.tsx`)
- Home deck → Version history: renders panel (evidence: `src/home/Home.tsx`)
- Section catalogue → Experiment catalogue: reads catalogue (evidence: `src/lib/sections.ts`)
- Section catalogue → Button catalogue: reads catalogue (evidence: `src/lib/sections.ts`)
- Section catalogue → Changelog data: counts entries (evidence: `src/lib/sections.ts`)
- Version history → Changelog data: shows history (evidence: `README.md`)
- Destroy entry → External game: links to game (evidence: `README.md`)
- Section panels → Experiment catalogue: lists experiments (evidence: `src/home/Home.tsx`)
- Section panels → Button catalogue: lists buttons (evidence: `src/home/Home.tsx`)
- Experiment catalogue → Soft Matter: loads experiment (evidence: `src/experiments/registry.ts`)
- Experiment catalogue → Canvas Lab: loads experiment (evidence: `src/experiments/registry.ts`)
- Experiment catalogue → Cloud Train: loads experiment (evidence: `src/experiments/registry.ts`)
- Experiment catalogue → Soft Cat WIP: loads WIP (evidence: `src/experiments/registry.ts`)
- Soft Matter → Soft-body renderer: drives renderer (evidence: `src/experiments/soft-matter/SoftMatter.tsx`)
- Canvas Lab → Canvas effects: selects effects (evidence: `src/experiments/canvas-lab/CanvasLab.tsx`)
- Canvas Lab → Split characters: renders text (evidence: `src/experiments/canvas-lab/CanvasLab.tsx`)
- Cloud Train → Cloud renderer: drives renderer (evidence: `src/experiments/cloud-train/CloudTrain.tsx`)
- Cloud Train → Cloud palettes: uses palettes (evidence: `src/experiments/cloud-train/CloudTrain.tsx`)
- Cloud Train → HTML export: exports scene (evidence: `src/experiments/cloud-train/CloudTrain.tsx`)
- Soft Cat WIP → Cat model: uses model
- Cat model → Metaball helper: uses helper (evidence: `src/experiments/soft-cat/cat.ts`)
- Button showcase → Button catalogue: reads entries (evidence: `src/home/ButtonPage.tsx`)
- Button showcase → Motion button: renders buttons (evidence: `src/home/ButtonPage.tsx`)
- Motion button → Liquid effect: creates liquid (evidence: `src/buttons/MotionButton.tsx`)
- Motion button → Motion tokens: reads duration (evidence: `src/buttons/MotionButton.tsx`)
