# chathamhung/thebuttongame2 architecture

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

- Interactive diagram: https://gitdiagram.com/chathamhung/thebuttongame2
- Repository: https://github.com/chathamhung/thebuttongame2

## Overview

##### Project type and purpose
- This is a static, front-end-only web game (“The Button Game 2”) consisting of HTML, CSS, and JavaScript files, plus a set of prebuilt level pages and image assets.
- Purpose: deliver 20 interactive puzzle levels in the browser, hosted via GitHub Pages or any static-file server.

##### File structure
- Top-level files:
- index.html – entry point
- globalScript.js & script.js – game-wide logic and per-level scripts
- globalStyle.css & style.css – base styles and component-specific styling
- levels/ – 20+ HTML files, one per level (0.html…21.html, + examples)
- res/imgs/Captcha – image assets used for certain levels
- No backend, database, or build pipeline: pure static site.
- README and LICENSE live at root; no config files (no Webpack, no package.json).

## Diagram (Mermaid)

```mermaid
flowchart TD
    UserBrowser{"User/Browser"}:::browser
    HostingService(("Static Hosting Service")):::hosting

    subgraph "UI Layer"
        index["index.html"]:::ui
        levels["levels/"]:::ui
    end

    subgraph "Presentation Layer"
        globalStyle["globalStyle.css"]:::css
        styleCSS["style.css"]:::css
    end

    subgraph "Logic Layer"
        globalScript["globalScript.js"]:::js
        scriptJS["script.js"]:::js
    end

    subgraph "Static Asset Store"
        levelsDir["levels/"]:::asset
        imagesDir["res/imgs/Captcha/"]:::asset
    end

    HostingService -->|"serves HTML files"| UserBrowser
    HostingService -->|"serves CSS files"| UserBrowser
    HostingService -->|"serves JS files"| UserBrowser
    HostingService -->|"serves Images"| UserBrowser

    UserBrowser -->|"click event"| globalScript
    UserBrowser -->|"click event"| scriptJS
    globalScript -->|"DOM updates/navigation"| UserBrowser
    scriptJS -->|"DOM updates/navigation"| UserBrowser

    UserBrowser -->|"GET level page"| levelsDir
    UserBrowser -->|"GET image asset"| imagesDir

    click index "https://github.com/chathamhung/thebuttongame2/blob/main/index.html"
    click levels "https://github.com/chathamhung/thebuttongame2/tree/main/levels/"
    click globalStyle "https://github.com/chathamhung/thebuttongame2/blob/main/globalStyle.css"
    click styleCSS "https://github.com/chathamhung/thebuttongame2/blob/main/style.css"
    click globalScript "https://github.com/chathamhung/thebuttongame2/blob/main/globalScript.js"
    click scriptJS "https://github.com/chathamhung/thebuttongame2/blob/main/script.js"
    click levelsDir "https://github.com/chathamhung/thebuttongame2/tree/main/levels/"
    click imagesDir "https://github.com/chathamhung/thebuttongame2/tree/main/res/imgs/Captcha/"

    classDef ui fill:#ADD8E6,stroke:#000;
    classDef css fill:#ADD8E6,stroke:#000;
    classDef js fill:#ADD8E6,stroke:#000;
    classDef asset fill:#ADD8E6,stroke:#000;
    classDef hosting fill:#90EE90,stroke:#000;
    classDef browser fill:#FFFF00,stroke:#000;
```
