$(document).ready(function () { initSwiper(); initIndexBannerMove(); initIndexIAm(); }); var indexSwiper; function initSwiper() { indexSwiper = new Swiper(".banner--full-screen", { pagination: { el: ".banner-control__pagination", }, navigation: { nextEl: ".banner-control__next", prevEl: ".banner-control__prev", }, }); } function initIndexBannerMove() { $(document).mousemove(function (e) { var translateX = e.pageX / -50, translateY = e.pageY / -50, translate = "translate(" + translateX + "px, " + translateY + "px)", clipPath = "circle(35% at calc(65% + " + translateX + "px) calc(40% + " + translateY + "px)" $(".banner__circle").css("transform", translate); $(".index-circle-banner__bg").css({ "-webkit-clip-path": clipPath, "clip-path": clipPath }) }); } function initIndexIAm() { $("#iam").change(function () { var selectedValue = $(this).val(); $(".iam-change").each(function () { $(this).addClass("hide").hide() var thisType = $(this).attr("data-iam").split(", "); var show = false $.each(thisType, function (index, thisValue) { if(selectedValue == thisValue) { show = true } }); if(show) { $(this).removeClass("hide").fadeIn() } }); }); $("#iam").change() }