From c61dda6ed800c584534eec7579c2eb6e11ba0dbf Mon Sep 17 00:00:00 2001 From: Neko Date: Mon, 11 Sep 2023 11:46:03 +0200 Subject: [PATCH] added rgb mode with a 25% chance, changed random colour to be 25% chance --- assets/js/color.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/assets/js/color.js b/assets/js/color.js index cbc8802..3869695 100644 --- a/assets/js/color.js +++ b/assets/js/color.js @@ -1,3 +1,15 @@ -if(Math.random()>0.9){ - document.getElementsByClassName('screen-content')[0].style.filter = "sepia(94%) hue-rotate("+Math.floor(Math.random()*360)+"deg) saturate(7) brightness(100%)" +color = 0 +function colorRotate(){ + color += 10 + color = color%360 + document.getElementsByClassName('screen-content')[0].style.filter = "sepia(94%) hue-rotate("+color+"deg) saturate(7) brightness(100%)" +} + +if( Math.random() > 0.5){ + if( Math.random() > 0.9){ + + document.getElementsByClassName('screen-content')[0].style.filter = "sepia(94%) hue-rotate("+Math.floor(Math.random()*360)+"deg) saturate(7) brightness(100%)" + } else { + setInterval(colorRotate, 50) + } }