From 812831a390b74d554859612fee1d19f3dcf120d1 Mon Sep 17 00:00:00 2001 From: Adam Iannazzone <46025473+jiannazzone@users.noreply.github.com> Date: Fri, 19 Apr 2024 09:39:02 -0400 Subject: [PATCH] Adjust gradient angle rotation --- css/style.css | 2 +- scripts/gradient.js | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/css/style.css b/css/style.css index 6034ef8..8ac3692 100644 --- a/css/style.css +++ b/css/style.css @@ -40,7 +40,7 @@ footer { } .my-gradient { - background: linear-gradient(0deg, #1a9fff, #946beb); + background: linear-gradient(45deg, #1a9fff, 15%, #946beb); } .jumbotron h1 { diff --git a/scripts/gradient.js b/scripts/gradient.js index b4901d0..6c7f2f4 100644 --- a/scripts/gradient.js +++ b/scripts/gradient.js @@ -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();