1jQuery(document).ready(function(jQuery) { 2 const isDesktop = window.innerWidth < 1024; 3 const swiper = new Swiper('.ins-tabs-slider', { 4 slidesPerView: 1, 5 slideToClickedSlide: true, 6 loop: isDesktop, // Enable loop only for 1024px and up 7 speed: 700, 8 spaceBetween: 48, 9 pagination: { 10 el: '.ins-tabs-slider-tabs', // Use only one class 11 clickable: true, 12 renderBullet: window.innerWidth >= 1024 13 ? function (index, className) { 14 const icons = [ 15 `<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.69011 3.42047C5.91293 2.59291 7.08707 2.59292 7.30989 3.42047L8.15367 6.55431C8.23138 6.84296 8.45685 7.06842 8.74549 7.14614L11.8793 7.98992C12.7069 8.21274 12.7069 9.38687 11.8793 9.60969L8.74549 10.4535C8.45685 10.5312 8.23138 10.7567 8.15367 11.0453L7.30989 14.1791C7.08707 15.0067 5.91293 15.0067 5.69011 14.1791L4.84633 11.0453C4.76862 10.7567 4.54315 10.5312 4.25451 10.4535L1.12067 9.60969C0.293109 9.38687 0.293112 8.21274 1.12067 7.98992L4.25451 7.14614C4.54315 7.06842 4.76862 6.84296 4.84633 6.55431L5.69011 3.42047Z" fill="#051235"/><path d="M14.23 1.00669C14.3043 0.730841 14.6957 0.730842 14.77 1.00669L15.0512 2.05131C15.0771 2.14752 15.1523 2.22268 15.2485 2.24858L16.2931 2.52984C16.569 2.60412 16.569 2.99549 16.2931 3.06977L15.2485 3.35103C15.1523 3.37693 15.0771 3.45209 15.0512 3.5483L14.77 4.59292C14.6957 4.86877 14.3043 4.86877 14.23 4.59291L13.9488 3.5483C13.9229 3.45209 13.8477 3.37693 13.7515 3.35103L12.7069 3.06977C12.431 2.99549 12.431 2.60412 12.7069 2.52984L13.7515 2.24858C13.8477 2.22268 13.9229 2.14752 13.9488 2.05131L14.23 1.00669Z" fill="#051235"/><path d="M14.23 13.0067C14.3043 12.7308 14.6957 12.7308 14.77 13.0067L15.0512 14.0513C15.0771 14.1475 15.1523 14.2227 15.2485 14.2486L16.2931 14.5298C16.569 14.6041 16.569 14.9955 16.2931 15.0698L15.2485 15.351C15.1523 15.3769 15.0771 15.4521 15.0512 15.5483L14.77 16.5929C14.6957 16.8688 14.3043 16.8688 14.23 16.5929L13.9488 15.5483C13.9229 15.4521 13.8477 15.3769 13.7515 15.351L12.7069 15.0698C12.431 14.9955 12.431 14.6041 12.7069 14.5298L13.7515 14.2486C13.8477 14.2227 13.9229 14.1475 13.9488 14.0513L14.23 13.0067Z" fill="#051235"/></svg>`, 16 `<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.8334 6.5H4.83335V4.83333H14.8334C15.3515 4.83333 16.1519 4.99509 16.8467 5.486C17.5848 6.0075 18.1667 6.87969 18.1667 8.16667C18.1667 9.45365 17.5848 10.3258 16.8467 10.8473C16.1519 11.3382 15.3515 11.5 14.8334 11.5H6.50002C6.2642 11.5 5.81447 11.5882 5.44777 11.8473C5.12437 12.0758 4.83335 12.4536 4.83335 13.1667C4.83335 13.8797 5.12437 14.2575 5.44777 14.486C5.81447 14.7451 6.2642 14.8333 6.50002 14.8333H15.6667V16.5H6.50002C5.98187 16.5 5.18148 16.3382 4.48667 15.8473C3.74858 15.3258 3.16669 14.4536 3.16669 13.1667C3.16669 11.8797 3.74858 11.0075 4.48667 10.486C5.18148 9.99509 5.98187 9.83333 6.50002 9.83333H14.8334C15.0692 9.83333 15.5189 9.74513 15.8856 9.48604C16.209 9.25754 16.5 8.87969 16.5 8.16667C16.5 7.45365 16.209 7.07579 15.8856 6.84729C15.5189 6.5882 15.0692 6.5 14.8334 6.5Z" fill="#051235" fill-opacity="0.6"/><path d="M17.3334 15.6667C17.3334 16.5871 16.5872 17.3333 15.6667 17.3333C14.7462 17.3333 14 16.5871 14 15.6667C14 14.7462 14.7462 14 15.6667 14C16.5872 14 17.3334 14.7462 17.3334 15.6667Z" fill="#051235" fill-opacity="0.6"/><path d="M12.3334 10.6667C12.3334 11.5871 11.5872 12.3333 10.6667 12.3333C9.74621 12.3333 9.00002 11.5871 9.00002 10.6667C9.00002 9.74619 9.74621 9 10.6667 9C11.5872 9 12.3334 9.74619 12.3334 10.6667Z" fill="#051235" fill-opacity="0.6"/><path d="M6.50002 5.66667C6.50002 6.58714 5.75383 7.33333 4.83335 7.33333C3.91288 7.33333 3.16669 6.58714 3.16669 5.66667C3.16669 4.74619 3.91288 4 4.83335 4C5.75383 4 6.50002 4.74619 6.50002 5.66667Z" fill="#051235" fill-opacity="0.6"/></svg>`, 17 `<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.5167 0.704929C15.6799 0.0986812 16.5401 0.0986833 16.7033 0.704931L17.3214 3.0007C17.3784 3.21216 17.5435 3.37733 17.755 3.43426L20.0508 4.05239C20.657 4.21562 20.657 5.07576 20.0507 5.239L17.755 5.85713C17.5435 5.91406 17.3784 6.07923 17.3214 6.29068L16.7033 8.58646C16.5401 9.19271 15.6799 9.1927 15.5167 8.58646L14.8986 6.29068C14.8416 6.07923 14.6764 5.91406 14.465 5.85713L12.1692 5.23899C11.563 5.07576 11.563 4.21562 12.1692 4.05239L14.465 3.43426C14.6764 3.37733 14.8416 3.21216 14.8986 3.0007L15.5167 0.704929Z" fill="#051235" fill-opacity="0.6"/><path d="M6.86286 1.69841C6.98832 1.23245 7.64943 1.23245 7.77489 1.69841L7.99954 2.53277C8.0433 2.69529 8.17025 2.82224 8.33278 2.866L9.16713 3.09065C9.63309 3.21611 9.63309 3.87722 9.16713 4.00268L8.33278 4.22733C8.17025 4.27108 8.0433 4.39804 7.99954 4.56056L7.7
177489 5.39491C7.64943 5.86088 6.98832 5.86088 6.86286 5.39491L6.63822 4.56056C6.59446 4.39804 6.46751 4.27108 6.30498 4.22733L5.47063 4.00268C5.00466 3.87722 5.00466 3.21611 5.47063 3.09065L6.30498 2.866C6.46751 2.82224 6.59446 2.69529 6.63822 2.53277L6.86286 1.69841Z" fill="#051235" fill-opacity="0.6"/><path d="M16.7529 11.5872C16.8783 11.1212 17.5394 11.1212 17.6649 11.5872L17.8896 12.4216C17.9333 12.5841 18.0603 12.711 18.2228 12.7548L19.0571 12.9794C19.5231 13.1049 19.5231 13.766 19.0571 13.8915L18.2228 14.1161C18.0603 14.1599 17.9333 14.2868 17.8896 14.4494L17.6649 15.2837C17.5394 15.7497 16.8783 15.7497 16.7529 15.2837L16.5282 14.4494C16.4845 14.2868 16.3575 14.1599 16.195 14.1161L15.3606 13.8915C14.8947 13.766 14.8947 13.1049 15.3606 12.9794L16.195 12.7548C16.3575 12.711 16.4845 12.5841 16.5282 12.4216L16.7529 11.5872Z" fill="#051235" fill-opacity="0.6"/><path fill-rule="evenodd" clip-rule="evenodd" d="M11.1275 11.7486C11.7132 11.1628 11.7132 10.2131 11.1275 9.62727C10.5417 9.04148 9.59192 9.04148 9.00613 9.62727L1.3141 17.3193C0.728309 17.9051 0.728309 18.8548 1.3141 19.4406C1.89988 20.0264 2.84963 20.0264 3.43542 19.4406L11.1275 11.7486ZM8.22262 13.2389C8.41788 13.0436 8.41788 12.727 8.22262 12.5317C8.02736 12.3365 7.71078 12.3365 7.51551 12.5317L2.0212 18.0261C1.82594 18.2213 1.82594 18.5379 2.0212 18.7332C2.21646 18.9284 2.53305 18.9284 2.72831 18.7332L8.22262 13.2389Z" fill="#051235" fill-opacity="0.6"/></svg>`, 18 `<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_14408_181)"><path d="M6.5 15.3333C6.5 16.0697 5.90305 16.6667 5.16667 16.6667C4.43029 16.6667 3.83333 16.0697 3.83333 15.3333V8.66667C3.83333 7.93029 4.43029 7.33333 5.16667 7.33333C5.90305 7.33333 6.5 7.93029 6.5 8.66667V15.3333Z" fill="#051235" fill-opacity="0.6"/><path d="M11.8333 15.3333C11.8333 16.0697 11.2364 16.6667 10.5 16.6667C9.76362 16.6667 9.16667 16.0697 9.16667 15.3333V4.66667C9.16667 3.93029 9.76362 3.33333 10.5 3.33333C11.2364 3.33333 11.8333 3.93029 11.8333 4.66667V15.3333Z" fill="#051235" fill-opacity="0.6"/><path d="M17.1667 15.3333C17.1667 16.0697 16.5697 16.6667 15.8333 16.6667C15.097 16.6667 14.5 16.0697 14.5 15.3333V12.6667C14.5 11.9303 15.097 11.3333 15.8333 11.3333C16.5697 11.3333 17.1667 11.9303 17.1667 12.6667V15.3333Z" fill="#051235" fill-opacity="0.6"/></g><defs><clipPath id="clip0_14408_181"><rect width="20" height="20" fill="white" transform="translate(0.5)"/></clipPath></defs></svg>`, 19 `<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18.5 3.7C18.5 5.19117 14.9183 6.4 10.5 6.4C6.08172 6.4 2.5 5.19117 2.5 3.7M18.5 3.7C18.5 2.20883 14.9183 1 10.5 1C6.08172 1 2.5 2.20883 2.5 3.7M18.5 3.7V16.3C18.5 17.794 14.9444 19 10.5 19C6.05556 19 2.5 17.794 2.5 16.3V3.7M18.5 10C18.5 11.494 14.9444 12.7 10.5 12.7C6.05556 12.7 2.5 11.494 2.5 10" stroke="#051235" stroke-opacity="0.6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`, 20 ]; 21 22 const labels = ['Sirius AI', 'Journey Orchestration', 'Personalization', 'Reports & Insights', 'Customer Data Management']; 23 24 return `<button class="${className} ins-tabs-bullet"> 25 <span class="icon">${icons[index]}</span> 26 <span class="label">${labels[index]}</span> 27 </button>`; 28 } 29 : null, // Default pagination for mobile, no need to use renderBullet 30 }, 31 32 33 34 }); 35 36 37 function updateSpaceBetween() { 38 const mediaQuery = window.matchMedia('(min-width: 1023px) and (max-height: 600px)'); 39 40 if (mediaQuery.matches) { 41 swiper.params.spaceBetween = 64; // KoÅul saÄlanınca 20px yap 42 } else { 43 swiper.params.spaceBetween = 48; // Normal durumda 48px 44 } 45 46 swiper.update(); // Swiper'ı güncelle 47} 48 49// Sayfa yüklendiÄinde ve pencere boyutu deÄiÅtiÄinde çalıÅtır 50updateSpaceBetween(); 51window.addEventListener('resize', updateSpaceBetween); 52 53if (window.innerWidth >= 1024) { 54 if(window.innerHeight>=600){ 55 const observer = new MutationObserver((mutations) => { 56 mutations.forEach((mutation) => { 57 if (mutation.target.classList.contains("swiper-slide-active")) { 58 const lastSlide = document.querySelector(".swiper-slide:last-child"); 59 if (lastSlide && lastSlide.classList.contains("swiper-slide-active")) { 60 document.querySelector(".ins-tabs-slider").style.transform = "translate(80px)"; 61 } else { 62 document.querySelector(".ins-tabs-slider").style.transform = "translate(-80px)"; 63 } 64 } 65 }); 66 }); 67 68 const config = { attributes: true, subtree: true, attributeFilter: ["class"] }; 69 const target = document.querySelector(".swiper-wrapper"); 70 71 if (target) observer.observe(target, config); 72 } 73 else{ 74 const observer = new MutationObserver((mutations) => { 75 mutations.forEach((mutation) => { 76 if (mutation.target.classList.contains("swiper-slide-active")) { 77 const lastSlide = document.querySelector(".swiper-slide:last-child"); 78 if (lastSlide && lastSlide.classList.contains("swiper-slide-active")) { 79 document.querySelector(".ins-tabs-slider").style.transform = "translate(210px)"; 80 } else { 81 document.querySelector(".ins-tabs-slider").style.transform = "translatex(-210px)"; 82 } 83 } 84 }); 85 }); 86 87 const config = { attributes: true, subtree: true, attributeFilter: ["class"] }; 88 const target = document.querySelector(".swiper-wrapper"); 89 90 if (target) observer.observe(target, config); 91 } 92 93} 94 95 96 97 98 99 100 101 // Debugging: Check if pagination elements are being generated 102 //console.log("Pagination Elements:", document.querySelector('.ins-tabs-slider-tabs').innerHTML); 103 104 105 const gridContainer = document.querySelector(".ins-bento-grid-container"); 106 const gridItems = Array.from(document.querySelectorAll(".ins-bento-grid-item-wrapper")); 107 const showMoreBtn = document.querySelector(".bento-show-more-btn"); 108 109 const visibleItemsCount = 4; 110 let isExpanded = false;
111 112 // Check if the screen size is 1024px or below 113 const isMobile = window.matchMedia("(max-width: 1024px)").matches; 114 115 gridItems.forEach((item) => { 116 const outerLink = item.querySelector(".ins-bento-outer-link"); 117 const button = item.querySelector(".ins-bento-cta"); 118 119 if (isMobile) { 120 // Prevent default behavior of the outer link on mobile 121 if (outerLink) { 122 outerLink.addEventListener("click", (e) => e.preventDefault()); 123 } 124 125 // Enable button on mobile and handle data-link redirection 126 if (button) { 127 button.style.display = "flex"; 128 const dataLink = button.getAttribute("data-link"); 129 130 if (dataLink) { 131 button.addEventListener("click", () => { 132 window.location.href = dataLink; 133 }); 134 } 135 } 136 } else { 137 // Enable outer link on desktop 138 if (outerLink) { 139 outerLink.style.pointerEvents = "auto"; 140 outerLink.removeAttribute("tabindex"); 141 } 142 143 // Hide the button on desktop 144 if (button) { 145 button.style.display = "none"; 146 button.style.pointerEvents = "none"; 147 } 148 } 149 }); 150 151 152 153 154 155 // If on mobile, initialize the "show more" functionality 156 if (isMobile) { 157 collapseContainer(); 158 159 showMoreBtn.addEventListener("click", () => { 160 if (isExpanded) { 161 // Calculate the height difference before collapsing 162 const currentHeight = gridContainer.offsetHeight; 163 const newHeight = calculateHeight(visibleItemsCount); 164 const heightDifference = currentHeight - newHeight; 165 166 // Set the duration of the height transition (match it with scroll duration) 167 const transitionDuration = 650; // Fine-tuned to match the scroll and height 168 169 // Apply height transition before collapsing 170 gridContainer.style.transition = `height ${transitionDuration}ms ease-in-out`; 171 collapseContainer(); 172 173 // Start scrolling immediately 174 window.scrollBy({ 175 top: -heightDifference, 176 behavior: "smooth", 177 }); 178 179 // Remove the inline transition style after the animation completes 180 setTimeout(() => { 181 gridContainer.style.transition = ""; // Clean up inline transition 182 }, transitionDuration); 183 184 showMoreBtn.textContent = "Show More"; 185 showMoreBtn.classList.remove("expanded"); // Remove rotation class 186 } else { 187 expandContainer(); 188 showMoreBtn.textContent = "Show Less"; 189 showMoreBtn.classList.add("expanded"); // Add rotation class 190 } 191 isExpanded = !isExpanded; 192 }); 193 } 194 195 196 function collapseContainer() { 197 const height = calculateHeight(visibleItemsCount); 198 gridContainer.style.height = `${height}px`; 199 } 200 201 function expandContainer() { 202 const height = calculateHeight(gridItems.length); 203 gridContainer.style.height = `${height}px`; 204 } 205 206 function calculateHeight(count) { 207 let totalHeight = 0; 208 209 // Add height of the first `count` items 210 gridItems.slice(0, count).forEach((item) => { 211 const style = window.getComputedStyle(item); 212 totalHeight += item.offsetHeight; 213 214 // Include bottom margin 215 const marginBottom = parseInt(style.marginBottom, 10) || 0; 216 totalHeight += marginBottom; 217 }); 218 219 // Include only the top padding of the container 220 const containerStyle = window.getComputedStyle(gridContainer); 221 const paddingTop = parseInt(containerStyle.paddingTop, 10) || 0; 222 223 totalHeight += paddingTop; 224 225 return totalHeight; 226 } 227 228 var homepageCarouselContainer = jQuery('.homepage-carousel-container'); 229 var homepageCarouselWrapper = jQuery('.homepage-carousel-wrapper'); 230 var homepageCarouselItems = jQuery('.homepage-carousel-item');
231 var homepageDotContainer = jQuery('.homepage-carousel-dots'); 232 var homepageDots = []; 233 234 var currentIndex = 0; 235 var itemWidth = homepageCarouselItems.eq(0).outerWidth() + 90; 236 var autoSlideInterval; 237 238 function isTabletDevice() { 239 return (window.innerWidth <= 1024 && window.innerWidth > 767); 240 } 241 242 function isMobileDevice() { 243 return window.innerWidth <= 767; 244 } 245 246 if (isTabletDevice()) { 247 var tabletMargin = window.innerWidth * 0.3; 248 itemWidth = homepageCarouselItems.eq(0).outerWidth() + tabletMargin; 249 } 250 251 if (isMobileDevice()) { 252 var vwToPixel = window.innerWidth * 0.15; 253 itemWidth = homepageCarouselItems.eq(0).outerWidth() + vwToPixel; 254 } 255 256 var containerWidth = homepageCarouselContainer.outerWidth(); 257 var visibleItems = Math.floor(containerWidth / itemWidth); 258 259 var totalItems = homepageCarouselItems.length; 260 if(isMobileDevice() || isTabletDevice){ 261 visibleItems = 5; 262 } 263 264 function cloneCarouselItems() { 265 homepageCarouselItems.slice(0, visibleItems).clone().appendTo(homepageCarouselWrapper); 266 homepageCarouselItems.slice(-visibleItems).clone().prependTo(homepageCarouselWrapper); 267 } 268 269 function updateCarouselPosition() { 270 var offset = -(itemWidth * (currentIndex + visibleItems)); 271 homepageCarouselWrapper.css('transform', 'translateX(' + offset + 'px)'); 272 } 273 274 function createDotClickHandler(index) { 275 return function() { 276 goToHomepageItem(index); 277 }; 278 } 279 280 function goToHomepageItem(index) { 281 currentIndex = index; 282 updateCarouselPosition(); 283 updateActiveHomepageDot(); 284 } 285 286 function updateActiveHomepageDot() { 287 var dotIndex = currentIndex % totalItems; 288 if (dotIndex < 0) { 289 dotIndex += totalItems; 290 } 291 for (var i = 0; i < homepageDots.length; i++) { 292 homepageDots[i].removeClass('active'); 293 } 294 homepageDots[dotIndex].addClass('active'); 295 } 296 297 for (var i = 0; i < totalItems; i++) { 298 var dot = jQuery('<div class="homepage-carousel-dot"></div>');
299 homepageDotContainer.append(dot); 300 homepageDots.push(dot); 301 dot.on('click', createDotClickHandler(i)); 302 } 303 homepageDots[currentIndex].addClass('active'); 304 305 function nextItem() { 306 currentIndex++; 307 updateCarouselPosition(); 308 updateActiveHomepageDot(); 309 cloneCarouselItems(); 310 updateCarouselPosition(); 311 } 312 autoSlideInterval = setInterval(nextItem, 10000); 313 314 homepageCarouselItems.hover( 315 function() { 316 clearInterval(autoSlideInterval); 317 }, 318 function() { 319 autoSlideInterval = setInterval(nextItem, 10000); 320 } 321 ); 322 323 var manager = new Hammer.Manager(homepageCarouselContainer[0]); 324 manager.set({ touchAction: 'pan-y' }); 325 manager.add( new Hammer.Swipe({ direction: Hammer.DIRECTION_HORIZONTAL }) ); 326 327 manager.on('swipeleft', nextItem); 328 manager.on('swiperight', function() { 329 if (currentIndex > 0) { 330 currentIndex--; 331 updateCarouselPosition(); 332 updateActiveHomepageDot(); 333 cloneCarouselItems(); 334 updateCarouselPosition(); 335 } 336 }); 337 338 cloneCarouselItems(); 339 updateCarouselPosition(); 340}); 341 342jQuery(document).ready(function(jQuery) { 343 jQuery('.nav-tabs a').click(function(e) { 344 e.preventDefault(); 345 jQuery('.nav-tabs li').removeClass('active'); 346 jQuery(this).closest('li').addClass('active'); 347 jQuery('.tab-pane').removeClass('active show'); 348 jQuery(jQuery(this).attr('href')).addClass('active show'); 349 updateTabContainerPosition(); 350 }); 351 352 function updateTabContainerPosition() { 353 var activeTab = document.querySelector('.nav-tabs .active'); 354 var tabContainer = document.querySelector('.nav-tabs'); 355 356 var isMobile = window.matchMedia("only screen and (max-width: 768px)").matches; 357 if (isMobile) { 358 tabContainer.scrollLeft = activeTab.offsetLeft; 359 } else { 360 var tabs = document.querySelectorAll('.nav-tabs li'); 361 var activeTabIndex = Array.from(tabs).indexOf(activeTab); 362 var tabContainerWidth = tabContainer.offsetWidth; 363 var tabWidth = activeTab.offsetWidth; 364 var tabOffsetLeft = activeTab.offsetLeft; 365 var scrollOffset = tabContainer.scrollLeft; 366 367 if (activeTabIndex === 0) { 368 tabContainer.scrollLeft = 0; 369 } else if (tabOffsetLeft < scrollOffset) { 370 tabContainer.scrollLeft = tabOffsetLeft; 371 } else if (tabOffsetLeft + tabWidth > scrollOffset + tabContainerWidth) { 372 tabContainer.scrollLeft = tabOffsetLeft + tabWidth - tabContainerWidth; 373 } 374 } 375 } 376 377 var tabContent = document.querySelector('.tab-content'); 378 var hammer = new Hammer(tabContent); 379 380 hammer.on('swiperight swipeleft', function(ev) { 381 handleSwipe(ev.type); 382 }); 383 384 function handleSwipe(swipeType) { 385 var activeTab = document.querySelector('.nav-tabs .active'); 386 var tabs = document.querySelectorAll('.nav-tabs li'); 387 var activeTabIndex = Array.from(tabs).indexOf(activeTab); 388 var tabCount = tabs.length; 389 390 if (swipeType === 'swiperight') { 391 var prevTabIndex = activeTabIndex > 0 ? activeTabIndex - 1 : tabCount - 1; 392 tabs[prevTabIndex].querySelector('a').click(); 393 } else if (swipeType === 'swipeleft') { 394 var nextTabIndex = activeTabIndex < tabCount - 1 ? activeTabIndex + 1 : 0; 395 tabs[nextTabIndex].querySelector('a').click(); 396 } 397 updateTabContainerPosition(); 398 } 399 400 jQuery('#left_button').click(function() { 401 handleSwipe('swiperight'); 402 }); 403 jQuery('#right_button').click(function() { 404 handleSwipe('swipeleft'); 405 }); 406}); 407 408document.addEventListener('DOMContentLoaded', function() { 409 var swiper = new Swiper('.swiper-container', { 410 slidesPerView: 1, 411 slidesPerGroup: 1, 412 spaceBetween: 30, 413 loop: true, 414 pagination: { 415 el: '.swiper-pagination', 416 clickable: true, 417 }, 418 breakpoints: { 419 767: { 420 slidesPerView: 2, 421 slidesPerGroup: 2, 422 spaceBetween: 30 423 } 424 } 425 }); 426}); 427 428document.addEventListener('DOMContentLoaded', function() { 429 var uniqueSwiperContainer = document.querySelector('.unique-swiper-container'); 430 431 if (uniqueSwiperContainer) { 432 var uniqueSwiper = new Swiper(uniqueSwiperContainer, { 433 slidesPerView: 1, 434 spaceBetween: 30, 435 loop: true, 436 autoplay: { 437 delay: 5000, 438 disableOnInteraction: false 439 }, 440 pagination: { 441 el: '.unique-swiper-pagination', 442 clickable: true, 443 }, 444 }); 445 446 // Initially disable autoplay 447 uniqueSwiper.autoplay.stop(); 448 449 function isElementInView(element) { 450 const rect = element.getBoundingClientRect(); 451 return ( 452 rect.top >= 0 && 453 rect.left >= 0 && 454 rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && 455 rect.right <= (window.innerWidth || document.documentElement.clientWidth) 456 ); 457 } 458 459 function checkSwiperVisibility() { 460 if (isElementInView(uniqueSwiperContainer)) { 461 uniqueSwiper.autoplay.start(); 462 } else { 463 uniqueSwiper.autoplay.stop(); 464 } 465 } 466 467 window.addEventListener('scroll', checkSwiperVisibility); 468 window.addEventListener('resize', checkSwiperVisibility); 469 checkSwiperVisibility(); // Initial check 470 471 } else { 472 /*console.error('Unique Swiper container element not found!');*/ 473 } 474}); 475 476 477jQuery(document).ready(function() { 478 if(window.innerWidth > 768) { 479 const pics = { 480 "pic-1": "https://useinsider.com/assets/media/2023/12/connect.png", 481 "pic-2": "https://useinsider.com/assets/media/2023/12/pers
481onalize.png", 482 "pic-3": "https://useinsider.com/assets/media/2023/12/orchestrate-1.png", 483 }; 484 485 let activePicId = "pic-1"; 486 document.getElementById('pic-container').src = pics[activePicId]; 487 jQuery("#pic-1").addClass("active"); 488 jQuery("#pic-1 .card-description").css("height", "auto"); 489 let dynamicHeight = jQuery("#pic-1 .card-description").height(); 490 jQuery("#pic-1 .card-description").height(dynamicHeight); 491 let autoChangeInterval; 492 493 function isElementInView(element) { 494 const rect = element.getBoundingClientRect(); 495 return ( 496 rect.top >= 0 && 497 rect.left >= 0 && 498 rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && 499 rect.right <= (window.innerWidth || document.documentElement.clientWidth) 500 ); 501 } 502 503 function checkRevampCpoVisibility() { 504 const revampCpo = document.getElementById('revamp-cpo'); 505 if (revampCpo && isElementInView(revampCpo)) { 506 if (!autoChangeInterval) { 507 autoChangeInterval = setInterval(simulateClick, 5000); 508 } 509 } else { 510 clearInterval(autoChangeInterval); 511 autoChangeInterval = null; 512 } 513 } 514 515 function simulateClick() { 516 const nextItemId = getNextItemId(); 517 jQuery(`#${nextItemId} .card-main-header`).click(); 518 } 519 520 function getNextItemId() { 521 const currentId = jQuery(".card-list-item.active").attr("id"); 522 const nextItem = jQuery(`#${currentId}`).next('.card-list-item'); 523 return nextItem.length ? nextItem.attr("id") : "pic-1"; 524 } 525
526 jQuery(window).on('scroll resize', checkRevampCpoVisibility); 527 checkRevampCpoVisibility(); // Initial check on page load 528 529 jQuery(".card-list-item .card-sub-title, .card-list-item .card-main-header").on("click", function () { 530 const selectedItem = jQuery(this).closest(".card-list-item"); 531 const selectedItemId = selectedItem.attr("id"); 532 533 jQuery(".card-list-item").removeClass("active"); 534 jQuery(".card-description").animate({height: "0"}, 300); 535 536 selectedItem.addClass("active"); 537 dynamicHeight = selectedItem.find(".card-description").css("height", "auto").height(); 538 selectedItem.find(".card-description").height(0).animate({height: dynamicHeight}, 300); 539 540 if (selectedItemId !== activePicId) { 541 activePicId = selectedItemId; 542 document.getElementById('pic-container').src = pics[activePicId]; 543 } 544 545 clearInterval(autoChangeInterval); 546 autoChangeInterval = null; 547 checkRevampCpoVisibility(); // Restart interval if needed 548 }); 549 } 550}); 551 552 553jQuery(document).ready(function(jQuery) { 554 document.querySelectorAll('.redirect-button').forEach(function (button) { 555 button.addEventListener('click', function (e) { 556 e.preventDefault(); 557 558 var emailInput = this.closest('.one_line_cta_email_container').querySelector('.one-line-email-input'); 559 var email = emailInput.value.trim(); 560 561 // Remove existing alert if present 562 removeAlert(emailInput.closest('.one_line_cta_email_container')); 563 564 if (!validateEmail(email)) { 565 showAlert('Please enter a valid email address.', emailInput.closest('.one_line_cta_email_container')); 566 return; 567 } 568 569 // Store the email in sessionStorage 570 sessionStorage.setItem('email', email); 571 572 var currentPath = window.location.pathname; 573 var langCode = ""; 574 var matches = currentPath.match(/^\/([a-z]{2})\//); 575 576 if (matches && matches[1]) { 577 langCode = "/" + matches[1]; 578 } 579 580 var targetUrl = langCode + "/request-a-demo/?ref=hp&one_line_form"; 581 // Redirect to the new path 582 window.location.href = targetUrl; 583 }); 584 }); 585 586 // Listen for Enter key submission on all inputs 587 document.querySelectorAll('.one-line-email-input').forEach(function (input) { 588 input.addEventListener('keypress', function (e) { 589 if (e.key === 'Enter') { 590 this.closest('.one_line_cta_email_container').querySelector('.redirect-button').click(); 591 } 592 }); 593 }); 594 595 // Function to validate email 596 function validateEmail(email) { 597 var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; 598 return emailRegex.test(email); 599 } 600 601 // Function to show custom alert 602 function showAlert(message, container) { 603 var alertMessage = document.createElement('p'); 604 alertMessage.textContent = message; 605 alertMessage.classList.add('custom-alert'); 606 alertMessage.style.color = 'red'; // Example styling 607 alertMessage.style.marginTop = '10px'; 608 alertMessage.style.textAlign = 'center'; // Center align the message 609 610 if (container) { 611 container.appendChild(alertMessage); 612 } 613 } 614 615 // Function to remove existing alert 616 function removeAlert(container) { 617 var existingAlert = container.querySelector('.custom-alert'); 618 if (existingAlert) { 619 existingAlert.remove(); 620 } 621 } 622 623});
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.