diff --git a/CHANGELOG.md b/CHANGELOG.md index 089f932..2d2355d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project are documented here. The project follows [Semantic Versioning](https://semver.org/). Each release is deployed to [seriesoftub.es](https://seriesoftub.es). +## [Unreleased] + +- Zoom in twice as far as before, handy for crowded spots like the UAE, + Singapore or Central Europe. +- Half speed: a new ½× button, or press 0. + ## [1.8.1] — 2026-10-23 - Settings for animations and sound, in the menu and on the help screen. diff --git a/site/index.html b/site/index.html index 8e456a1..e6a728b 100644 --- a/site/index.html +++ b/site/index.html @@ -379,6 +379,7 @@ input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radi
Date
Y1 · Jan 1
+ @@ -1709,7 +1710,7 @@ function checkGoals(){checkBadges(); /* ================= ACTIONS ================= */ function spend(c){if(S.cashNot enough cash.
Wait for revenue, or speed up time.','bad');sfx('err');return false;}S.cash-=c;sfx('build');return true;} const ACT={ - speed:({v})=>{UI.speed=v;renderHUD();}, + speed:({v})=>{v=+v;if(![0,0.5,1,2,4,8].includes(v))return;UI.speed=v;renderHUD();}, help:()=>showHelp(), dash:()=>{if(!S)return;const d=$('dash');d.hidden=!d.hidden;if(!d.hidden)renderDash();}, dashClose:()=>{$('dash').hidden=true;}, @@ -1928,7 +1929,7 @@ const barCls=u=>u>=0.9?'bad':u>=0.65?'warn':''; function renderAll(){renderHUD();renderLeft();renderPanel();renderHint();renderMega();renderCoach();} function renderMega(){const el=$('mega');if(!el)return;const on=!!(S&&S.ev&&S.ev.php>S.day);if(el.hidden===!on)return;el.hidden=!on;} function renderHUD(){ - for(const v of [0,1,2,4,8]){const b=$('sp'+v);if(b)b.classList.toggle('on',UI.speed===v);} + for(const v of [0,0.5,1,2,4,8]){const b=$('sp'+v);if(b)b.classList.toggle('on',UI.speed===v);} $('muteBtn').style.opacity=UI.muted?.4:1; if(!S)return; $('hName').textContent=S.name;$('hAsn').textContent='AS'+S.asn+(S.mode==='sandbox'?' · Sandbox':S.scn?' · '+(S.scn.id==='weekly'?'Weekly '+S.scn.key:S.scn.name)+(S.scn.done||S.scn.failed?'':` · ${Math.max(0,S.scn.days-S.day)}d left`):''); @@ -2290,7 +2291,7 @@ function checkUpdate(){ } function showHelp(){ openModal(`

How the internet works here

-

Controls: drag the map to pan, scroll or pinch to zoom, tap a city to open it. Drag from your pink router to another city to lay fiber. Space pauses, 1 2 3 4 set speed. At 1× a day lasts 2.5 seconds.

+

Controls: drag the map to pan, scroll or pinch to zoom, tap a city to open it. Drag from your pink router to another city to lay fiber. Space pauses, 0 is half speed, 1 2 3 4 set speed. At 1× a day lasts 2.5 seconds.

Eyeballs
Home broadband users. They mostly download from CDNs and pay you per Gbps you deliver. Serve them well and they multiply.
POP
Point of presence: your router in a data center. Everything starts at a POP.
@@ -2602,9 +2603,9 @@ function endPtr(e){ UI.drag=null;UI.snap=null;cv.classList.remove('linking');cv.style.cursor='grab';renderHint(); } cv.addEventListener('pointerup',endPtr);cv.addEventListener('pointercancel',endPtr); -function zoomAt(mx,my,f){const wx=cam.x+(mx-CW/2)/cam.z,wy=cam.y+(my-CH/2)/cam.z;cam.z=clamp(cam.z*f,0.35,3);cam.x=wx-(mx-CW/2)/cam.z;cam.y=wy-(my-CH/2)/cam.z;wrapCam();} +function zoomAt(mx,my,f){const wx=cam.x+(mx-CW/2)/cam.z,wy=cam.y+(my-CH/2)/cam.z;cam.z=clamp(cam.z*f,0.35,6);cam.x=wx-(mx-CW/2)/cam.z;cam.y=wy-(my-CH/2)/cam.z;wrapCam();} cv.addEventListener('wheel',e=>{e.preventDefault();zoomAt(e.clientX,e.clientY,Math.exp(-e.deltaY*0.0015));},{passive:false}); -addEventListener('keydown',e=>{if(e.target.tagName==='INPUT')return;if(e.code==='Space'){e.preventDefault();UI.speed=UI.speed?0:1;renderHUD();}if(e.key==='1')ACT.speed({v:1});if(e.key==='2')ACT.speed({v:2});if(e.key==='3')ACT.speed({v:4});if(e.key==='4')ACT.speed({v:8});if(e.key==='Escape'&&!$('bankBox').hidden){$('bankBox').hidden=true;return;}if(e.key==='Escape'&&!$('dash').hidden){$('dash').hidden=true;return;}if(e.key==='Escape'){if(!$('modal').hidden){if(S&&UI.started&&!S.lost)closeModal();}else{UI.sel=null;renderPanel();}}}); +addEventListener('keydown',e=>{if(e.target.tagName==='INPUT')return;if(e.code==='Space'){e.preventDefault();UI.speed=UI.speed?0:1;renderHUD();}if(e.key==='0')ACT.speed({v:0.5});if(e.key==='1')ACT.speed({v:1});if(e.key==='2')ACT.speed({v:2});if(e.key==='3')ACT.speed({v:4});if(e.key==='4')ACT.speed({v:8});if(e.key==='Escape'&&!$('bankBox').hidden){$('bankBox').hidden=true;return;}if(e.key==='Escape'&&!$('dash').hidden){$('dash').hidden=true;return;}if(e.key==='Escape'){if(!$('modal').hidden){if(S&&UI.started&&!S.lost)closeModal();}else{UI.sel=null;renderPanel();}}}); /* ---------- click delegation ---------- */ let pressing=false; diff --git a/tests/modes.test.js b/tests/modes.test.js index d831977..407818f 100644 --- a/tests/modes.test.js +++ b/tests/modes.test.js @@ -120,3 +120,15 @@ test('animations can be switched off, on or follow the system, and the choice st assert.equal(ev("UI.muted"), true); assert.deepEqual(errors, []); }); + +test('half speed and deeper zoom', () => { + const { ev, errors } = load(); + ev("ACT.start({});ACT.speed({v:0.5})"); + assert.equal(ev("UI.speed"), 0.5); + assert.equal(ev("document.getElementById('sp0.5').classList.contains('on')"), true); + ev("ACT.speed({v:7})"); + assert.equal(ev("UI.speed"), 0.5, 'bogus speeds are ignored'); + ev("cam.z=1;for(let i=0;i<40;i++)zoomAt(100,100,1.2)"); + assert.equal(ev("cam.z"), 6); + assert.deepEqual(errors, []); +});