File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 191191 let touchStartY = 0 ;
192192 let touchEndX = 0 ;
193193 let touchEndY = 0 ;
194- let isSwiping = false ;
195194
196195 // Track touch start
197196 card . addEventListener ( 'touchstart' , ( e ) => {
200199
201200 touchStartX = e . changedTouches [ 0 ] . clientX ;
202201 touchStartY = e . changedTouches [ 0 ] . clientY ;
203- isSwiping = false ;
204- } , { passive : true } ) ;
205-
206- // Track touch move to detect swipe
207- card . addEventListener ( 'touchmove' , ( e ) => {
208- if ( ! e . target . closest ( '.card-code' ) ) return ;
209- isSwiping = true ;
210202 } , { passive : true } ) ;
211203
212204 // Handle touch end for swipe or tap
234226 // Swipe right - show old
235227 card . classList . remove ( 'toggled' ) ;
236228 }
237- } else if ( ! isSwiping ) {
238- // It's a tap (no significant movement )
229+ } else if ( absDeltaX < 10 && absDeltaY < 10 ) {
230+ // It's a tap (movement under 10px threshold )
239231 card . classList . toggle ( 'toggled' ) ;
240232 }
241233 } , { passive : true } ) ;
You can’t perform that action at this time.
0 commit comments