Skip to content

Commit 22c9a7c

Browse files
author
Tino Mettler
committed
Comments, remove cruft
1 parent 12ccefc commit 22c9a7c

File tree

1 file changed

+2
-42
lines changed

1 file changed

+2
-42
lines changed

data/website_gallery/modal.js

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ const slides = {
2424
const prevArrow = document.getElementById('prevArrow');
2525
const nextArrow = document.getElementById('nextArrow');
2626

27-
// State management
2827
let mouseTimer = null;
2928
let startX = 0;
3029
let startY = 0;
31-
let isDragging = false;
30+
let isDragging = false; // For swipe navigation
3231
let isZoomed = false;
33-
let isPanning = false;
32+
let isPanning = false; // Panning in zoomed state
3433
let hasPanned = false;
3534
let translateX = 0;
3635
let translateY = 0;
@@ -57,14 +56,6 @@ function updateBoundaries() {
5756
// Calculate the actual scaled dimensions based on the base (pre-zoom) size
5857
scaledWidth = baseWidth * currentScale;
5958
scaledHeight = baseHeight * currentScale;
60-
console.log('Boundaries:', {
61-
containerRect,
62-
scaledWidth,
63-
scaledHeight,
64-
baseWidth,
65-
baseHeight,
66-
currentScale
67-
});
6859
}
6960

7061
function limitPanning(proposedX, proposedY) {
@@ -116,15 +107,6 @@ function limitPanning(proposedX, proposedY) {
116107
constrainedY = (baseHeight - scaledHeight) / 2;
117108
}
118109

119-
console.log('limitPanning:', {
120-
proposed: { x: proposedX, y: proposedY },
121-
constrained: { x: constrainedX, y: constrainedY },
122-
limits: { minX, maxX, minY, maxY },
123-
baseOffset: { x: baseOffsetX, y: baseOffsetY },
124-
baseSize: { w: baseWidth, h: baseHeight },
125-
scaledSize: { w: scaledWidth, h: scaledHeight }
126-
});
127-
128110
return {
129111
x: constrainedX,
130112
y: constrainedY
@@ -299,22 +281,6 @@ async function handleTouchEnd(e) {
299281
}
300282
}
301283

302-
function handleMouseMove() {
303-
if (isZoomed) return;
304-
305-
prevArrow.classList.add('visible');
306-
nextArrow.classList.add('visible');
307-
308-
if (mouseTimer) {
309-
clearTimeout(mouseTimer);
310-
}
311-
312-
mouseTimer = setTimeout(() => {
313-
prevArrow.classList.remove('visible');
314-
nextArrow.classList.remove('visible');
315-
}, 1000);
316-
}
317-
318284
function handleKeyDown(e) {
319285
if (isZoomed) return;
320286

@@ -342,9 +308,6 @@ container.addEventListener('touchmove', handleTouchMove);
342308
container.addEventListener('touchend', handleTouchEnd);
343309
container.addEventListener('click', handleZoom);
344310

345-
// make nav arrows visible
346-
document.addEventListener('mousemove', handleMouseMove);
347-
348311
document.addEventListener('keydown', handleKeyDown);
349312
prevArrow.addEventListener('click', showPreviousImage);
350313
nextArrow.addEventListener('click', showNextImage);
@@ -417,8 +380,5 @@ container.addEventListener('touchmove', function(e) {
417380
container.addEventListener('touchend', function(e) {
418381
if (isPanning) {
419382
isPanning = false;
420-
if (!hasPanned) {
421-
handleZoomTap(e.changedTouches[0]);
422-
}
423383
}
424384
});

0 commit comments

Comments
 (0)