You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
459 B
JavaScript

let palettes = {
purple: {
color: "#7D50FF",
lightColor: "#CEC6FF",
},
orange: {
color: "#FF5416",
lightColor: "#FFB58D",
},
};
window.addEventListener("load", () => {
let shade = Math.random() > 0.5 ? "purple" : "orange";
color = palettes[shade]["color"];
lightColor = palettes[shade]["lightColor"];
document.documentElement.style.setProperty("--color", color);
document.documentElement.style.setProperty("--light-color", lightColor);
});