mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 12:14:42 +01:00
Removing clearTimeout
This commit is contained in:
@@ -7,18 +7,16 @@ function jumpVal(val: number) {
|
|||||||
return Math.random() > 0.5 ? val + (Math.random() - 0.5) / 2 : Math.random()
|
return Math.random() > 0.5 ? val + (Math.random() - 0.5) / 2 : Math.random()
|
||||||
}
|
}
|
||||||
|
|
||||||
let timeout: any
|
|
||||||
function jumpPoints() {
|
function jumpPoints() {
|
||||||
for (let i = 0; i < points.value.length; i++)
|
for (let i = 0; i < points.value.length; i++)
|
||||||
points.value[i] = [jumpVal(points.value[i][0]), jumpVal(points.value[i][1])]
|
points.value[i] = [jumpVal(points.value[i][0]), jumpVal(points.value[i][1])]
|
||||||
|
|
||||||
timeout = setTimeout(jumpPoints, 2000 + Math.random() * 1000)
|
setTimeout(jumpPoints, 2000 + Math.random() * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
jumpPoints()
|
jumpPoints()
|
||||||
})
|
})
|
||||||
onUnmounted(() => clearTimeout(timeout))
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user