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
456 B
JavaScript
20 lines
456 B
JavaScript
let palettes = {
|
|
purple: {
|
|
color: "#8f00ff",
|
|
lightColor: "#E8CDFE",
|
|
},
|
|
|
|
orange: {
|
|
color: "#FFF",
|
|
lightColor: "#FF6100",
|
|
},
|
|
};
|
|
|
|
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);
|
|
});
|