mirror of
https://github.com/RetroDECK/RetroDECK-Website.git
synced 2024-11-21 22:45:39 +00:00
Adjust gradient angle rotation
This commit is contained in:
parent
4dcb5da829
commit
812831a390
|
@ -40,7 +40,7 @@ footer {
|
|||
}
|
||||
|
||||
.my-gradient {
|
||||
background: linear-gradient(0deg, #1a9fff, #946beb);
|
||||
background: linear-gradient(45deg, #1a9fff, 15%, #946beb);
|
||||
}
|
||||
|
||||
.jumbotron h1 {
|
||||
|
|
|
@ -7,19 +7,14 @@ reduceMotion();
|
|||
function updateGradientAngle() {
|
||||
for (let i = 0; i < gradientSpinElems.length; i++) {
|
||||
gradientAngles[i] += Math.floor(Math.random() * 5) - 5;
|
||||
if (gradientAngles[i] > 360) {
|
||||
gradientAngles[i] = 0;
|
||||
}
|
||||
gradientSpinElems[i].style.background = `linear-gradient(${gradientAngles[i]}deg, #1a9fff, #946beb)`;
|
||||
gradientSpinElems[i].style.background = `linear-gradient(${gradientAngles[i]}deg, #1a9fff, 15%, #946beb)`;
|
||||
}
|
||||
}
|
||||
|
||||
function reduceMotion() {
|
||||
let reduceMotionState = document.getElementById('reduce-motion-switch').checked;
|
||||
console.log(reduceMotionState);
|
||||
if (reduceMotionState) {
|
||||
clearInterval(gradientInterval);
|
||||
console.log('stopped');
|
||||
} else {
|
||||
gradientInterval = setInterval(function () {
|
||||
updateGradientAngle();
|
||||
|
|
Loading…
Reference in a new issue