26 lines
799 B
Plaintext
26 lines
799 B
Plaintext
|
<script>
|
||
|
window.addEventListener('DOMContentLoaded', (event) => {
|
||
|
const swiper_api = document.getElementById('swiper-api');
|
||
|
if (swiper_api != undefined) {
|
||
|
utils.css(`<%- conf.css %>`);
|
||
|
utils.js(`<%- conf.js %>`, { defer: true }).then(function () {
|
||
|
const effect = swiper_api.getAttribute('effect') || '';
|
||
|
var swiper = new Swiper('.swiper#swiper-api', {
|
||
|
slidesPerView: 'auto',
|
||
|
spaceBetween: 8,
|
||
|
centeredSlides: true,
|
||
|
effect: effect,
|
||
|
loop: true,
|
||
|
pagination: {
|
||
|
el: '.swiper-pagination',
|
||
|
clickable: true,
|
||
|
},
|
||
|
navigation: {
|
||
|
nextEl: '.swiper-button-next',
|
||
|
prevEl: '.swiper-button-prev',
|
||
|
},
|
||
|
});
|
||
|
})
|
||
|
}
|
||
|
});
|
||
|
</script>
|