function changeSVGValuesPeriodically() {
let height = 300;
let decreasing = true;
const interval = setInterval(() => {
console.log("Current height:", height);
let gradientColor;
if (height >= 0 && height < 100) {
gradientColor = "#FF0000";
} else if (height >= 100 && height < 200) {
gradientColor = "#FF6600";
} else {
gradientColor = "#003822";
}
if (decreasing) {
height -= 2;
if (height <= 0) {
decreasing = false;
}
} else {
height += 2;
if (height >= 300) {
decreasing = true;
}
}
const svgElement = document.querySelector('.line svg');
const rectElement = document.querySelector('.line rect');
const imgElement = document.querySelector('.img');
svgElement.setAttribute('height', height);
svgElement.setAttribute('viewBox', `0 0 10 ${height}`);
const gradientElement = document.querySelector('#paint0_linear_1633_114613');
gradientElement.querySelector('stop').setAttribute('stop-color', gradientColor);
gradientElement.querySelector('stop').setAttribute('offset', height / 300);
rectElement.setAttribute('height', height);
imgElement.style.height = `${height}px`;
}, 40);
}
changeSVGValuesPeriodically();