# cristian-obreja/calculator architecture

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

- Interactive diagram: https://gitdiagram.com/cristian-obreja/calculator
- Repository: https://github.com/cristian-obreja/calculator

## Overview

This is a small browser calculator. The user enters expressions through the page; `script.js` handles button clicks, clears the display for `C`, evaluates the displayed expression for `=`, and otherwise appends the clicked text. The page and stylesheet are present in the tree, but their contents were not sampled, so their detailed structure and wiring are not shown.

Main entry points: [`index.html`](https://github.com/cristian-obreja/calculator/blob/main/index.html) (Calculator page), [`script.js`](https://github.com/cristian-obreja/calculator/blob/main/script.js) (Click logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_page["Calculator page<br/>[index.html]"]
node_logic["Click logic<br/>[script.js]"]
node_styles["Page styles<br/>[style.css]"]

node_user -.->|"uses"| node_page
node_logic -->|"updates display"| node_page

click node_page "https://github.com/cristian-obreja/calculator/blob/main/index.html"
click node_logic "https://github.com/cristian-obreja/calculator/blob/main/script.js"
click node_styles "https://github.com/cristian-obreja/calculator/blob/main/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_user toneBlue
class node_page,node_logic,node_styles toneTeal
```

## Components

### Other components

- **User**
- [Calculator page](https://github.com/cristian-obreja/calculator/blob/main/index.html): `index.html`
- [Click logic](https://github.com/cristian-obreja/calculator/blob/main/script.js): `script.js`
- [Page styles](https://github.com/cristian-obreja/calculator/blob/main/style.css): `style.css`

## Connections

- User → Calculator page: uses
- Click logic → Calculator page: updates display (evidence: `script.js`)
