# cooldude2349/offline-html-games-pack architecture

> Architecture diagram of the GitHub repository cooldude2349/offline-html-games-pack, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cooldude2349/offline-html-games-pack
- Repository: https://github.com/cooldude2349/offline-html-games-pack

## Overview

#### Purpose and distribution model
This is a static archive of 300+ self-contained browser games, intended to run without a network connection or under restricted browsing conditions. There is no application server, build system, package manifest, or shared runtime visible; each game is distributed as a standalone HTML artifact under `offline/`.

#### Primary game runtime
The game catalog is the system’s core boundary: opening an individual file loads that game directly in a browser, including its embedded HTML, JavaScript, CSS, and likely inlined assets. Representative entries: `offline/2048.html`, `offline/amongus.html`, `offline/vex8.htm`. Games are intentionally isolated rather than integrated through a common launcher or API.

#### Direct entry points
Users normally open a selected game file from `offline/`, locally via `file://` after downloading/extracting the repository. `epicviewer.htm` appears to be a separate viewer entry point. Because files use both `.html` and `.htm`, catalog consumers must not assume one extension.

#### Browser-constrained import paths
Two standalone browser utilities support environments where direct local-file opening is blocked or inconvenient:
- `file-input.html` provides local user-file selection/import as an alternative launch boundary.
- `single-file.html` is a compact loader intended for pasting into online editors, fetching a game from the web, or importing user-supplied HTML.

These are client-side browser entry points; the user’s local file selection and browser security model are important operational boundaries.

#### Inlining and portability pipeline
The repository includes utilities for converting external-resource HTML into portable single-file documents. `inline-tools/full_inliner.html`, `inline-tools/compressed.html`, and `inline-tools/convertfilestodatauris.py` represent the inlining/conversion stage. Supporting JavaScript such as `inline-tools/dataURI.js` and `inline-tools/rewriteurl2.js` indicates handling for asset-to-data-URI conversion and URL rewriting.

Flow: source HTML/resources → inliner or Python converter → embedded/data-URI HTML → `offline/<game>.html` artifact. The resulting size increase is the stated tradeoff for offline independence.

#### Alternative embedding/integration methods
The `methods/` directory contains environment-specific approaches for running or embedding content in external educational/code-hosting contexts, rather than being part of the offline game runtime. Paths include `methods/code-org.html`, `methods/codehs.html`, and `methods/canvas.md`.

#### External dependencies and infrastructure
Runtime infrastructure is primarily the user’s browser and local filesystem; the game files are designed to avoid required network services. Optional external services are distribution and fallback channels: GitHub repository/issues, online code editors, Google Drive, and Dropbox. Game suggestions enter through GitHub’s issue-template workflow at `.github/ISSUE_TEMPLATE/game_request.md`.

