Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/thatdeveloperguy-website / creative-source/plates/lobby/lobby.js |
| Date | Not specified in source |
| Repository | Janady13/thatdeveloperguy-website |
| Revision | 2bea2ebdff0e34494bff597d4fa9c8422a0c3a94 |
| Branch | main |
| Path or archive member | creative-source/plates/lobby/lobby.js |
| Original SHA-256 | 895ad2209bb15a9562aa414d99c70b9a8893f1c791c1afbb19ee493e4129deb0 |
| Git blob SHA | d5062c090bbe8a93569f03927945610cb0b008d2 |
| Reading-copy SHA-256 | 895ad2209bb15a9562aa414d99c70b9a8893f1c791c1afbb19ee493e4129deb0 |
Recovered source transcript
Download complete source text ↓12 lines · 1.2 KB
const W=1672,H=941,world=document.getElementById('world'),layers=[...document.querySelectorAll('.L')];
let s=1,px=0,py=0,tx=0,ty=0;
function fit(){const vw=innerWidth,vh=innerHeight;s=Math.max(vw/W,vh/H)*1.04;world.style.transform=`translate(${vw/2-W*s/2}px,${vh/2-H*s/2}px) scale(${s})`}
addEventListener('resize',fit);fit();
const reduce=matchMedia('(prefers-reduced-motion: reduce)').matches;
if(!reduce){addEventListener('pointermove',e=>{tx=(e.clientX/innerWidth-.5)*2;ty=(e.clientY/innerHeight-.5)*2});
(function loop(){px+=(tx-px)*.06;py+=(ty-py)*.06;for(const l of layers){const d=+l.dataset.depth;l.style.transform=`translate(${-px*d*28}px,${-py*d*14}px)`};document.getElementById('bg').style.transform=`translate(${px*6}px,${py*3}px) scale(1.012)`;requestAnimationFrame(loop)})()}
// fit each label to its plate (Public Sans is wider than the painted condensed lettering)
function fitLabels(){for(const l of document.querySelectorAll('.label')){const sp=l.firstElementChild;sp.style.transform='';const max=l.clientWidth-18,w=sp.getBoundingClientRect().width/s;if(w>max)sp.style.transform=`scale(${(max/w).toFixed(3)})`}}
if(document.fonts&&document.fonts.ready)document.fonts.ready.then(fitLabels);else fitLabels();addEventListener('resize',fitLabels);