add --random-timeout
This commit is contained in:
+10
-4
@@ -1,4 +1,10 @@
|
||||
(function CSSRandom(){
|
||||
document.body.style.setProperty('--random',Math.random())
|
||||
requestAnimationFrame(CSSRandom)
|
||||
})()
|
||||
const style=document.body.style
|
||||
function CSSRandom(){
|
||||
style.setProperty('--random',Math.random())
|
||||
const timeout=style.getPropertyValue('--random-timeout')
|
||||
if(timeout){
|
||||
setTimeout(CSSRandom,parseInt(timeout))
|
||||
}else{
|
||||
requestAnimationFrame(CSSRandom)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user