feat: smooth analog zoom with solid blue hover

UX improvements for more responsive, fluid zoom experience:

1. Smooth analog response:
   - Removed 50ms debounce - applies zoom immediately
   - Changed step from 5 to 1 for ultra-smooth increments
   - Updated transition: 0.08s linear (was 0.3s cubic-bezier)
   - Real-time transform updates for analog feel vs digital jumps

2. Solid blue hover (no gradient):
   - Changed from multi-color gradient to solid #3b82f6 blue
   - Maintains gray when not hovering
   - Clean, simple visual feedback matching reference design

3. Visual enhancement:
   - Keyboard shortcuts now use step 10 for faster adjustments
   - Instant response eliminates "digital" feeling
   - Smooth, continuous zoom matching analog controls

Technical changes:
- HTML: step="1" instead of step="5"
- CSS: solid color hover, 0.08s linear transition
- JS: removed debounce timeout, immediate applyZoom()
This commit is contained in:
juanatsap
2025-11-12 11:46:19 +00:00
parent b6aeb697fe
commit c1506a4d1e
3 changed files with 11 additions and 27 deletions
+5 -11
View File
@@ -277,19 +277,13 @@
applyZoom(zoomValue, false); // false = don't save (already loaded from storage)
}
// Real-time slider updates with debouncing for performance
let zoomTimeout;
// Real-time slider updates - immediate, smooth analog experience
slider.addEventListener('input', function(e) {
const zoomValue = parseInt(e.target.value, 10);
// Update ARIA and display immediately (no debounce)
// Apply zoom and update display immediately for smooth analog feel
updateZoomDisplay(zoomValue);
// Debounce the actual transform application (smoother on slower devices)
clearTimeout(zoomTimeout);
zoomTimeout = setTimeout(() => {
applyZoom(zoomValue, true);
}, 50); // 50ms debounce
applyZoom(zoomValue, true);
});
// Reset button
@@ -306,10 +300,10 @@
if ((e.ctrlKey || e.metaKey) && !e.shiftKey) {
if (e.key === '=' || e.key === '+') {
e.preventDefault();
incrementZoom(5);
incrementZoom(10);
} else if (e.key === '-') {
e.preventDefault();
incrementZoom(-5);
incrementZoom(-10);
} else if (e.key === '0') {
e.preventDefault();
slider.value = 100;