Move themes directly into HTML

This commit is contained in:
Guillaume Gomez 2024-08-11 19:44:14 +02:00
parent 934e98d591
commit 2ae6a4954b
2 changed files with 7 additions and 12 deletions

View File

@ -30,7 +30,13 @@ Otherwise, have a great day =^.^=
<div class="settings-icon" tabindex="-1"></div>
<div class="settings-menu" tabindex="-1">
<div class="setting-radio-name">Theme</div>
<select id="theme-choice" onchange="setTheme(this.value, true)"></select>
<select id="theme-choice" onchange="setTheme(this.value, true)">
<option value="ayu">Ayu</option>
<option value="coal">Coal</option>
<option value="light">Light</option>
<option value="navy">Navy</option>
<option value="rust">Rust</option>
</select>
<label>
<input type="checkbox" id="disable-shortcuts" onchange="changeSetting(this)">
<span>Disable keyboard shortcuts</span>

View File

@ -604,17 +604,6 @@ function handleBlur(event) {
}
function generateSettings() {
const THEMES = ["Ayu", "Coal", "Light", "Navy", "Rust"];
const themesElem = document.getElementById("theme-choice");
let children = '';
for (const theme of THEMES) {
const id = theme.toLowerCase();
children += `<option value="${id}">${theme}</option>`;
}
themesElem.innerHTML = children;
themesElem.onblur = handleBlur;
const settings = document.getElementById("settings-dropdown");
const settingsButton = settings.querySelector(".settings-icon")
settingsButton.onclick = () => settings.classList.toggle("open");