mirror of
https://github.com/RetroDECK/RetroDECK-Website.git
synced 2024-11-25 08:05:38 +00:00
Tweaks to gradient rotation algorithm
This commit is contained in:
parent
12093d0551
commit
9515a8453e
|
@ -6,7 +6,12 @@ reduceMotion();
|
||||||
|
|
||||||
function updateGradientAngle() {
|
function updateGradientAngle() {
|
||||||
for (let i = 0; i < gradientSpinElems.length; i++) {
|
for (let i = 0; i < gradientSpinElems.length; i++) {
|
||||||
gradientAngles[i] += Math.floor(Math.random() * 5) - 5;
|
gradientAngles[i] += Math.floor(Math.random() * 6) - 2;
|
||||||
|
if (gradientAngles[i] > 360) {
|
||||||
|
gradientAngles[i] -= 360;
|
||||||
|
} else if (gradientAngles[i] < -360) {
|
||||||
|
gradientAngles[i] += 360;
|
||||||
|
}
|
||||||
gradientSpinElems[i].style.background = `linear-gradient(${gradientAngles[i]}deg, #1a9fff, 15%, #946beb)`;
|
gradientSpinElems[i].style.background = `linear-gradient(${gradientAngles[i]}deg, #1a9fff, 15%, #946beb)`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue