# firas-abidi/hxh-language-translator architecture

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

- Interactive diagram: https://gitdiagram.com/firas-abidi/hxh-language-translator
- Repository: https://github.com/firas-abidi/hxh-language-translator

## Overview

This is a static Japanese-to-Hunter × Hunter-script translator. The user enters Japanese; kanji readings are converted to kana when needed, kana are replaced with bundled glyphs, and the result is drawn on a canvas that can be recolored, copied, or downloaded. The README documents this workflow and the optional on-demand dictionary and hosted-copy requirements. The main page source was not excerpted, so implementation-level call ownership cannot be verified; edges below reflect documented behavior only.

Main entry points: [`index.html`](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html) (Output canvas), [`hxh_sprites.js`](https://github.com/firas-abidi/hxh-language-translator/blob/main/hxh_sprites.js) (Kana glyph sprites), [`assets`](https://github.com/firas-abidi/hxh-language-translator/tree/main/assets) (Header artwork)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_translation["Translation"]
  node_japanese["Japanese text<br/>[index.html]"]
  node_kana["Kana reading<br/>[index.html]"]
  node_reading["Kanji reading<br/>[index.html]"]
  node_kuromoji["Kuromoji dictionary"]
end

subgraph group_rendering["Glyph rendering"]
  node_glyphs["Kana glyph sprites<br/>[hxh_sprites.js]"]
  node_canvas["Output canvas<br/>[index.html]"]
end

subgraph group_interface["Page and outputs"]
  node_page["Translator page<br/>[index.html]"]
  node_colors["Recolor controls<br/>[index.html]"]
  node_copy["Copy image<br/>[index.html]"]
  node_download["Download PNG<br/>[index.html]"]
  node_fonts["Google Fonts"]
  node_artwork["Header artwork"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_page
node_visitor -->|"enters text"| node_japanese
node_japanese -->|"reads kana"| node_kana
node_japanese -->|"converts kanji"| node_reading
node_reading -.->|"uses dictionary"| node_kuromoji
node_reading -->|"yields kana"| node_kana
node_kana -->|"maps to glyphs"| node_glyphs
node_glyphs -->|"paints glyphs"| node_canvas
node_visitor -->|"chooses colors"| node_colors
node_colors -->|"recolors"| node_canvas
node_visitor -->|"requests copy"| node_copy
node_canvas -->|"copies image"| node_copy
node_visitor -->|"requests download"| node_download
node_canvas -->|"exports PNG"| node_download
node_page -.->|"loads fonts"| node_fonts
node_page -.->|"displays artwork"| node_artwork

click node_page "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_japanese "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_kana "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_reading "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_glyphs "https://github.com/firas-abidi/hxh-language-translator/blob/main/hxh_sprites.js"
click node_canvas "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_colors "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_copy "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_download "https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html"
click node_artwork "https://github.com/firas-abidi/hxh-language-translator/tree/main/assets"

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_japanese,node_kana,node_reading,node_kuromoji toneBlue
class node_glyphs,node_canvas toneAmber
class node_page,node_colors,node_copy,node_download,node_fonts,node_artwork toneMint
class node_visitor toneIndigo
```

## Components

### Translation

- [Japanese text](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`
- [Kana reading](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`
- [Kanji reading](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`
- **Kuromoji dictionary**

### Glyph rendering

- [Kana glyph sprites](https://github.com/firas-abidi/hxh-language-translator/blob/main/hxh_sprites.js): `hxh_sprites.js`
- [Output canvas](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`

### Page and outputs

- [Translator page](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`
- [Recolor controls](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`
- [Copy image](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`
- [Download PNG](https://github.com/firas-abidi/hxh-language-translator/blob/main/index.html): `index.html`
- **Google Fonts**
- [Header artwork](https://github.com/firas-abidi/hxh-language-translator/tree/main/assets): `assets`

### Other components

- **Visitor**

## Connections

- Visitor → Translator page: opens (evidence: `README.md`)
- Visitor → Japanese text: enters text (evidence: `README.md`)
- Japanese text → Kana reading: reads kana (evidence: `README.md`)
- Japanese text → Kanji reading: converts kanji (evidence: `README.md`)
- Kanji reading → Kuromoji dictionary: uses dictionary (evidence: `README.md`)
- Kanji reading → Kana reading: yields kana (evidence: `README.md`)
- Kana reading → Kana glyph sprites: maps to glyphs (evidence: `README.md`)
- Kana glyph sprites → Output canvas: paints glyphs (evidence: `README.md`)
- Visitor → Recolor controls: chooses colors (evidence: `README.md`)
- Recolor controls → Output canvas: recolors (evidence: `README.md`)
- Visitor → Copy image: requests copy (evidence: `README.md`)
- Output canvas → Copy image: copies image (evidence: `README.md`)
- Visitor → Download PNG: requests download (evidence: `README.md`)
- Output canvas → Download PNG: exports PNG (evidence: `README.md`)
- Translator page → Google Fonts: loads fonts (evidence: `README.md`)
- Translator page → Header artwork: displays artwork (evidence: `README.md`)
