mirror of
https://github.com/RetroDECK/RetroDECK-Website.git
synced 2024-11-22 06:55:37 +00:00
16 lines
471 B
JavaScript
16 lines
471 B
JavaScript
let gradientAngle = 45;
|
|
|
|
let gradientSpinElems = document.getElementsByClassName('gradient-spin');
|
|
const gradientInterval = setInterval(function() {
|
|
updateGradientAngle();
|
|
}, 50);
|
|
|
|
function updateGradientAngle() {
|
|
gradientAngle += 1
|
|
if (gradientAngle > 360) {
|
|
gradientAngle = 0;
|
|
}
|
|
for (let i=0; i<gradientSpinElems.length; i++) {
|
|
gradientSpinElems[i].style.background = `linear-gradient(${gradientAngle}deg, #1a9fff, #946beb)`;
|
|
}
|
|
} |