Main entry points: [`file-input.html`](https://github.com/cooldude2349/offline-html-games-pack/blob/master/file-input.html) (File import launcher), [`single-file.html`](https://github.com/cooldude2349/offline-html-games-pack/blob/master/single-file.html) (Single-file loader), [`offline/2048.html`](https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/2048.html) (2048 game), [`offline/amongus.html`](https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/amongus.html) (Among Us game)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Browser entry points"]
  node_epic_viewer["Epic viewer<br/>viewer entry point<br/>[epicviewer.htm]"]
  node_file_input["File import launcher<br/>browser utility<br/>[file-input.html]"]
  node_single_file["Single-file loader<br/>browser utility<br/>[single-file.html]"]
end

subgraph group_catalog["Offline game catalog"]
  node_game2048["2048 game<br/>standalone game<br/>[2048.html]"]
  node_game_amongus["Among Us game<br/>standalone game<br/>[amongus.html]"]
  node_game_vex8["Vex 8 game<br/>standalone game<br/>[vex8.htm]"]
  node_game_catalog[("300+ isolated games<br/>artifact collection")]
end

subgraph group_pipeline["Portability pipeline"]
  node_full_inliner["Full inliner<br/>browser converter<br/>[full_inliner.html]"]
  node_compressed_inliner["Compressed inliner<br/>browser converter<br/>[compressed.html]"]
  node_python_converter["Data-URI converter<br/>Python converter"]
  node_rewrite_support["URI and URL rewriting<br/>conversion support<br/>[dataURI.js]"]
end

subgraph group_integration["External integration methods"]
  node_integration_methods["Embedding methods<br/>integration examples"]
end

node_browser(("User browser<br/>runtime"))
node_filesystem[("Local filesystem<br/>storage")]
node_game_request["Game request template<br/>GitHub issue template<br/>[game_request.md]"]
node_external_channels{{"External distribution channels<br/>optional services"}}

node_filesystem -->|"contains/opened from"| node_game_catalog
node_game_catalog -->|"includes"| node_game2048
node_game_catalog -->|"includes"| node_game_amongus
node_game_catalog -->|"includes"| node_game_vex8
node_game2048 -->|"runs directly"| node_browser
node_game_amongus -->|"runs directly"| node_browser
node_game_vex8 -->|"runs directly"| node_browser
node_epic_viewer -->|"opens in"| node_browser
node_file_input -->|"runs in"| node_browser
node_filesystem -->|"user selects files"| node_file_input
node_single_file -->|"runs in"| node_browser
node_external_channels -.->|"optional fetch/editor path"| node_single_file
node_full_inliner -->|"produces portable HTML"| node_game_catalog
node_compressed_inliner -->|"produces portable HTML"| node_game_catalog
node_python_converter -->|"produces data-URI HTML"| node_game_catalog
node_rewrite_support -->|"supports conversion"| node_full_inliner
node_integration_methods -.->|"targets external environments"| node_external_channels
node_external_channels -.->|"GitHub issue workflow"| node_game_request

click node_game2048 "https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/2048.html"
click node_game_amongus "https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/amongus.html"
click node_game_vex8 "https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/vex8.htm"
click node_epic_viewer "https://github.com/cooldude2349/offline-html-games-pack/blob/master/epicviewer.htm"
click node_file_input "https://github.com/cooldude2349/offline-html-games-pack/blob/master/file-input.html"
click node_single_file "https://github.com/cooldude2349/offline-html-games-pack/blob/master/single-file.html"
click node_full_inliner "https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/full_inliner.html"
click node_compressed_inliner "https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/compressed.html"
click node_python_converter "https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/convertfilestodatauris.py"
click node_rewrite_support "https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/dataURI.js"
click node_game_request "https://github.com/cooldude2349/offline-html-games-pack/blob/master/.github/ISSUE_TEMPLATE/game_request.md"

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_epic_viewer,node_file_input,node_single_file toneBlue
class node_game2048,node_game_amongus,node_game_vex8,node_game_catalog toneAmber
class node_full_inliner,node_compressed_inliner,node_python_converter,node_rewrite_support toneMint
class node_integration_methods toneRose
class node_browser,node_filesystem,node_game_request,node_external_channels toneNeutral
```

## Components

### Browser entry points

Standalone pages opened directly by users.

- [Epic viewer](https://github.com/cooldude2349/offline-html-games-pack/blob/master/epicviewer.htm): viewer entry point · Separate browser entry point. · `epicviewer.htm`
- [File import launcher](https://github.com/cooldude2349/offline-html-games-pack/blob/master/file-input.html): browser utility · Lets users select local files when direct opening is restricted. · `file-input.html`
- [Single-file loader](https://github.com/cooldude2349/offline-html-games-pack/blob/master/single-file.html): browser utility · Loads pasted, fetched, or user-supplied HTML. · `single-file.html`

### Offline game catalog

Isolated portable game artifacts.

- [2048 game](https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/2048.html): standalone game · Self-contained HTML game artifact. · `offline/2048.html`
- [Among Us game](https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/amongus.html): standalone game · Self-contained HTML game artifact. · `offline/amongus.html`
- [Vex 8 game](https://github.com/cooldude2349/offline-html-games-pack/blob/master/offline/vex8.htm): standalone game · Self-contained HTM game artifact. · `offline/vex8.htm`
- **300+ isolated games**: artifact collection · Each catalog file embeds its own runtime and assets.

### Portability pipeline

Tools that embed external resources into one HTML file.

- [Full inliner](https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/full_inliner.html): browser converter · Embeds external resources into portable HTML. · `inline-tools/full_inliner.html`
- [Compressed inliner](https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/compressed.html): browser converter · Alternative compact inlining tool. · `inline-tools/compressed.html`
- [Data-URI converter](https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/convertfilestodatauris.py): Python converter · Converts file resources into embedded data URIs. · `inline-tools/convertfilestodatauris.py`
- [URI and URL rewriting](https://github.com/cooldude2349/offline-html-games-pack/blob/master/inline-tools/dataURI.js): conversion support · Supporting scripts resolve data URIs and rewritten references. · `inline-tools/dataURI.js`

### External integration methods

Guides and embeds for third-party environments.

- **Embedding methods**: integration examples · Environment-specific approaches outside the game runtime.

### Other components

- **User browser**: runtime · Provides the client-side execution and security boundary.
- **Local filesystem**: storage · Games are commonly opened through file:// after extraction.
- [Game request template](https://github.com/cooldude2349/offline-html-games-pack/blob/master/.github/ISSUE_TEMPLATE/game_request.md): GitHub issue template · Accepts game suggestions through GitHub issues. · `.github/ISSUE_TEMPLATE/game_request.md`
- **External distribution channels**: optional services · GitHub, online editors, Google Drive, and Dropbox are optional fallbacks.

## Connections

- Local filesystem → 300+ isolated games: contains/opened from
- 300+ isolated games → 2048 game: includes
- 300+ isolated games → Among Us game: includes
- 300+ isolated games → Vex 8 game: includes
- 2048 game → User browser: runs directly
- Among Us game → User browser: runs directly
- Vex 8 game → User browser: runs directly
- Epic viewer → User browser: opens in
- File import launcher → User browser: runs in
- Local filesystem → File import launcher: user selects files
- Single-file loader → User browser: runs in
- External distribution channels → Single-file loader: optional fetch/editor path
- Full inliner → 300+ isolated games: produces portable HTML
- Compressed inliner → 300+ isolated games: produces portable HTML
- Data-URI converter → 300+ isolated games: produces data-URI HTML
- URI and URL rewriting → Full inliner: supports conversion
- Embedding methods → External distribution channels: targets external environments
- External distribution channels → Game request template: GitHub issue workflow
