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/src/script/theme.js

47 lines
839 B
JavaScript
Raw Normal View History

2016-09-28 18:00:57 +00:00
function swapSheet(name) {
2016-12-15 21:30:55 +00:00
document.querySelector('#theme_stylesheet').setAttribute('href', 'style/'+name+'.css');
2016-09-28 18:00:57 +00:00
}
2016-12-15 21:30:55 +00:00
const themes = module.exports = {
2016-09-28 18:00:57 +00:00
available: {
default: {
2016-12-15 21:30:55 +00:00
name: 'Default',
type: 'bright',
2016-09-28 18:00:57 +00:00
nick_pallete: {
H: [1, 360],
S: [30, 100],
L: [30, 70]
},
2016-12-15 21:30:55 +00:00
stylesheet: 'theme_default',
2016-09-28 18:00:57 +00:00
default: true,
colorSamples: {
2016-12-15 21:30:55 +00:00
toolbar: '#00c7e0',
background: '#f5f5f5'
2016-09-28 18:00:57 +00:00
}
},
night: {
2016-12-15 21:30:55 +00:00
name: 'Night',
type: 'dark',
2016-09-28 18:00:57 +00:00
nick_pallete: {
H: [1, 360],
S: [30, 100],
2016-10-01 15:28:53 +00:00
L: [50, 100]
2016-09-28 18:00:57 +00:00
},
2016-12-15 21:30:55 +00:00
stylesheet: 'theme_night',
2016-09-28 18:00:57 +00:00
default: false,
colorSamples: {
2016-12-15 21:30:55 +00:00
toolbar: '#008e8e',
background: '#1d1d1d'
2016-09-28 18:00:57 +00:00
}
}
},
change_theme: function(name) {
if(name in themes.available) {
swapSheet(themes.available[name].stylesheet);
window.irc.config.theme = name;
}
}
2016-12-15 21:30:55 +00:00
};