# kel-hendros/v20-character-sheets architecture

> Architecture diagram of the GitHub repository kel-hendros/v20-character-sheets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kel-hendros/v20-character-sheets
- Repository: https://github.com/kel-hendros/v20-character-sheets

## Overview

##### Project type and purpose
- This is a single-page, front-end–only web application: a static Vampire V20 RPG character sheet.
- There is no backend or database—everything runs in the browser.

##### File structure
- index.html: the root HTML document that lays out the sheet.
- style light.css and style dark.css: two theme files for light/dark mode styling.
- script.js: application logic (e.g., handling user input, toggling themes, calculating derived stats).
- fonts/ and images/: static asset directories supporting UI presentation.
- README.md: describes purpose and provenance (CodePen pen).

##### Extract insights from the README
- Confirms this is a CodePen export for a character sheet UI.
- No server, no external APIs—just client-side rendering and interactivity.

a. Main components
- Browser UI Container
– HTML Renderer (index.html)
– CSS Engine (style light.css + style dark.css)
– JavaScript Engine (script.js)
- Static Asset Store
– fonts/
– images/
b. Relationships & interactions
- Browser loads index.html → pulls in CSS and JS.
- JS attaches event handlers to HTML elements (e.g., input fields, buttons).
- User actions (e.g., changing a stat) → JS updates the DOM → CSS reflows styling.
- Theme toggle → JS switches between light.css and dark.css.
- Fonts/images referenced by HTML/CSS are fetched from their directories.
c. Architectural patterns & design principles
- Separation of concerns: HTML for structure, CSS for appearance, JS for behavior.
- Asset modularity: fonts/ and images/ are isolated.
- Theme‐switching strategy: dynamic stylesheet swapping.
d. Relevant technologies
- HTML5
- CSS3 (two theme files)
- Vanilla JavaScript (ES6+)
- Browser environment (no frameworks)

##### Additional guidance
- Don’t add imaginary backend or database elements—keep it faithful to the static, in-browser architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Structure Layer
    subgraph "Structure Layer"
        HTML["HTML Renderer<br>(index.html)"]
    end

    %% Styling Layer
    subgraph "Styling Layer"
        CSSLight["Light Theme CSS<br>(style light.css)"]
        CSSDark["Dark Theme CSS<br>(style dark.css)"]
    end

    %% Behavior Layer
    subgraph "Behavior Layer"
        JS["JavaScript Engine<br>(script.js)"]
    end

    %% Static Resources
    subgraph "Static Resources"
        Fonts["Fonts<br>(fonts/)"]
        Images["Images<br>(images/)"]
    end

    %% Documentation
    subgraph "Documentation"
        README["Project Documentation<br>(README.md)"]
    end

    %% Load-time relationships
    HTML -->|"loads CSS"| CSSLight
    HTML -->|"loads CSS"| CSSDark
    HTML -->|"loads JS"| JS
    HTML -->|"fetch assets"| Fonts
    HTML -->|"fetch assets"| Images

    %% Runtime interactions
    JS -->|"event handlers & DOM updates"| HTML
    JS -->|"theme swap"| CSSLight
    JS -->|"theme swap"| CSSDark

    %% CSS asset references
    CSSLight -->|"uses"| Fonts
    CSSLight -->|"uses"| Images
    CSSDark -->|"uses"| Fonts
    CSSDark -->|"uses"| Images

    %% Documentation linkage
    README --- HTML

    %% Click Events
    click HTML "https://github.com/kel-hendros/v20-character-sheets/blob/main/index.html"
    click CSSLight "https://github.com/kel-hendros/v20-character-sheets/blob/main/style light.css"
    click CSSDark "https://github.com/kel-hendros/v20-character-sheets/blob/main/style dark.css"
    click JS "https://github.com/kel-hendros/v20-character-sheets/blob/main/script.js"
    click Fonts "https://github.com/kel-hendros/v20-character-sheets/tree/main/fonts/"
    click Images "https://github.com/kel-hendros/v20-character-sheets/tree/main/images/"
    click README "https://github.com/kel-hendros/v20-character-sheets/blob/main/README.md"

    %% Styles
    classDef structure fill:#eeeeee,stroke:#888888,color:#333333
    classDef light fill:#ddeeff,stroke:#6688aa,color:#000000
    classDef dark fill:#ccddff,stroke:#5577aa,color:#000000
    classDef logic fill:#ddffdd,stroke:#88aa88,color:#000000
    classDef static fill:#ddeeff,stroke:#8899bb,color:#000000
    classDef doc fill:#fff4cc,stroke:#d4b000,color:#000000

    class HTML structure
    class CSSLight light
    class CSSDark dark
    class JS logic
    class Fonts,Images static
    class README doc
```
