Merge pull request #564 from bitkarrot/main

Comment out theme select dropdown
This commit is contained in:
Aljaz
2025-06-06 06:45:20 +02:00
committed by GitHub
2 changed files with 21 additions and 14 deletions

View File

@@ -43,9 +43,10 @@
<input type="text" id="search" placeholder="Search resources...">
<i class="fas fa-search"></i>
</div>
<div class="theme-controls">
<select id="colorThemeSelect" class="theme-select" aria-label="Select color theme">
<option value="cyberpunk">Default Theme</option>
<div class="theme-controls">
<!-- Color theme select dropdown commented out as requested
<select id="colorThemeSelect" class="theme-select" aria-label="Select color theme">
<option value="cyberpunk">Default</option>
<option value="purple">Purple Dream</option>
<option value="nature">Nature's Touch</option>
<option value="sunset">Sunset Vibes</option>
@@ -56,14 +57,14 @@
<option value="nord">Nord</option>
<option value="pastel">Pastel Pop</option>
<option value="oceanic">Oceanic Breeze</option>
<option value="dracula">Dracula</option>
<option value="dracula">Dracula</option>
</select>
-->
<button id="darkModeToggle" class="theme-toggle" aria-label="Toggle dark mode">
<i class="fas fa-moon"></i>
</button>
</div>
</div>
</div>
</nav>

View File

@@ -296,21 +296,27 @@ document.addEventListener('DOMContentLoaded', () => {
});
// Color theme initialization
const colorThemeSelect = document.getElementById('colorThemeSelect');
const colorThemeSelect = document.getElementById('colorThemeSelect'); // This will be null since we commented it out
const savedColorTheme = localStorage.getItem('colorTheme');
const defaultTheme = 'default';
// Validate saved theme exists
const initialTheme = colorThemes[savedColorTheme] ? savedColorTheme : defaultTheme;
colorThemeSelect.value = initialTheme;
// Only set the value if the element exists
if (colorThemeSelect) {
colorThemeSelect.value = initialTheme;
}
applyColorTheme(initialTheme);
// Color theme change event listener
colorThemeSelect.addEventListener('change', (e) => {
const selectedTheme = e.target.value;
localStorage.setItem('colorTheme', selectedTheme);
applyColorTheme(selectedTheme);
});
// Only add the event listener if the element exists
if (colorThemeSelect) {
colorThemeSelect.addEventListener('change', (e) => {
const selectedTheme = e.target.value;
localStorage.setItem('colorTheme', selectedTheme);
applyColorTheme(selectedTheme);
});
}
// Test if marked is loaded
if (typeof marked === 'undefined') {