1jQuery(window).on('elementor/frontend/init', function () { 2 elementorFrontend.hooks.addAction('frontend/element_ready/rkit-home-slider.default', function ($scope, $) { 3 4 const slider = $scope.find('.rkit-homeslider-slider'); 5 var config = slider.data('config'); 6 7 var conf = { 8 rtl: config.rtl, 9 arrows: config.arrows, 10 dots: config.dots, 11 autoplay: (config.autoplay) ? { 12 delay: 3000, 13 disableOnInteraction: false, 14 pauseOnMouseEnter: config.pauseOnHover 15 } : false, 16 loop: config.loop, 17 speed: config.speed, 18 slidesPerView: config.slidesPerView, 19 slidesPerGroup: config.slidesPerGroup, 20 breakpoints: config.breakpoints, 21 grabCursor: true, 22 initialSlide: (config.initial_slide == null) ? 0 : config.initial_slide, 23 } 24 25 if (config.slideStyle === 'fade') { 26 conf.effect = 'fade'; 27 conf.cardsEffect = { 28 crossFade: true, 29 }; 30 } 31 32 var pagination = { 33 pagination: { 34 enabled: config.dots, 35 el: '.rkit-homeslider-pagination', 36 type: 'bullets', 37 clickable: true, 38 bulletClass: 'rkit-homeslider-bullet', 39 bulletActiveClass: 'rkit-homeslider-bullet-active', 40 clickableClass: 'rkit-homeslider-bullet-clickable' 41 } 42 } 43 44 var navigation = { 45 navigation: { 46 enabled: config.arrows, 47 nextEl: '.rkit-swiper-hs-button-next', 48 prevEl: '.rkit-swiper-hs-button-prev', 49 } 50 } 51 52 var dataConfig = { ...conf, ...pagination, ...navigation } 53 54 let container = $scope.find('.rkit-swiper-hs'); 55 const swiper = new Swiper(container[0], dataConfig); 56 57 // ð¥ Helper function untuk animasi split text 58 function splitTextToSpans(el, delayStep = 0.2) { 59 if (!el) return; 60 // Kalau sudah ada span, jangan di-split ulang 61 if (el.querySelector('span')) return; 62 63 const rawText = el.textContent.trim(); 64 el.textContent = ''; 65 66 const words = rawText.split(/\s+/).filter(Boolean); 67 68 words.forEach((word, index) => { 69 const span = document.createElement('span'); 70 span.textContent = word; 71 span.style.animationDelay = `${(delayStep * (index + 1)).toFixed(2)}s`; 72 el.appendChild(span); 73 el.appendChild(document.createTextNode(' ')); 74 }); 75 } 76 77 swiper.on('slideChangeTransitionStart', function () { 78 $('.image-cover-hsl').removeClass('animate-zoom-out'); 79 $('.swiper-slide-active .image-cover-hsl').addClass('animate-zoom-out'); 80 81 // Subtitle 82 const subTitle = document.querySelector('.swiper-slide-active .hs-subtitle-section .hs-sub-title'); 83 splitTextToSpans(subTitle); 84 85 // Title 86 const title = document.querySelector('.swiper-slide-active .hs-animation-1-title'); 87 splitTextToSpans(title); 88 89 // Desc 90 const desc = document.querySelector('.swiper-slide-active .hs-animation-1-desc'); 91 splitTextToSpans(desc); 92 93 // Typewriter subtitle 94 const typeSub = document.querySelector('.swiper-slide-active .hs-animation-2-subtitle'); 95 if (typeSub) {
96 typeSub.style.animation = 'none'; 97 void typeSub.offsetWidth; 98 typeSub.style.animation = 'typewritersubtitle 4s steps(30) 1s forwards, blink 0.7s step-end infinite'; 99 } 100 101 // Typewriter title 102 const typeTitle = document.querySelector('.swiper-slide-active .hs-animation-2-title'); 103 if (typeTitle) { 104 typeTitle.style.animation = 'none'; 105 void typeTitle.offsetWidth; 106 typeTitle.style.animation = 'typewritertitle 4s steps(30) 1s forwards, blink 0.7s step-end infinite'; 107 } 108 109 // Typewriter desc 110 const typeDesc = document.querySelector('.swiper-slide-active .hs-animation-2-desc'); 111 if (typeDesc) { 112 typeDesc.style.animation = 'none'; 113 void typeDesc.offsetWidth; 114 typeDesc.style.animation = 'typewriterdesc 4s steps(30) 1s forwards, blink 0.7s step-end infinite'; 115 } 116 }); 117 118 }); 119});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.