diff options
Diffstat (limited to 'src/js')
| -rw-r--r-- | src/js/rbg.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/js/rbg.js b/src/js/rbg.js index e67a0063..0b1cec5f 100644 --- a/src/js/rbg.js +++ b/src/js/rbg.js @@ -8,7 +8,17 @@ function getRandomColor() { } function setRandomGradient() { - document.body.style.background = `linear-gradient(${Math.floor(Math.random() * 180)}deg, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()})`; + const rand3 = Math.floor(Math.random()); + if (rand3 === 1) { + document.body.style.background = `linear-gradient(${Math.floor(Math.random() * 180)}deg, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()})`; + } else if (rand3 === 2) { + document.body.style.background = `linear-gradient(${Math.floor(Math.random() * 180)}deg, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}), +linear-gradient(${Math.floor(Math.random() * 180)}deg, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()})`; + } else { + document.body.style.background = `linear-gradient(${Math.floor(Math.random() * 180)}deg, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}), +linear-gradient(${Math.floor(Math.random() * 180)}deg, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}), +linear-gradient(${Math.floor(Math.random() * 180)}deg, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()})`; + } } setRandomGradient(); |
