summaryrefslogtreecommitdiff
path: root/scripts/light-dark.js
blob: 0e23d98ede45bf681601608eddb993a15099843d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict';

(function() {
	lightDark = document.getElementById("light-dark");

	function setButtonText() {
		if(Theme.get() == BASE_THEMES[0][0])
			lightDark.innerText = BASE_THEMES[1][1] + " Mode";
		else
			lightDark.innerText = BASE_THEMES[1][0] + " Mode";
	}

	function changeTheme(e) {
		if(Theme.get() == BASE_THEMES[0][0])
			Theme.set(BASE_THEMES[0][1]);
		else
			Theme.set(BASE_THEMES[0][0]);
		
		setButtonText();
	}

	lightDark.addEventListener("click", changeTheme);
	setButtonText();
})();