MediaWiki:Common.js: Difference between revisions
No edit summary  | 
				No edit summary  | 
				||
| Line 7: | Line 7: | ||
   logo.href = 'https://ooqa.karls.computer/Special:Random';  |    logo.href = 'https://ooqa.karls.computer/Special:Random';  | ||
});  | });  | ||
let counter = rand(1000, 10000)  | |||
| Line 17: | Line 19: | ||
		e.style.rotate = `${ rand(-3, 3) }deg`  | 		e.style.rotate = `${ rand(-3, 3) }deg`  | ||
	})  | 	})  | ||
	let counter = rand(1000, 10000)  | |||
}  | }  | ||
//Background color  | //Background color  | ||
// Function to generate a random bright color  | // Function to generate a random bright color  | ||
function getRandomBrightColor() {  | function getRandomBrightColor() {  | ||
| Line 45: | Line 47: | ||
     element.style.backgroundColor = getRandomBrightColor();  |      element.style.backgroundColor = getRandomBrightColor();  | ||
   });  |    });  | ||
  counter = rand(1000, 10000)  | |||
}  | }  | ||
// Gradually change the background color for all elements  | // Gradually change the background color for all elements  | ||
function changeStylesGradually() {  | function changeStylesGradually() {  | ||
   setInterval(() => { setRandomRotations() },   |    setInterval(() => { setRandomRotations() }, counter)  | ||
   setInterval(() => { setBackgroundColors() },   |    setInterval(() => { setBackgroundColors() }, counter)  | ||
}  | }  | ||