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