data endpoint for entity 90008 (aka. a website)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: make pet shake motion amplify proportionally to window ratio

dusk 34ddac4e 46ed10d1

+4 -2
+4 -2
src/components/pet.svelte
··· 153 153 const accel = event.acceleration ?? event.accelerationIncludingGravity; 154 154 if (accel === null || accel.x === null || accel.y === null) return; 155 155 if (Math.abs(accel.x) + Math.abs(accel.y) < 40.0) return; 156 - velocityX += accel.x * 4.0; 157 - velocityY += accel.y * 3.0; 156 + // make it so that it amplifies motion proportionally to the window size 157 + const windowRatio = (window.innerWidth * 1.0) / (window.innerHeight * 1.0); 158 + velocityX += accel.x * windowRatio * 5.0; 159 + velocityY += accel.y * (1.0 / windowRatio) * 5.0; 158 160 sprite = '/pet/pick.webp'; 159 161 }; 160 162