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:
parent
5b37469384
commit
9aaf266107
1 changed files with 2 additions and 2 deletions
|
@ -28,9 +28,9 @@
|
|||
let stopGravity: (() => void) | null = null
|
||||
|
||||
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())
|
||||
while (pathChangeTimestamps[0] < Date.now() - 5000) pathChangeTimestamps.shift()
|
||||
while (pathChangeTimestamps[0] < Date.now() - 10000) pathChangeTimestamps.shift()
|
||||
console.log(pathChangeTimestamps)
|
||||
if (pathChangeTimestamps.length >= 10) {
|
||||
const { initGravity } = await import('$lib/gravity')
|
||||
|
|
Loading…
Add table
Reference in a new issue