When using the macOS Mail or Messages app you can swipe left or right with two fingers on the trackpad to delete a conversation or do some other action. (it's similar to the effect in iOS Messages)
I thought about making the HTML container of the element twice as long and then scrolling it to the center using JavaScript. This would allow horizontal scrolling which I could then apply an event listener to.
Is there a better way to do this? Or some framework that does it?
How would I achieve this behavior in JavaScript so it works well on macOS and iOS (and preferably all other platforms as well)?