var posterSwiperLoop = $(".work-poster-swiper .swiper-slide:visible").length > 3 ? true : false; var numSlides = $(".tvc-swiper .swiper-slide:visible").length; if ($(".tvc-swiper").length > 0) { var tvcSwiper = new Swiper(".tvc-swiper", { slidesPerView: 1, centeredSlides: numSlides < 2 ? true : false, //loop: , spaceBetween: 32, breakpoints: { 480: { slidesPerView: slidesPerView, }, }, navigation: { nextEl: ".tvc-swiper-navigation .slide-next", prevEl: ".tvc-swiper-navigation .slide-prev", }, pagination: { el: ".tvc-swiper-pagination", type: "bullets", clickable: true, }, }); if ($(".tvc-swiper .swiper-slide").length < 2) { $(".tvc-swiper-pagination, .tvc-swiper-navigation").hide(); } } if ($(".social-ads-swiper").length > 0) { var tvcSwiper = new Swiper(".social-ads-swiper", { slidesPerView: 1, spaceBetween: 32, navigation: { nextEl: ".social-ads-swiper-navigation .slide-next", prevEl: ".social-ads-swiper-navigation .slide-prev", }, pagination: { el: ".social-ads-swiper-pagination", type: "bullets", clickable: true, }, }); if ($(".social-ads-swiper .swiper-slide").length < 2) { $(".social-ads-swiper-pagination, .social-ads-swiper-navigation").hide(); } } /** * client logo swiper */ if ($(".client-logo-swiper").length > 0) { var clientLogoSwiper = new Swiper(".client-logo-swiper", { slidesPerView: "auto", spaceBetween: 32, loop: true, autoplay: { delay: 2000, }, }); } /** * Work link update */ $(".work-item-link-wrapper").each(function () { var link = $(this).find(".work-link.hidden").html(); $(this).attr("href", link); });