parent
0a6517e701
commit
09f881adba
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 33 KiB |
@ -0,0 +1,21 @@
|
||||
var light= (getCookie("light")=="" ? true : getCookie("light"));
|
||||
|
||||
document.getElementById("light").width=size/4;
|
||||
|
||||
function switchLight() {
|
||||
console.log("light avant "+light);
|
||||
light=(light=="true" ? "false" : "true");
|
||||
console.log("light après "+light);
|
||||
setCookie("light",light,30);
|
||||
applyLight(light);
|
||||
}
|
||||
|
||||
function applyLight(li) {
|
||||
console.log("app li "+li);
|
||||
document.getElementById("light").src="ress/"+(li=="true" ? "light" : "dark")+".png";
|
||||
document.getElementById("logo").src="ress/logo_"+(li=="true" ? "clair" : "dark")+".png";
|
||||
document.getElementsByTagName("body")[0].classList.add((li=="true" ? "day" : "night"));
|
||||
document.getElementsByTagName("body")[0].classList.remove((li=="true" ? "night" : "day"));
|
||||
}
|
||||
|
||||
applyLight(light);
|
Loading…
Reference in new issue