2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 05:36:46 +00:00
inventree-docs/_includes/carousel.html
Oliver dfbf1293cb Simpler gallery
- use splide.js
- iterate though a directory automatically
2021-08-10 20:32:49 +10:00

27 lines
680 B
HTML

<div class='splide'>
<div class='splide__track'>
<ul class='splide__list'>
{% for img in listimages(directory) %}
{% with src=img %}
{% include "splide_image.html" %}
{% endwith %}
{% endfor %}
</ul>
</div>
</div>
<script>
document.addEventListener( 'DOMContentLoaded', function () {
new Splide(
'.splide', {
type: 'loop',
perPage: 2,
autoplay: true,
pagination: false,
// cover: true,
height: '25rem',
focus: 'center',
}
).mount();
} );
</script>