introduction-website/src/js/main.js

23 lines
604 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)"
];
function setRandomSecondaryColor() {
const randomColor = secondaryColors[Math.floor(Math.random() * secondaryColors.length)];
document.documentElement.style.setProperty('--secondary-color', randomColor);
}
setRandomSecondaryColor();