MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 13: | Line 13: | ||
return Math.random() * (max - min) + min | return Math.random() * (max - min) + min | ||
} | } | ||
document.querySelectorAll('ul li, figure, .vector-pinned-container, .vector-dropdown-content, .mw-logo > *, .vector-typeahead-search-container, #news').forEach( e => { | function setRandomRotations() { | ||
document.querySelectorAll('ul li, figure, .vector-pinned-container, .vector-dropdown-content, .mw-logo > *, .vector-typeahead-search-container, #news').forEach( e => { | |||
}) | e.style.rotate = `${ rand(-3, 3) }deg` | ||
}) | |||
} | |||
//Background color | //Background color | ||
| Line 45: | Line 48: | ||
// Gradually change the background color for all elements | // Gradually change the background color for all elements | ||
function | function changeStylesGradually() { | ||
setInterval(() => { | setInterval(() => { | ||
setRandomRotations(); | |||
setBackgroundColors(); | setBackgroundColors(); | ||
}, 5000); // Change every 5 seconds | }, 5000); // Change every 5 seconds | ||
| Line 52: | Line 56: | ||
// Initialize the process | // Initialize the process | ||
setRandomRotations(); | |||
setBackgroundColors(); | setBackgroundColors(); | ||
changeStylesGradually(); | |||
//mouse-hover Popup for the logo | //mouse-hover Popup for the logo | ||