// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later

function switch_theme() {
	let el = document.documentElement;
	if(el.getAttribute("data-color-scheme") === "invert") {
		el.setAttribute("data-color-scheme", "normal");
		localStorage.setItem("color-scheme", "normal");
	} else {
		el.setAttribute("data-color-scheme", "invert");
		localStorage.setItem("color-scheme", "invert");
	}
}

function switch_layout() {
	let el = document.documentElement;
	if(el.getAttribute("data-layout") === "wide") {
		el.setAttribute("data-layout", "normal");
		localStorage.setItem("layout", "normal");
	} else {
		el.setAttribute("data-layout", "wide");
		localStorage.setItem("layout", "wide");
	}
}

if(localStorage.getItem("color-scheme") === "invert") {
	switch_theme();
}

if(localStorage.getItem("layout") === "wide") {
	switch_layout();
}

// @license-end

