Skip to content

Instantly share code, notes, and snippets.

@anka-213
Created December 20, 2022 13:15
Show Gist options
  • Save anka-213/d72b787c7b247c61c9f9dd4bb1d0c266 to your computer and use it in GitHub Desktop.
Save anka-213/d72b787c7b247c61c9f9dd4bb1d0c266 to your computer and use it in GitHub Desktop.
Turn wayfinder into a labeled minimap in xkcd 2712
Comic.wayfinderFarDistance = 80000
Comic.wayfinderSpread = 300
Comic.wayfinderEls.forEach((x,i) => (x.innerText = i, x.style.color = 'red'))
M = (v, min, max) => Math.min(Math.max(v,min),max)
window.origUpdateWayfinder = window.origUpdateWayfinder || Comic.updateWayfinder
Comic.updateWayfinder = Function("return function " + origUpdateWayfinder.toString().replace("+10*", "+this.wayfinderSpread*"))()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment