Remove sleep

This commit is contained in:
kwaroran
2025-04-28 15:47:06 +09:00
parent 05c51f333f
commit 780cbce164

View File

@@ -27,25 +27,23 @@
target.appendChild(paddingEle) target.appendChild(paddingEle)
sleep(100).then(() => { const observer = new IntersectionObserver((v) => {
const observer = new IntersectionObserver((v) => { if(v[0].intersectionRatio > 0.5){
if(v[0].intersectionRatio > 0.5){ seen = true
seen = true target.removeChild(paddingEle)
target.removeChild(paddingEle) observer.disconnect()
observer.disconnect()
}
}, {
threshold: 0.5,
})
observer.observe(target)
return () => {
if(!seen){
observer.disconnect()
}
} }
}, {
threshold: 0.5,
}) })
observer.observe(target)
return () => {
if(!seen){
observer.disconnect()
}
}
}) })
$effect(() => { $effect(() => {