A static site that tracks gacha characters (Genshin, Star Rail, ZZZ, Honkai Impact 3rd,
Endfield, Honkai Nexus Anima). No build step: open index.html, or publish with GitHub Pages.
| Folder | What is in it |
|---|---|
index.html, shared/css/start.css |
The start page (game picker + today's birthdays) |
00GI, 01HSR, 02ZZZ, 03HI3, 03HNA, Endfield |
One folder per game |
shared/js, shared/css |
Code and styles used by every game |
assets |
Pictures |
| File | Page | Script (in shared/js) |
Game data (in <game>/js) |
|---|---|---|---|
000.html |
Home: new / reruns / permanent | home.js |
chara.js |
001.html |
Characters | chara.js, chara-filters.js |
chara.js (list), chara-page.js (buttons) |
002.html |
Menu | ||
003.html |
Main character (Traveler, Trailblazer ...); Honkai Impact has none | mc.js |
mc.js |
004F.html |
Outfits | fit.js |
fit.js |
004S.html |
Supports (Bangboo, ELFs ...) | sup.js |
sup.js |
One template for the pages. 000, 001, 002, 003, 004F and 004S are only a few lines: a <title> and
<script src="../shared/js/page.js" data-kind="chara"> (kinds: chara, outfit, support, main).
shared/js/page.js writes the rest (search box, filter boxes, popup, navigation, scripts). To change the layout of
all of them, edit page.js once. Options on that script tag: data-nav-hide="main" (games without a main character),
data-scripts="js/outfit-files.js" (extra files of the game, loaded first), data-gender-toggle="off" (main page only). The home page (data-kind="home") takes the logo and data-birthdays="on"; the menu page (data-kind="menu") takes its buttons from a small list written in the page (see the top of shared/js/page.js).
New game: copy another game's pages, change the <title> and the settings on the page.js line, add one line to GAMES in shared/js/nav.js (this also puts the game on the main page index.html; add bday: true there if the game has a js/bday.js), and add the game's js files.
The only page not on the template is 03HI3/004S.html (ELFs): it still has the old filter popup.
common.js: small helpers used everywhere (theDexobject). Load it first.sprite-popup.js: the big-picture popup (arrows / swipe / tap the picture / dots to change picture).past.js: the "Past Games" popup of a menu page; the data iswindow.PAST_GAMESin<game>/js/past.js.char-popup.js,phase.js,countdown.js: home page popup, version/phase logic, countdown.vs.jsandgames.jsare in the main folder (the two files you edit most): the current version of each game (editvs.json every update) and the list of games.games.js(main folder): the list of games (order, icon, group, which ones show in Change). To add / move / hide a game, edit this one file.nav.js: the bottom bar and the game switcher (readsgames.js).index.js: the start page (readsgames.js).bday.js: birthdays (each game keeps its list in<game>/js/bday.js).
Each game has <game>/js/chara-page.js. It decides which buttons are always visible (quick),
which filters are in the tab row under the buttons (popup: Element, World ...), the Part / Collab buttons (parts; give buttons the same group so pressing one unpresses the other)
and the choices of every filter (filters). A character field can hold one value or a list.
-
Field names (same in every game):
imgIcon= the small picture,imgSprite= the list of big pictures,area= region / world / district / organisation,role= path (Star Rail) or spec (Honkai Impact). -
Big pictures of a character (popup):
imgSprite: ['=', 'Other', 'Outfit/QinCostumeSea'].'='is the same name asimgIcon; a plain name is another picture in the normal sprite folder;Outfit/Nameis a picture in that game's Outfit sprite folder (the same name as infit.js). WithoutimgSpriteonly the picture ofimgIconshows. The icon does not change. (Characters, Outfits and Bangboo / ELF pages.) -
Add a character: add one line to the list in
<game>/js/chara.js(andmc.js/fit.js/sup.jsif it belongs there). Nothing else to change. -
New game version: update
vs.js, then the characters'status/have. -
Add a game: copy a game folder, add one line to
games.js(the start page and the Change popup follow it). -
Add or remove a filter / part button: edit
<game>/js/chara-page.jsonly. -
Several pictures on one icon (Main page): give the character
imgName2: ['a', 'b']; withcycleIcons: truein the game'sjs/mc.jsthe icon flips between them. Pictures that don't exist are skipped. -
Several elements on one character:
element: ['Pyro', 'Hydro']makes the element badge flip through them (needsgetElementIconPathin the game'sjs/mc.js). -
Icon too close / too far: add
zoom: 1.2(bigger, 0.9 = smaller),iconX: 5(move right) and / oriconY: -8(move up) to that character's line. Works on every page with icons. -
Short picture lists (HI3 outfits):
imgSprite: ['606', 'Ooh_Summer'](Outfits page) = every picture in the Outfit sprite folder whose name starts with606, plusOoh_Summer. After adding pictures, run the sprite list script (tools/hi3outfit.bat, orpy tools\list-sprites.py): it rewrites03HI3/js/outfit-files.js, then push that file too. -
Main character outfits on the Outfits page: write
outfit: trueon the line in<game>/js/mc.js. The Outfits page then gets an MC button (only when such a line exists); the outfit shows there only while MC is pressed. The Outfits page loadsjs/mc.jsfor this, except when its<script>hasdata-nav-hide="main". -
Several outfits for one character (Outfits page): add another line with the same
namein<game>/js/fit.js. They become one card; its icon flips between the outfits and the popup shows them all.
No picture yet? Put a temporary one in assets/Temp/ with the SAME file name the real picture will have (e.g. 1511.png or .webp). It is used until the real one exists. You can also use assets/Temp/charaid/ (icons only) or assets/Temp/Sprite/ (big pictures only).
collab: trueon a character or an outfit: the page gets a Collab button by itself (Characters and Outfit pages; nothing to add in the page settings).collabStatus: ['mhy', 'solo'](withcollab: true):solo= shown ONLY while the Collab button is pressed;mhy= a miHoYo collab (a miHoYo button next to Collab narrows the list to those).status: 'guest': a purple GUEST label like NEW / SOON. A guest can't be obtained, so Have / Don't filters skip it.