Adjust gradient angle rotation

This commit is contained in:
Adam Iannazzone 2024-04-19 09:39:02 -04:00
parent 4dcb5da829
commit 812831a390
2 changed files with 2 additions and 7 deletions

View file

@ -40,7 +40,7 @@ footer {
}
.my-gradient {
background: linear-gradient(0deg, #1a9fff, #946beb);
background: linear-gradient(45deg, #1a9fff, 15%, #946beb);
}
.jumbotron h1 {

View file

@ -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();