2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-06-13 02:35:29 +00:00

Simpler gallery

- use splide.js
- iterate though a directory automatically
This commit is contained in:
Oliver
2021-08-10 20:32:49 +10:00
parent 6a7d90f06e
commit dfbf1293cb
38 changed files with 67 additions and 144 deletions

27
_includes/carousel.html Normal file
View File

@ -0,0 +1,27 @@
<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>