diff --git a/src/scripts/home.js b/src/scripts/home.js index 2d26a93..0ad084d 100644 --- a/src/scripts/home.js +++ b/src/scripts/home.js @@ -216,28 +216,42 @@ function initSwiper(section) { }); } -function initTab(section) { - const swiper = initSwiper(section); +function slideSwiper(_section, swiper, index) { + swiper.slideTo(index); +} + +function handleSlideChange(section, swiper) { + swiper.on('slideChange', () => { + const activeIndex = swiper.activeIndex; + document.querySelectorAll(`.section_${section} .tab_trigger`).forEach(t => t.classList.remove('active')); + document.querySelectorAll(`.section_${section} .tab_trigger`)[activeIndex].classList.add('active'); + updateTabBackground(section, activeIndex); + }); +} +function handleTabClick(section, swiper, onChange) { document.querySelectorAll(`.section_${section} .tab_trigger`).forEach((tab, index) => { tab.addEventListener('click', () => { document.querySelectorAll(`.section_${section} .tab_trigger`).forEach(t => t.classList.remove('active')); tab.classList.add('active'); updateTabBackground(section, index); - swiper.slideTo(index); + onChange?.(section, swiper, index); }); }); - swiper.on('slideChange', () => { - const activeIndex = swiper.activeIndex; - document.querySelectorAll(`.section_${section} .tab_trigger`).forEach(t => t.classList.remove('active')); - document.querySelectorAll(`.section_${section} .tab_trigger`)[activeIndex].classList.add('active'); - updateTabBackground(section, activeIndex); - }); + if(swiper) { + handleSlideChange(section, swiper); + } document.querySelector(`.section_${section} .tab_trigger`).click(); } +function initTab(section, onChange) { + const swiper = initSwiper(section); + + handleTabClick(section, swiper, onChange); +} + function updateTabBackground(section, index) { const tab = document.querySelectorAll(`.section_${section} .tab_trigger`)[index]; const background = document.querySelector(`.section_${section} .tab_background`); @@ -281,6 +295,13 @@ function initRotatingText() { setInterval(updateWord, ANIMATION_DELAY); } +function bilingCycle(_section, _swiper, index) { + const billingCosts = document.querySelectorAll(`.fusebox_plan-cost`); + const billingCost = document.querySelectorAll(`.fusebox_plan-cost.is-${index}`); + billingCosts.forEach(cost => cost.style.display = 'none'); + billingCost.forEach(cost => cost.style.display = 'block'); +} + window.Webflow?.push(async () => { safeExecute(initInfiniteSlide); safeExecute(initTestimonialsSwiper); @@ -293,7 +314,8 @@ window.Webflow?.push(async () => { safeExecute(initCarouselBannerSwiper); safeExecute(initCaseSwiper); safeExecute(animateZkevm); - safeExecute(initTab, "study"); - safeExecute(initTab, "highlight"); + safeExecute(initTab, "study", slideSwiper); + safeExecute(initTab, "highlight", slideSwiper); safeExecute(initRotatingText); + safeExecute(initTab, "pricing", bilingCycle); }); diff --git a/src/styles/home.css b/src/styles/home.css index 665df4d..1457b48 100644 --- a/src/styles/home.css +++ b/src/styles/home.css @@ -261,3 +261,24 @@ a.inherit { } /* ANIMATE HERO LOGO SLIDE END */ + +.fusebox_plan.is-pricing-popular::before { + content: ""; + position: absolute; + inset: -60px -20px; + background: radial-gradient(circle at center, #AFFAB6 0%, rgba(175, 250, 182, 0) 100%); + z-index: -2; + border-radius: inherit; + filter: blur(20px); + pointer-events: none; +} + +.fusebox_plan.is-pricing-popular::after { + content: ""; + position: absolute; + inset: 0; + background-color: #fff; + z-index: -1; + border-radius: inherit; + pointer-events: none; +} \ No newline at end of file