2023-01-25 17:45:06 +01:00
|
|
|
<script>
|
|
|
|
function setTheme() {
|
|
|
|
const themeName = document.getElementById('themes').value;
|
|
|
|
document.documentElement.className = themeName;
|
2023-01-28 23:21:42 +01:00
|
|
|
localStorage.setItem('theme', themeName);
|
2023-01-25 17:45:06 +01:00
|
|
|
}
|
|
|
|
(function () { // Set the theme on page load
|
2023-01-28 23:21:42 +01:00
|
|
|
const elt = document.getElementById('themes');
|
|
|
|
elt.style.display = 'block';
|
2023-01-25 17:45:06 +01:00
|
|
|
const themeName = localStorage.getItem('theme');
|
|
|
|
if (themeName) {
|
|
|
|
document.documentElement.className = themeName;
|
2023-01-28 14:47:03 +01:00
|
|
|
elt.value = themeName;
|
2023-01-25 17:45:06 +01:00
|
|
|
}
|
|
|
|
})();
|
|
|
|
</script>
|