Skip to content

Conversation

@yhau1989
Copy link

suggested that pornhub.com has this type of UX for thumbnail preview

@yhau1989
Copy link
Author

Hey @AviKKi we can use Intersection_Observer_API ?? Could generate a new branch and a new pull request?

@AviKKi
Copy link
Owner

AviKKi commented Oct 29, 2020

Hey @yhau1989 this doesn't look very good, opera mini, UC browser and iOS 12.1 will be left out which is major portion of mobile users. I've had the look at the code of pornhub.com their approach is very simple with a great UX, so I'm heading up with that.

Their method for mobile -
on TouchStart

=> get initial coordinates 
=> check if these coordinates are on a img element
=> start img's preview

due to this simple approach there is no way to stop the preview once it's started, small loop hole w.r.t. the simplicity and UX we get. Stopping the preview using Intersection_Observer_API sounds nice to me.

PS: Later I may add options for multiple preview triggers, but for now since #18 is not yet done. I"m sticking with this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants