From aa5987f6efb7e8e95f6dce66bdd195f3f79f828e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Thu, 23 Feb 2023 09:32:58 +0100 Subject: [PATCH] 8m: JS formatting --- _pages/8m.md | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/_pages/8m.md b/_pages/8m.md index d806e7f..0d9282e 100644 --- a/_pages/8m.md +++ b/_pages/8m.md @@ -144,24 +144,12 @@ li::before { setTimeout(function(){ top.location = next[Math.floor(Math.random()*next.length)]; }, 30000); - - var colorToSet = colors[Math.floor(Math.random() * colors.length)]; - - document.querySelector("body").style.backgroundColor = colorToSet; - - var bcolorToSet = bcolors[Math.floor(Math.random() * bcolors.length)]; - - var bcolorloop = document.querySelectorAll("h1, h2, h3, h4"); - - var acolorloop = document.querySelectorAll("a"); - - for (var x = 0; x < bcolorloop.length; x++) - - bcolorloop[x].style.color = bcolorToSet; - - for (var x = 0; x < acolorloop.length; x++) - - acolorloop[x].style.color = bcolorToSet; - + var colorToSet = colors[Math.floor(Math.random() * colors.length)]; + document.querySelector("body").style.backgroundColor = colorToSet; + var bcolorToSet = bcolors[Math.floor(Math.random() * bcolors.length)]; + var bcolorloop = document.querySelectorAll("h1, h2, h3, h4"); + var acolorloop = document.querySelectorAll("a"); + for (var x = 0; x < bcolorloop.length; x++) bcolorloop[x].style.color = bcolorToSet; + for (var x = 0; x < acolorloop.length; x++) acolorloop[x].style.color = bcolorToSet; });