Remove UI scale slider

This commit is contained in:
courtmanr@gmail.com
2025-04-28 09:35:22 +01:00
parent 6cd2686121
commit 7cc8587fa8
2 changed files with 2 additions and 43 deletions
-41
View File
@@ -2557,45 +2557,4 @@ document.addEventListener('DOMContentLoaded', function() {
}
// ---> END NEW Function <---
// --- START: UI Scale Slider Logic ---
const uiScaleSlider = document.getElementById('ui-scale-slider');
// Target the root <html> element for font-size adjustment
// REUSE existing variable declared earlier
const applyRootFontSize = (sliderValue) => {
// Map slider value (0.75-1.25) to root font size (e.g., 12px-20px, centered around 16px)
const baseSize = 16; // Assuming default browser root font size is 16px
const newSizePx = baseSize * sliderValue;
if (htmlElement) {
htmlElement.style.fontSize = `${newSizePx}px`;
}
if (uiScaleSlider) {
uiScaleSlider.value = sliderValue;
}
};
const loadRootFontSize = () => {
const savedMultiplier = localStorage.getItem('uiFontMultiplier');
if (savedMultiplier) {
applyRootFontSize(parseFloat(savedMultiplier));
} else {
applyRootFontSize(1.0); // Default multiplier (maps to 16px)
}
};
if (uiScaleSlider && htmlElement) {
uiScaleSlider.addEventListener('input', (event) => {
const newMultiplier = parseFloat(event.target.value);
applyRootFontSize(newMultiplier);
localStorage.setItem('uiFontMultiplier', newMultiplier.toString());
});
// Load initial font size
loadRootFontSize();
} else {
console.error('Could not find UI scale slider or HTML element.');
}
// --- END: UI Scale Slider Logic ---
}); // End DOMContentLoaded
+2 -2
View File
@@ -50,9 +50,9 @@
<!-- Header Controls (Aligned Right) -->
<div class="header-controls flex flex-1 justify-end items-center gap-4">
<!-- Start: UI Scale Slider -->
<div class="ui-scale-slider flex items-center opacity-50 hover:opacity-100 focus-within:opacity-100 transition-opacity duration-300" title="Adjust UI Scale" style="gap: 4px;">
<!-- <div class="ui-scale-slider flex items-center opacity-50 hover:opacity-100 focus-within:opacity-100 transition-opacity duration-300" title="Adjust UI Scale" style="gap: 4px;">
<input type="range" id="ui-scale-slider" min="0.75" max="1.25" step="0.05" value="1.0" class="cursor-pointer accent-blue-600 dark:accent-blue-500" style="width: 80px; height: 16px;">
</div>
</div> -->
<!-- End: UI Scale Slider -->
<!-- Replaced toggle switch with icon button - removed focus ring -->
<button id="theme-toggle-button" type="button" class="p-1 rounded-md text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 focus:outline-none" aria-label="Toggle theme">