This repository has been archived on 2022-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
teemant-old/public/js/theme.js
2016-09-28 21:00:57 +03:00

47 lines
819 B
JavaScript

function swapSheet(name) {
document.querySelector("#theme_stylesheet").setAttribute('href', "css/"+name+".css");
}
window.themes = {
available: {
default: {
name: "Default",
type: "bright",
nick_pallete: {
H: [1, 360],
S: [30, 100],
L: [30, 70]
},
stylesheet: "theme_default",
default: true,
colorSamples: {
toolbar: "#00c7e0",
background: "#f5f5f5"
}
},
night: {
name: "Night",
type: "dark",
nick_pallete: {
H: [1, 360],
S: [30, 100],
L: [40, 90]
},
stylesheet: "theme_night",
default: false,
colorSamples: {
toolbar: "#008e8e",
background: "#1d1d1d"
}
}
},
change_theme: function(name) {
if(name in themes.available) {
swapSheet(themes.available[name].stylesheet);
window.irc.config.theme = name;
}
}
}