I managed to solve your second problem.
I used css to display the message using the ::after pseudo ::after .
And javascript to capture touch events.
mapEl.addEventListener("touchstart", onTwoFingerDrag); mapEl.addEventListener("touchend", onTwoFingerDrag); function onTwoFingerDrag (e) { if (e.type === 'touchstart' && e.touches.length === 1) { e.currentTarget.classList.add('swiping') } else { e.currentTarget.classList.remove('swiping') } }
It checks if the type is touchhevent, and if you use 1 finger, if it adds a class to the card with the message. If you use more than one finger, it deletes the class.
Working demo I suggest you use a mobile device.
Demo Code Pen
source share