thedesk/app/js/ui/theme.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-01-28 23:22:43 +11:00
//テーマ適用
function themes(theme) {
if (!theme) {
var theme = localStorage.getItem("theme");
2018-03-13 04:41:38 +11:00
if(!theme){
var theme="black";
localStorage.setItem("theme","black");
}
2018-01-28 23:22:43 +11:00
}
if (theme == "black") {
2018-04-16 23:58:14 +10:00
$("html").removeClass("indigotheme");
$("html").removeClass("greentheme");
$("html").removeClass("browntheme");
2018-01-28 23:22:43 +11:00
$("html").addClass("blacktheme");
2018-04-16 23:58:14 +10:00
} else if (theme == "indigo") {
$("html").removeClass("blacktheme");
$("html").removeClass("greentheme");
$("html").removeClass("browntheme");
$("html").addClass("indigotheme");
} else if (theme == "green") {
$("html").removeClass("indigotheme");
$("html").removeClass("greentheme");
$("html").removeClass("browntheme");
$("html").removeClass("blacktheme");
$("html").addClass("greentheme");
} else if (theme == "brown") {
$("html").removeClass("indigotheme");
$("html").removeClass("greentheme");
$("html").removeClass("blacktheme");
$("html").addClass("browntheme");
} else{
$("html").removeClass("indigotheme");
$("html").removeClass("greentheme");
$("html").removeClass("browntheme");
2018-01-28 23:22:43 +11:00
$("html").removeClass("blacktheme");
}
}
2018-03-13 04:41:38 +11:00
themes();