Simple 3-module setup for v flexible slideshows (mainly when crossfading, use Flickity for anything else lol).
A module, which given an array, returns an instance with some methods for progressing through the array and getting data about indexes and etc
A module, which given an element, puts all children into an instance of generic cycle. Returns an instance with methods for moving prev/next. On prev/next, we just add a class of in
or out
which can be used for fx
Shows using generic-slideshow
in a data-component. Little extra functionality for setting caption/counter also.
Not meant to be plug-and-play (though its v close). Just keeping track of my approach to this for future projects. This example is old-skool dom-thrashy, but I use same ideas when throwing this into a React/Vue build, etc. Main point is just have a simple cycle iterator and let css handle the fade out.