Split the game page into partials under src/, assembled into one index.html at build
site/index.html (900 KB of HTML, CSS and JS in one file) becomes src/: a shell (src/index.html), styles/ and game/, concatenated in path order by scripts/lib/page.js. The assembled page is byte-identical to the old file, so load time and in-game performance are unchanged. - scripts/build.js replaces build.sh (same env vars, same output) - npm run dev: a zero-dependency dev server that assembles on every request - tests assemble the page in memory; npm test runs every tests/*.test.js - perf-bench takes --base-ref to build a git ref's page - scripts/legacy/split-index-html.js is the splitter, kept for older branches
This commit is contained in:
parent
295e68cc46
commit
67a40942b4
113 changed files with 5584 additions and 5195 deletions
9
src/game/94-dashboard/80-hint.js
Normal file
9
src/game/94-dashboard/80-hint.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function renderHint(){
|
||||
const hn=$('hint');if(!S||UI.hintOff||(S.tut!==undefined&&S.tut!==null)||(innerWidth<760&&(UI.sel||UI.leftOpen)&&!(UI.drag&&UI.drag.mode==='link'))){hn.hidden=true;return;}
|
||||
let t='';
|
||||
if(UI.drag&&UI.drag.mode==='link')t=UI.snap?tr('Release to plan a link'):tr('Drag onto another city');
|
||||
else if(!S.links.length&&S.done.tr)t=tr('Tip: drag from your pink router to another city to lay fiber');
|
||||
else if(!S.done.bb)t=tr('Tap your city, then Launch broadband');
|
||||
hn.textContent=t;hn.hidden=!t;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue