1
0
Fork 0
mirror of https://github.com/mat-1/matdoesdev.git synced 2025-08-02 14:46:04 +00:00

make gravity easter egg easier

This commit is contained in:
mat 2024-04-13 22:22:46 +00:00
parent 5b37469384
commit 9aaf266107

View file

@ -28,9 +28,9 @@
let stopGravity: (() => void) | null = null let stopGravity: (() => void) | null = null
async function onPathChange() { async function onPathChange() {
// if we switched paths more than 10 times in the past 5 seconds, import $lib/gravity.js // if we switched paths more than 10 times in the past 10 seconds, import $lib/gravity.js
pathChangeTimestamps.push(Date.now()) pathChangeTimestamps.push(Date.now())
while (pathChangeTimestamps[0] < Date.now() - 5000) pathChangeTimestamps.shift() while (pathChangeTimestamps[0] < Date.now() - 10000) pathChangeTimestamps.shift()
console.log(pathChangeTimestamps) console.log(pathChangeTimestamps)
if (pathChangeTimestamps.length >= 10) { if (pathChangeTimestamps.length >= 10) {
const { initGravity } = await import('$lib/gravity') const { initGravity } = await import('$lib/gravity')