# chung10kr/page-wrecker architecture

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

- Interactive diagram: https://gitdiagram.com/chung10kr/page-wrecker
- Repository: https://github.com/chung10kr/page-wrecker

## Overview

Page Wrecker is a Chrome extension that overlays destructive effects on the current webpage without changing its underlying content. The main workflow is choosing a weapon or score-game action in the popup, injecting the page runtime, and sending it a command. The runtime handles weapon interactions and visual effects, with additional ant, scoring, language, and sound capabilities. The sampled runtime is a single large file; feature nodes therefore identify responsibilities within that file, not independently verified modules. Other links follow the README where source excerpts do not show the wiring.

Main entry points: [`content.js`](https://github.com/chung10kr/page-wrecker/blob/main/content.js) (Overlay runtime), [`popup.js`](https://github.com/chung10kr/page-wrecker/blob/main/popup.js) (Popup controls), [`popup.html`](https://github.com/chung10kr/page-wrecker/blob/main/popup.html) (Popup UI), [`sounds`](https://github.com/chung10kr/page-wrecker/tree/main/sounds) (Sound effects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Extension interface"]
  node_popup["Popup controls<br/>[popup.js]"]
  node_popupview["Popup UI<br/>[popup.html]"]
end

subgraph group_runtime["Page runtime"]
  node_runtime["Overlay runtime<br/>[content.js]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_weapons["Weapon actions<br/>[content.js]"]
  node_effects["Canvas effects<br/>[content.js]"]
  node_ants["Ants<br/>[content.js]"]
  node_score["Score game<br/>[content.js]"]
  node_language["Language settings<br/>[content.js]"]
end

subgraph group_assets["Bundled assets"]
  node_audio["Sound effects"]
  node_sounds["Weapon sounds"]
  node_icons["Weapon icons"]
end

node_user(("User"))
node_browser["Chrome APIs"]
node_page["Current webpage"]

node_user -->|"opens"| node_popupview
node_popupview -->|"handles controls"| node_popup
node_popup -->|"queries and injects"| node_browser
node_popup -->|"sends commands"| node_runtime
node_browser -->|"injects"| node_runtime
node_runtime -->|"overlays"| node_page
node_runtime -->|"handles"| node_weapons
node_weapons -->|"draws"| node_effects
node_weapons -->|"hits ants"| node_ants
node_runtime -->|"runs"| node_score
node_runtime -->|"applies"| node_language
node_runtime -->|"plays"| node_audio
node_audio -->|"uses"| node_sounds
node_popup -.->|"displays"| node_icons

click node_popup "https://github.com/chung10kr/page-wrecker/blob/main/popup.js"
click node_popupview "https://github.com/chung10kr/page-wrecker/blob/main/popup.html"
click node_runtime "https://github.com/chung10kr/page-wrecker/blob/main/content.js"
click node_weapons "https://github.com/chung10kr/page-wrecker/blob/main/content.js"
click node_effects "https://github.com/chung10kr/page-wrecker/blob/main/content.js"
click node_ants "https://github.com/chung10kr/page-wrecker/blob/main/content.js"
click node_score "https://github.com/chung10kr/page-wrecker/blob/main/content.js"
click node_language "https://github.com/chung10kr/page-wrecker/blob/main/content.js"
click node_audio "https://github.com/chung10kr/page-wrecker/tree/main/sounds"
click node_sounds "https://github.com/chung10kr/page-wrecker/tree/main/sounds"
click node_icons "https://github.com/chung10kr/page-wrecker/tree/main/icons"

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_popup,node_popupview,node_user toneBlue
class node_runtime toneAmber
class node_weapons,node_effects,node_ants,node_score,node_language,node_browser toneMint
class node_audio,node_sounds,node_icons toneRose
class node_page toneIndigo
```

## Components

### Extension interface

- [Popup controls](https://github.com/chung10kr/page-wrecker/blob/main/popup.js): `popup.js`
- [Popup UI](https://github.com/chung10kr/page-wrecker/blob/main/popup.html): `popup.html`

### Page runtime

- [Overlay runtime](https://github.com/chung10kr/page-wrecker/blob/main/content.js): `content.js`

### Gameplay systems

- [Weapon actions](https://github.com/chung10kr/page-wrecker/blob/main/content.js): `content.js`
- [Canvas effects](https://github.com/chung10kr/page-wrecker/blob/main/content.js): `content.js`
- [Ants](https://github.com/chung10kr/page-wrecker/blob/main/content.js): `content.js`
- [Score game](https://github.com/chung10kr/page-wrecker/blob/main/content.js): `content.js`
- [Language settings](https://github.com/chung10kr/page-wrecker/blob/main/content.js): `content.js`

### Bundled assets

- [Sound effects](https://github.com/chung10kr/page-wrecker/tree/main/sounds): `sounds`
- [Weapon sounds](https://github.com/chung10kr/page-wrecker/tree/main/sounds): `sounds`
- [Weapon icons](https://github.com/chung10kr/page-wrecker/tree/main/icons): `icons`

### Other components

- **User**
- **Chrome APIs**
- **Current webpage**

## Connections

- User → Popup UI: opens (evidence: `README.md`)
- Popup UI → Popup controls: handles controls (evidence: `popup.js`)
- Popup controls → Chrome APIs: queries and injects (evidence: `popup.js`)
- Popup controls → Overlay runtime: sends commands (evidence: `popup.js`)
- Chrome APIs → Overlay runtime: injects
- Overlay runtime → Current webpage: overlays (evidence: `README.md`)
- Overlay runtime → Weapon actions: handles (evidence: `README.md`)
- Weapon actions → Canvas effects: draws (evidence: `README.md`)
- Weapon actions → Ants: hits ants (evidence: `README.md`)
- Overlay runtime → Score game: runs (evidence: `README.md`)
- Overlay runtime → Language settings: applies (evidence: `content.js`)
- Overlay runtime → Sound effects: plays (evidence: `README.md`)
- Sound effects → Weapon sounds: uses (evidence: `README.md`)
- Popup controls → Weapon icons: displays
