birjj / yet-another-medium-zoom

Medium-inspired lightbox for all your lightbox needs
https://yamz.jfagerberg.me/
MIT License
15 stars 1 forks source link

Add option to disable image in/out animations on album prev/next #20

Open igregson opened 1 year ago

igregson commented 1 year ago

First off, echoing the experience and sentiment of #3, a huge thank you for this library.


Would love the option to disable the animations on moving between images in an album.

The UX of no transitions is preferable IMO. PhotoSwipe's demo is a good example of this.

Without a custom option for this it does not seem possible. I've tried overriding the CSS but was not able to get this approach to work.

birjj commented 1 year ago

Good idea! While this feature can be implemented relatively easily _(if the option is given, instead of doing this, simply call _onAnimEnd)_ - and I would love a PR for it - it could also be a reason to revisit the whole album implementation. The album feature was something I implemented relatively poorly at the end of the project. It could definitely do with a nice cleanup eventually.

Workaround: Until this is implemented, adding CSS to such that each of these classes has a low animation duration, e,.g. 0.05s, should work (must still be an animation, so animationend fires).


Unfortunately my life has changed significantly since I contributed a lot to open source, and I no longer have much time to continue projects like these. I would love to approve PRs and publish releases, but I am afraid I won't be implementing much myself for the foreseeable future.

igregson commented 1 year ago

@birjj Thanks for the background on the album. I'd be happy to work up a PR that provides a comprehensive improvement but don't have the time currently. If I'm able to effectively disable the in/out album animations within the context of the current approach in a satisfactory way will gladly submit a PR for it.

I've tested out the CSS-based workaround and also the JS-based approach (see JS-based approach here)... each of these seems to have the same result of disabling the left/right transitions on navigation. However, images sill animate in and out on each slide change. This is the primary thing I'm trying to disable (a slight left/right animation isn't such a concern). Any ideas on how to disable this?