// text-animation (function ($) { $(function () { $('.text-animation').each(function () { const text = this.textContent.trim(); const characters = text.split(''); this.textContent = ''; characters.forEach((char, index) => { const span = document.createElement('span'); span.textContent = char; span.style.setProperty('--delay', index + 1); this.appendChild(span); }); this.classList.add('is-ready'); }); const observer = new IntersectionObserver((entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { const el = entry.target; const $el = $(el); const index = $el .closest('section') .find('.anime, .text-animation') .index(el); if (index !== -1) { el.style.transitionDelay = `${index * 0.1}s`; } el.classList.add('anime-on'); observer.unobserve(el); } }); }, { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }); $('.anime, .text-animation').each(function () { observer.observe(this); }); }); })(jQuery); // slide const swiper = new Swiper('.mySwiper', { loop: true, effect: 'fade', fadeEffect: { crossFade: true }, speed: 2000, autoplay: { delay: 3000, disableOnInteraction: false, }, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); // gsap.registerPlugin(ScrollTrigger); gsap.to('.parallax-container', { opacity: 1, y: 0, duration: 1.2, ease: 'power2.out', scrollTrigger: { trigger: '.parallax-container', start: 'top 85%', toggleActions: 'play none none none', } }); const parallaxImages = document.querySelectorAll('.parallax-img'); parallaxImages.forEach((img) => { gsap.to(img, { y: '30%', ease: 'none', scrollTrigger: { trigger: img.parentElement, start: 'top bottom', end: 'bottom top', scrub: 1 } }); });