# rino237gk/penghitung-kalori architecture

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

- Interactive diagram: https://gitdiagram.com/rino237gk/penghitung-kalori
- Repository: https://github.com/rino237gk/penghitung-kalori

## Overview

This is a small browser-based calorie calculator. A visitor enters age, weight, height, gender, and activity level; the form handler validates the values, estimates daily calories, and displays the rounded result. A separate interaction toggles dark mode and persists the preference in browser storage. The source excerpt shows these behaviors and references the page’s DOM elements; the HTML and CSS themselves were not provided, so their detailed structure and styling cannot be verified.

Main entry points: [`script.js`](https://github.com/rino237gk/penghitung-kalori/blob/main/script.js) (Theme control), [`index.html`](https://github.com/rino237gk/penghitung-kalori/blob/main/index.html) (Calculator page), [`styles.css`](https://github.com/rino237gk/penghitung-kalori/blob/main/styles.css) (Theme styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_calculation["Calorie calculation"]
  node_page["Calculator page<br/>[index.html]"]
  node_form_handler["Form handler<br/>[script.js]"]
  node_result_display["Result display<br/>[index.html]"]
end

subgraph group_appearance["Theme and display"]
  node_theme_control["Theme control<br/>[script.js]"]
  node_theme_styles["Theme styles<br/>[styles.css]"]
  node_browser_storage[("Local storage")]
end

node_visitor(("Visitor"))

node_visitor -->|"enters values"| node_page
node_page -->|"submits to"| node_form_handler
node_form_handler -->|"updates result"| node_result_display
node_visitor -->|"toggles theme"| node_theme_control
node_theme_control -->|"reads and writes"| node_browser_storage
node_theme_control -->|"toggles classes"| node_theme_styles

click node_page "https://github.com/rino237gk/penghitung-kalori/blob/main/index.html"
click node_form_handler "https://github.com/rino237gk/penghitung-kalori/blob/main/script.js"
click node_result_display "https://github.com/rino237gk/penghitung-kalori/blob/main/index.html"
click node_theme_control "https://github.com/rino237gk/penghitung-kalori/blob/main/script.js"
click node_theme_styles "https://github.com/rino237gk/penghitung-kalori/blob/main/styles.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_page,node_form_handler,node_result_display toneBlue
class node_theme_control,node_theme_styles,node_browser_storage toneAmber
class node_visitor toneIndigo
```

## Components

### Calorie calculation

- [Calculator page](https://github.com/rino237gk/penghitung-kalori/blob/main/index.html): `index.html`
- [Form handler](https://github.com/rino237gk/penghitung-kalori/blob/main/script.js): `script.js`
- [Result display](https://github.com/rino237gk/penghitung-kalori/blob/main/index.html): `index.html`

### Theme and display

- [Theme control](https://github.com/rino237gk/penghitung-kalori/blob/main/script.js): `script.js`
- [Theme styles](https://github.com/rino237gk/penghitung-kalori/blob/main/styles.css): `styles.css`
- **Local storage**

### Other components

- **Visitor**

## Connections

- Visitor → Calculator page: enters values
- Calculator page → Form handler: submits to (evidence: `script.js`)
- Form handler → Result display: updates result (evidence: `script.js`)
- Visitor → Theme control: toggles theme (evidence: `script.js`)
- Theme control → Local storage: reads and writes (evidence: `script.js`)
- Theme control → Theme styles: toggles classes (evidence: `script.js`)
