# michaelstergiaris/yu-gi-oh_calculator architecture

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

- Interactive diagram: https://gitdiagram.com/michaelstergiaris/yu-gi-oh_calculator
- Repository: https://github.com/michaelstergiaris/yu-gi-oh_calculator

## Overview

This is a small two-player duel life-point tracker. Its JavaScript maintains each duelist’s points and the current numeric input, applies additions, subtractions, or halving, resets both players, updates displayed values, and alerts when a player reaches zero. The source excerpt shows DOM access and browser alerts, but not how the page wires user actions to these functions or how its HTML and CSS are structured.

Main entry points: [`script.js`](https://github.com/michaelstergiaris/yu-gi-oh_calculator/blob/main/script.js) (Life-point logic), [`index.html`](https://github.com/michaelstergiaris/yu-gi-oh_calculator/blob/main/index.html) (Page UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_player(("Duelist"))
node_page["Page UI<br/>[index.html]"]
node_controller["Life-point logic<br/>[script.js]"]
node_browser["Browser alerts"]

node_player -.->|"uses controls"| node_controller
node_controller -->|"updates displays"| node_page
node_controller -->|"shows loss alert"| node_browser

click node_page "https://github.com/michaelstergiaris/yu-gi-oh_calculator/blob/main/index.html"
click node_controller "https://github.com/michaelstergiaris/yu-gi-oh_calculator/blob/main/script.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_player toneIndigo
class node_page,node_browser toneBlue
class node_controller toneTeal
```

## Components

### Other components

- **Duelist**
- [Page UI](https://github.com/michaelstergiaris/yu-gi-oh_calculator/blob/main/index.html): `index.html`
- [Life-point logic](https://github.com/michaelstergiaris/yu-gi-oh_calculator/blob/main/script.js): `script.js`
- **Browser alerts**

## Connections

- Duelist → Life-point logic: uses controls
- Life-point logic → Page UI: updates displays (evidence: `script.js`)
- Life-point logic → Browser alerts: shows loss alert (evidence: `script.js`)
