# capt-hm/donagic architecture

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

- Interactive diagram: https://gitdiagram.com/capt-hm/donagic
- Repository: https://github.com/capt-hm/donagic

## Overview

This is a browser-based interactive character/domain showcase: users choose a character and see its domain represented by a large animated particle field. The sampled `src/main.js` combines the character data, interface setup, particle generation, WebGL rendering, and post-processing rather than separating them into modules. The excerpts show asset loading and rendering setup, but omit the full selection handler and animation flow, so those links are not inferred. The README is empty; `src/counter.js` is not part of the evidenced product workflow.

Main entry points: [`src/main.js`](https://github.com/capt-hm/donagic/blob/main/src/main.js) (Character picker), [`public/assets`](https://github.com/capt-hm/donagic/tree/main/public/assets) (Character images), [`src/style.css`](https://github.com/capt-hm/donagic/blob/main/src/style.css) (Interface styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Character experience"]
  node_character_catalog["Character catalog<br/>[main.js]"]
  node_character_picker["Character picker<br/>[main.js]"]
  node_domain_display["Domain information<br/>[main.js]"]
  node_styles["Interface styles<br/>[style.css]"]
end

subgraph group_graphics["Particle graphics"]
  node_domain_shape["Domain shape mapping<br/>[main.js]"]
  node_image_assets["Character images"]
  node_particle_system["Particle system<br/>[main.js]"]
  node_webgl_pass["WebGL particle pass<br/>[main.js]"]
  node_postprocess_pass["Post-processing pass<br/>[main.js]"]
end

node_visitor(("Visitor"))

node_character_catalog -->|"populates"| node_character_picker
node_character_catalog -->|"defines colors"| node_domain_shape
node_character_catalog -->|"names image paths"| node_image_assets
node_particle_system -->|"loads images"| node_image_assets
node_particle_system -->|"sets particle targets"| node_domain_shape
node_particle_system -->|"draws particles"| node_webgl_pass
node_webgl_pass -->|"supplies framebuffer"| node_postprocess_pass
node_character_picker -.->|"updates selection"| node_domain_display
node_visitor -.->|"chooses character"| node_character_picker
node_styles -.->|"styles interface"| node_character_picker

click node_character_catalog "https://github.com/capt-hm/donagic/blob/main/src/main.js"
click node_character_picker "https://github.com/capt-hm/donagic/blob/main/src/main.js"
click node_domain_display "https://github.com/capt-hm/donagic/blob/main/src/main.js"
click node_domain_shape "https://github.com/capt-hm/donagic/blob/main/src/main.js"
click node_image_assets "https://github.com/capt-hm/donagic/tree/main/public/assets"
click node_particle_system "https://github.com/capt-hm/donagic/blob/main/src/main.js"
click node_webgl_pass "https://github.com/capt-hm/donagic/blob/main/src/main.js"
click node_postprocess_pass "https://github.com/capt-hm/donagic/blob/main/src/main.js"
click node_styles "https://github.com/capt-hm/donagic/blob/main/src/style.css"

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_character_catalog,node_character_picker,node_domain_display,node_styles toneBlue
class node_domain_shape,node_image_assets,node_particle_system,node_webgl_pass,node_postprocess_pass toneAmber
class node_visitor toneIndigo
```

## Components

### Character experience

- [Character catalog](https://github.com/capt-hm/donagic/blob/main/src/main.js): `src/main.js`
- [Character picker](https://github.com/capt-hm/donagic/blob/main/src/main.js): `src/main.js`
- [Domain information](https://github.com/capt-hm/donagic/blob/main/src/main.js): `src/main.js`
- [Interface styles](https://github.com/capt-hm/donagic/blob/main/src/style.css): `src/style.css`

### Particle graphics

- [Domain shape mapping](https://github.com/capt-hm/donagic/blob/main/src/main.js): `src/main.js`
- [Character images](https://github.com/capt-hm/donagic/tree/main/public/assets): `public/assets`
- [Particle system](https://github.com/capt-hm/donagic/blob/main/src/main.js): `src/main.js`
- [WebGL particle pass](https://github.com/capt-hm/donagic/blob/main/src/main.js): `src/main.js`
- [Post-processing pass](https://github.com/capt-hm/donagic/blob/main/src/main.js): `src/main.js`

### Other components

- **Visitor**

## Connections

- Character catalog → Character picker: populates (evidence: `src/main.js`)
- Character catalog → Domain shape mapping: defines colors (evidence: `src/main.js`)
- Character catalog → Character images: names image paths (evidence: `src/main.js`)
- Particle system → Character images: loads images (evidence: `src/main.js`)
- Particle system → Domain shape mapping: sets particle targets (evidence: `src/main.js`)
- Particle system → WebGL particle pass: draws particles (evidence: `src/main.js`)
- WebGL particle pass → Post-processing pass: supplies framebuffer (evidence: `src/main.js`)
- Character picker → Domain information: updates selection (evidence: `src/main.js`)
- Visitor → Character picker: chooses character
- Interface styles → Character picker: styles interface (evidence: `src/main.js`)
