-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
55 lines (37 loc) · 1.17 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//settings
var SettingsMenu = document.querySelector(".settings-menu");
//darkmode
var DarkButton = document.getElementbyId("dark-btn");
function SettingsMenuToggle() {
SettingsMenu.classList.toggle("settings-menu-height");
}
DarkButton.onclick = function () {
DarkButton.classList.toggle("dark-btn-on");
document.body.classList.toggle("dark-theme");
if (localStorage.getItem("theme") == "light") {
localStorage.setItem("theme", "dark");
}
else {
localStorage.setItem("theme", "light");
}
}
if (localStorage.getItem("theme") == "light") {
DarkButton.classList.remove("dark-btn-on");
document.body.classList.remove("dark-theme");
}
else if (localStorage.getItem("theme") == "dark") {
DarkButton.classList.add("dark-btn-on");
document.body.classList.add("dark-theme");
}
else {
localStorage.setItem("theme", "light");
}
// like function
function increaseLike()
{
var curLikes = document.getElementById('number');
var value = curLikes.innerHTML;
++value;
console.log(value);
document.getElementById('number').innerHTML = value;
}