introduction-website/src/js/main.js

28 lines
659 B
JavaScript
Raw Normal View History

2024-08-21 20:22:27 +00:00
const secondaryColors = [
// "rgb(240, 240, 240)",
// "rgb(136, 139, 141)",
"rgb(224, 231, 34)",
"rgb(255, 173, 0)",
"rgb(244,54,76)",
// "rgb(219, 62, 177)",
"rgb(250, 150, 250)",
"rgb(250, 150, 150)",
"rgb(242, 172, 185)",
"rgb(0, 138, 216)",
"rgb(0, 178, 169)",
"rgb(88, 188, 64)",
"rgb(173, 223, 179)"
];
2024-08-23 21:57:06 +00:00
let hue = 200;
const colorChangeInterval = 150;
function setRainbowColor() {
const color = `hsl(${hue}, 60%, 60%)`;
document.documentElement.style.setProperty('--secondary-color', color);
hue = (hue + 1) % 360;
2024-08-21 20:22:27 +00:00
}
2024-08-23 21:57:06 +00:00
setRainbowColor();
setInterval(setRainbowColor, colorChangeInterval);