summaryrefslogtreecommitdiff
path: root/scripts/light-dark.js
blob: 643f8b73ab664792aa2edbc8c468fa8a32205efa (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() {
	var 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();
})();