1(function ($) { 2 3 function herrington_section_start_render() { 4 var _elementor = typeof elementor != 'undefined' ? elementor : elementorFrontend; 5 6 _elementor.hooks.addFilter('pxl_section_start_render', function (html, settings, el) { 7 8 if (typeof settings.pxl_parallax_bg_img != 'undefined' && settings.pxl_parallax_bg_img.url != '') { 9 html += '<div class="pxl-section-bg-parallax"></div>'; 10 } 11 12 if (typeof settings.pxl_color_offset != 'undefined' && settings.pxl_color_offset != 'none') { 13 html += '<div class="pxl-section-overlay-color"></div>'; 14 } 15 16 if (typeof settings.pxl_overlay_img != 'undefined' && settings.pxl_overlay_img.url != '') { 17 html += '<div class="pxl-overlay--image pxl-overlay--imageLeft"><div class="bg-image"></div></div>'; 18 } 19 20 if (typeof settings.pxl_overlay_img2 != 'undefined' && settings.pxl_overlay_img2.url != '') { 21 html += '<div class="pxl-overlay--image pxl-overlay--imageRight"><div class="bg-image"></div></div>'; 22 } 23 24 return html; 25 }); 26 27 $('.pxl-section-bg-parallax').parent('.elementor-element').addClass('pxl-section-parallax-overflow'); 28 } 29 30 function herrington_column_before_render() { 31 var _elementor = typeof elementor != 'undefined' ? elementor : elementorFrontend; 32 _elementor.hooks.addFilter('pxl-custom-column/before-render', function (html, settings, el) { 33 if (typeof settings.pxl_column_parallax_bg_img != 'undefined' && settings.pxl_column_parallax_bg_img.url != '') { 34 html += '<div class="pxl-column-bg-parallax"></div>'; 35 } 36 return html; 37 }); 38 } 39 40 function herrington_css_inline_js() { 41 var _inline_css = "<style>"; 42 $(document).find('.pxl-inline-css').each(function () { 43 var _this = $(this); 44 _inline_css += _this.attr("data-css") + " "; 45 _this.remove(); 46 }); 47 _inline_css += "</style>"; 48 $('head').append(_inline_css); 49 } 50 51 function herrington_section_before_render() { 52 var _elementor = typeof elementor != 'undefined' ? elementor : elementorFrontend; 53 _elementor.hooks.addFilter('pxl-custom-section/before-render', function (html, settings, el) { 54 if (typeof settings['row_divider'] !== 'undefined') { 55 if (settings['row_divider'] == 'angle-top' || settings['row_divider'] == 'angle-bottom' || settings['row_divider'] == 'angle-top-right' || settings['row_divider'] == 'angle-bottom-left') { 56 html = '<svg class="pxl-row-angle" style="fill:#ffffff" xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 100 100" version="1.1" preserveAspectRatio="none" height="130px"><path stroke="" stroke-width="0" d="M0 100 L100 0 L200 100"></path></svg>'; 57 return html; 58 } 59 if (settings['row_divider'] == 'angle-top-bottom' || settings['row_divider'] == 'angle-top-bottom-left') { 60 html = '<svg class="pxl-row-angle pxl-row-angle-top" style="fill:#ffffff" xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 100 100" version="1.1" preserveAspectRatio="none" height="130px"><path stroke="" stroke-width="0" d="M0 100 L100 0 L200 100"></path></svg><svg class="pxl-row-angle pxl-row-angle-bottom" style="fill:#ffffff" xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 100 100" version="1.1" preserveAspectRatio="none" height="130px"><path stroke="" stroke-width="0" d="M0 100 L100 0 L200 100"></path></svg>'; 61 return html; 62 } 63 if (settings['row_divider'] == 'wave-animation-top' || settings['row_divider'] == 'wave-animation-bottom') { 64 html = '<svg class="pxl-row-angle" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1440 150" fill="#fff">
64<path d="M 0 26.1978 C 275.76 83.8152 430.707 65.0509 716.279 25.6386 C 930.422 -3.86123 1210.32 -3.98357 1439 9.18045 C 2072.34 45.9691 2201.93 62.4429 2560 26.198 V 172.199 L 0 172.199 V 26.1978 Z"><animate repeatCount="indefinite" fill="freeze" attributeName="d" dur="10s" values="M0 25.9086C277 84.5821 433 65.736 720 25.9086C934.818 -3.9019 1214.06 -5.23669 1442 8.06597C2079 45.2421 2208 63.5007 2560 25.9088V171.91L0 171.91V25.9086Z; M0 86.3149C316 86.315 444 159.155 884 51.1554C1324 -56.8446 1320.29 34.1214 1538 70.4063C1814 116.407 2156 188.408 2560 86.315V232.317L0 232.316V86.3149Z; M0 53.6584C158 11.0001 213 0 363 0C513 0 855.555 115.001 1154 115.001C1440 115.001 1626 -38.0004 2560 53.6585V199.66L0 199.66V53.6584Z; M0 25.9086C277 84.5821 433 65.736 720 25.9086C934.818 -3.9019 1214.06 -5.23669 1442 8.06597C2079 45.2421 2208 63.5007 2560 25.9088V171.91L0 171.91V25.9086Z"></animate></path></svg>'; 65 return html; 66 } 67 if (settings['row_divider'] == 'curved-top' || settings['row_divider'] == 'curved-bottom') { 68 html = '<svg class="pxl-row-angle" xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 1920 128" version="1.1" preserveAspectRatio="none" style="fill:#ffffff"><path stroke-width="0" d="M-1,126a3693.886,3693.886,0,0,1,1921,2.125V-192H-7Z"></path></svg>'; 69 return html; 70 } 71 } 72 }); 73 } 74 75 function herrington_svg_color($scope) { 76 "use strict"; 77 78 jQuery($scope).find('.pxl-grid .pxl-post--icon img').each(function () { 79 var $img = jQuery(this); 80 var imgID = $img.attr('id'); 81 var imgClass = $img.attr('class'); 82 var imgURL = $img.attr('src'); 83 84 jQuery.get(imgURL, function (data) { 85 var $svg = jQuery(data).find('svg'); 86 if (imgID) { 87 $svg.attr('id', imgID); 88 } 89 if (imgClass) { 90 $svg.attr('class', imgClass + ' replaced-svg'); 91 } 92 $svg.removeAttr('xmlns:a'); 93 if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) { 94 $svg.attr('viewBox', '0 0 24 24'); 95 } 96 $img.replaceWith($svg); 97 }, 'xml'); 98 }); 99 } 100 var PXL_Icon_Contact_Form = function ($scope, $) { 101 102 setTimeout(function () { 103 $('.pxl--item').each(function () { 104 var icon_input = $(this).find(".pxl--form-icon"), 105 control_wrap = $(this).find('.wpcf7-form-control'); 106 control_wrap.before(icon_input.clone()); 107 icon_input.remove(); 108 }); 109 }, 10); 110 111 }; 112 113 function herrington_split_text($scope) { 114 var st = $scope.find(".pxl-split-text"); 115 if (st.length == 0) return; 116 gsap.registerPlugin(SplitText); 117 118 st.each(function (index, el) { 119 var els = $(el).find('p').length > 0 ? $(el).find('p')[0] : el; 120 const pxl_split = new SplitText(els, { 121 type: "lines, words, chars", 122 lineThreshold: 0.5, 123 linesClass: "split-line" 124 }); 125 var split_type_set = pxl_split.chars; 126 127 gsap.set(els, { perspective: 400 }); 128 129 var settings = { 130 scrollTrigger: { 131 trigger: els, 132 toggleActions: "play none none none", 133 start: "top 86%", 134 once: true 135 }, 136 duration: 0.8, 137 stagger: 0.02, 138 ease: "Linear.easeNone" 139 }; 140 if ($(el).hasClass('split-in-fade')) { 141 settings.opacity = 0; 142 } 143 if ($(el).hasClass('split-in-right')) { 144 settings.opacity = 0; 145 settings.x = "50"; 146 } 147 if ($(el).hasClass('split-in-left')) { 148 settings.opacity = 0; 149 settings.x = "-50"; 150 } 151 if ($(el).hasClass('split-in-up')) { 152 settings.opacity = 0; 153 settings.y = "80"; 154 } 155 if ($(el).hasClass('split-in-down')) { 156 settings.opacity = 0; 157 settings.y = "-80"; 158 } 159 if ($(el).hasClass('split-in-rotate')) { 160 settings.opacity = 0; 161 settings.rotateX = "50deg"; 162 } 163 if ($(el).hasClass('split-in-scale')) { 164 settings.opacity = 0; 165 settings.scale = "0.5"; 166 } 167 168 if ($(el).hasClass('split-lines-transform')) { 169 pxl_split.split({ 170 type: "lines", 171 lineThreshold: 0.5, 172 linesClass: "split-line" 173 }); 174 split_type_set = pxl_split.lines; 175 settings.opacity = 0; 176 settings.yPercent = 100; 177 settings.autoAlpha = 0; 178 settings.stagger = 0.1; 179 } 180 if ($(el).hasClass('split-lines-rotation-x')) { 181 pxl_split.split({ 182 type: "lines", 183 lineThreshold: 0.5, 184 linesClass: "split-line" 185 }); 186 split_type_set = pxl_split.lines; 187 settings.opacity = 0; 188 settings.rotationX = -120; 189 settings.transformOrigin = "top center -50"; 190 settings.autoAlpha = 0; 191 settings.stagger = 0.1; 192 } 193 if ($(el).hasClass('btn-text-timeline')) { 194 settings.opacity = 0; 195 settings.scale = "1.2"; 196 settings.y = "-60"; 197 settings.transformOrigin = "top center -50"; 198 settings.autoAlpha = 0; 199 settings.stagger = 0.1; 200 } 201 202 if ($(el).hasClass('split-words-scale')) { 203 pxl_split.split({ type: "words" }); 204 split_type_set = pxl_split.words; 205 206 $(split_type_set).each(function (index, elw) { 207 gsap.set(elw, { 208 opacity: 0, 209 scale: index % 2 == 0 ? 0 : 2, 210 force3D: true, 211 duration: 0.1, 212 ease: "Linear.easeNone", 213 stagger: 0.02, 214 }, index * 0.01); 215 }); 216 217 var pxl_anim = gsap.to(split_type_set, { 218 scrollTrigger: { 219 trigger: el, 220 toggleActions: "play reverse play reverse", 221 start: "top 86%", 222 }, 223 rotateX: "0", 224 scale: 1, 225 opacity: 1, 226 }); 227 } else { 228 var pxl_anim = gsap.from(split_type_set, settings); 229 } 230 231 if ($(el).hasClass('hover-split-text')) { 232 $(el).mouseenter(function (e) { 233 pxl_anim.restart(); 234 }); 235 } 236 }); 237 } 238 239 function herrington_scroll_trigger($scope) { 240 ScrollTrigger.matchMedia({ 241 "(min-width: 1401px)": function () { 242 let t2 = gsap.timeline({ 243 scrollTrigger: { 244 trigger: ".pxl-section-scale",
245 scrub: true, 246 start: "top top", 247 end: "bottom bottom", 248 pin: ".pxl-section-sticky", 249 }, 250 }); 251 t2.to(".pxl-section-slide", { 252 padding: "7.5rem" 253 }, ">"); 254 t2.to(".pxl-sticky-mask", { 255 borderRadius: "2rem" 256 }, "<"); 257 t2.from(".is-shape-1", { 258 right: "-10%" 259 }, "<"); 260 t2.from(".is-shape-2", { 261 left: "-10%" 262 }, "<"); 263 }, 264 "(max-width: 1400px)": function () { 265 let t2 = gsap.timeline({ 266 scrollTrigger: { 267 trigger: ".pxl-section-scale", 268 scrub: true, 269 start: "top top", 270 end: "bottom bottom", 271 pin: ".pxl-section-sticky", 272 }, 273 }); 274 t2.to(".pxl-section-slide", { 275 padding: "4.8rem" 276 }, ">"); 277 t2.to(".pxl-sticky-mask", { 278 borderRadius: "1.6rem" 279 }, "<"); 280 t2.from(".is-shape-1", { 281 right: "-10%" 282 }, "<"); 283 t2.from(".is-shape-2", { 284 left: "-10%" 285 }, "<"); 286 }, 287 "(max-width: 991px)": function () { 288 let t2 = gsap.timeline({ 289 scrollTrigger: { 290 trigger: ".pxl-section-scale", 291 scrub: true, 292 start: "top bottom", 293 end: "bottom top", 294 }, 295 }); 296 t2.to(".pxl-section-slide", { 297 padding: "2rem" 298 }, ">"); 299 t2.to(".pxl-sticky-mask", { 300 borderRadius: "2rem" 301 }, "<"); 302 t2.from(".is-shape-1", { 303 right: "-10%" 304 }, "<"); 305 t2.from(".is-shape-2", { 306 left: "-10%" 307 }, "<"); 308 309 }, 310 }); 311 gsap.to(".pxl-sticker-shape.is-rotate", { 312 rotation: "800", 313 scrollTrigger: { 314 trigger: "#pxl-content-main", 315 scrub: true, 316 start: "top top", 317 end: "bottom bottom", 318 }, 319 }); 320 } 321 322 function herrington_zoom_point() { 323 elementorFrontend.waypoint($(document).find('.pxl-zoom-point'), function () { 324 var offset = $(this).offset(); 325 var offset_top = offset.top; 326 var scroll_top = $(window).scrollTop(); 327 }, { 328 offset: -100, 329 triggerOnce: true 330 }); 331 } 332 333 function herrington_logo_marquee($scope) { 334 const logos = $scope.find('.pxl-item--marquee'); 335 gsap.set(logos, { autoAlpha: 1 }) 336 337 logos.each(function (index, el) { 338 gsap.set(el, { xPercent: 100 * index }); 339 }); 340 341 if (logos.length > 2) { 342 const logosWrap = gsap.utils.wrap(-100, ((logos.length - 1) * 100)); 343 const durationNumber = logos.data('duration'); 344 const slipType = logos.data('slip-type'); 345 var slipResult = `-=${logos.length * 100}`; 346 if (slipType == 'right') { 347 slipResult = `+=${logos.length * 100}`; 348 } 349 gsap.to(logos, { 350 xPercent: slipResult, 351 duration: durationNumber, 352 repeat: -1, 353 ease: 'none', 354 modifiers: { 355 xPercent: xPercent => logosWrap(parseFloat(xPercent)) 356 } 357 }); 358 } 359 } 360 361 function herrington_text_marquee($scope) { 362 363 const text_marquee = $scope.find('.pxl-text--marquee'); 364 365 const boxes = gsap.utils.toArray(text_marquee); 366 367 const loop = text_horizontalLoop(boxes, { paused: false, repeat: -1, }); 368 369 function text_horizontalLoop(items, config) { 370 items = gsap.utils.toArray(items); 371 config = config || {}; 372 let tl = gsap.timeline({ repeat: config.repeat, paused: config.paused, defaults: { ease: "none" }, onReverseComplete: () => tl.totalTime(tl.rawTime() + tl.duration() * 100) }), 373 length = items.length, 374 startX = items[0].offsetLeft, 375 times = [], 376 widths = [], 377 xPercents = [], 378 curIndex = 0, 379 pixelsPerSecond = (config.speed || 1) * 100, 380 snap = config.snap === false ? v => v : gsap.utils.snap(config.snap || 1), 381 totalWidth, curX, distanceToStart, distanceToLoop, item, i; 382 gsap.set(items, { 383 xPercent: (i, el) => { 384 let w = widths[i] = parseFloat(gsap.getProperty(el, "width", "px")); 385 xPercents[i] = snap(parseFloat(gsap.getProperty(el, "x", "px")) / w * 100 + gsap.getProperty(el, "xPercent"));
386 return xPercents[i]; 387 } 388 }); 389 gsap.set(items, { x: 0 }); 390 totalWidth = items[length - 1].offsetLeft + xPercents[length - 1] / 100 * widths[length - 1] - startX + items[length - 1].offsetWidth * gsap.getProperty(items[length - 1], "scaleX") + (parseFloat(config.paddingRight) || 0); 391 for (i = 0; i < length; i++) { 392 item = items[i]; 393 curX = xPercents[i] / 100 * widths[i]; 394 distanceToStart = item.offsetLeft + curX - startX; 395 distanceToLoop = distanceToStart + widths[i] * gsap.getProperty(item, "scaleX"); 396 tl.to(item, { xPercent: snap((curX - distanceToLoop) / widths[i] * 100), duration: distanceToLoop / pixelsPerSecond }, 0) 397 .fromTo(item, { xPercent: snap((curX - distanceToLoop + totalWidth) / widths[i] * 100) }, { xPercent: xPercents[i], duration: (curX - distanceToLoop + totalWidth - curX) / pixelsPerSecond, immediateRender: false }, distanceToLoop / pixelsPerSecond) 398 .add("label" + i, distanceToStart / pixelsPerSecond); 399 times[i] = distanceToStart / pixelsPerSecond; 400 } 401 function toIndex(index, vars) { 402 vars = vars || {}; 403 (Math.abs(index - curIndex) > length / 2) && (index += index > curIndex ? -length : length); 404 let newIndex = gsap.utils.wrap(0, length, index), 405 time = times[newIndex]; 406 if (time > tl.time() !== index > curIndex) { 407 vars.modifiers = { time: gsap.utils.wrap(0, tl.duration()) }; 408 time += tl.duration() * (index > curIndex ? 1 : -1); 409 } 410 curIndex = newIndex; 411 vars.overwrite = true; 412 return tl.tweenTo(time, vars); 413 } 414 tl.next = vars => toIndex(curIndex + 1, vars); 415 tl.previous = vars => toIndex(curIndex - 1, vars); 416 tl.current = () => curIndex; 417 tl.toIndex = (index, vars) => toIndex(index, vars); 418 tl.times = times; 419 tl.progress(1, true).progress(0, true); 420 if (config.reversed) { 421 tl.vars.onReverseComplete(); 422 tl.reverse(); 423 } 424 return tl; 425 } 426 } 427 428 function herrington_scroll_fixed_section() { 429 const fixed_section_top = $('.pxl-section-fix-top'); 430 if (fixed_section_top.length > 0) { 431 ScrollTrigger.matchMedia({ 432 "(min-width: 991px)": function () { 433 const pinnedSections = ['.pxl-section-fix-top']; 434 pinnedSections.forEach(className => { 435 gsap.to(".pxl-section-fix-bottom", { 436 scrollTrigger: { 437 trigger: ".pxl-section-fix-bottom", 438 scrub: true, 439 pin: className, 440 pinSpacing: false, 441 start: 'top bottom', 442 end: "bottom top", 443 }, 444 }); 445 gsap.to(".pxl-section-fix-bottom .pxl-section-overlay-color", { 446 scrollTrigger: { 447 trigger: ".pxl-section-fix-bottom", 448 scrub: true, 449 pin: className, 450 pinSpacing: false, 451 start: 'top bottom', 452 end: "bottom top", 453 }, 454 }); 455 }); 456 } 457 }); 458 } 459 460 const section_overlay_color = $('.pxl-section-overlay-color'); 461 if (section_overlay_color.length > 0) { 462 const space_top = section_overlay_color.data('space-top'); 463 const space_left = section_overlay_color.data('space-left'); 464 const space_right = section_overlay_color.data('space-right'); 465 const space_bottom = section_overlay_color.data('space-bottom'); 466 467 const radius_top = section_overlay_color.data('radius-top'); 468 const radius_left = section_overlay_color.data('radius-left'); 469 const radius_right = section_overlay_color.data('radius-right'); 470 const radius_bottom = section_overlay_color.data('radius-bottom'); 471
472 const overlay_radius = radius_top + 'px ' + radius_right + 'px ' + radius_bottom + 'px ' + radius_left + 'px '; 473 474 ScrollTrigger.matchMedia({ 475 "(min-width: 991px)": function () { 476 const pinnedSections = ['.pxl-bg-color-scroll']; 477 pinnedSections.forEach(className => { 478 gsap.to(".overlay-type-scroll", { 479 scrollTrigger: { 480 trigger: ".pxl-bg-color-scroll", 481 scrub: true, 482 pinSpacing: false, 483 start: 'top bottom', 484 end: "bottom top", 485 }, 486 left: space_left + "px", 487 right: space_right + "px", 488 top: space_top + "px", 489 bottom: space_bottom + "px", 490 borderRadius: overlay_radius, 491 }); 492 }); 493 } 494 }); 495 } 496 } 497 function herrington_scroll_checkp($scope) { 498 $scope.find('.pxl-el-divider').each(function () { 499 var wcont1 = $(this); 500 501 502 function checkScrollPosition() { 503 var pxl_scroll_top = $(window).scrollTop(), 504 viewportBottom = pxl_scroll_top + $(window).height(), 505 elementTop = wcont1.offset().top, 506 elementBottom = elementTop + wcont1.outerHeight(); 507 508 if (elementTop < viewportBottom && elementBottom > pxl_scroll_top) { 509 wcont1.addClass('visible'); 510 } 511 } 512 513 checkScrollPosition(); 514 515 $(window).on('scroll', function () { 516 checkScrollPosition(); 517 }); 518 519 }); 520 } 521 function herrington_scroll_text($scope) { 522 $scope.find(".pxl-item--title.style-scroll-bg").each(function () { 523 var $container = $(this); 524 525 var text = new SplitText($container[0], { type: 'words, chars' }); 526 527 $(text.words).children().first().addClass("first-char"); 528 529 gsap.fromTo(text.chars, 530 { 531 position: 'relative', 532 display: 'inline-block', 533 opacity: 0.2, 534 x: -5, 535 }, 536 { 537 opacity: 1, 538 x: 0, 539 stagger: 0.1, 540 scrollTrigger: { 541 trigger: $container[0], 542 toggleActions: "play pause reverse pause", 543 start: "top 70%", 544 end: "top 40%", 545 scrub: 0.7, 546 } 547 } 548 ); 549 }); 550 } 551 var pxl_widget_elementor_handler = function ($scope, $) { 552 var spanElements1 = $scope.find('.pxl-chart'); 553 var pxl_chart_type = spanElements1.attr('type_canvas'); 554 var pxl_chart_bordercolor = spanElements1.attr('chart_border_color'); 555 var pxl_chart_borderwidth = spanElements1.attr('chart_border_width'); 556 var label_line_title = spanElements1.attr('label_line_title'); 557 var pxl_cutout = spanElements1.attr('cutout'); 558 559 var data = { 560 labels: [], 561 datasets: [{ 562 label: [], 563 data: [], 564 borderWidth: [], 565 backgroundColor: [], 566 tension: 0.4, 567 borderColor: [], 568 }] 569 }; 570 571 572 var spanElements = $scope.find('.pxl-chart span'); 573 spanElements.each(function () { 574 data.labels.push($(this).attr('chart_title')); 575 data.datasets[0].data.push(parseInt($(this).attr('chart_value'))); 576 data.datasets[0].backgroundColor.push($(this).attr('chart_color')); 577 //data.datasets[0].label.push($(this).attr('label_line_title'));
578 data.datasets[0].borderColor.push($(this).attr('chart_border_color')); 579 data.datasets[0].borderWidth.push($(this).attr('chart_border_width')); 580 }); 581 582 583 var config3 = { 584 type: pxl_chart_type, 585 data: data, 586 options: { 587 width: 1000, 588 responsive: true, 589 maintainAspectRatio: true, 590 cutout: pxl_cutout, 591 plugins: { 592 legend: false 593 }, 594 scales: { 595 596 } 597 } 598 }; 599 600 var chartElement = $scope.find('canvas'); 601 if (chartElement.length > 0) { 602 var chartId = chartElement.attr('id'); 603 var chart = Chart.getChart(chartId); 604 605 if (chart) { 606 chart.destroy(); 607 } 608 609 var myChartv3 = new Chart( 610 chartElement[0], 611 config3 612 ); 613 } 614 615 }; 616 function herrington_section_start_render2() { 617 618 var _elementor = typeof elementor != 'undefined' ? elementor : elementorFrontend; 619 620 _elementor.hooks.addFilter('pxl_section_start_render', function (html, settings, el) { 621 622 if (typeof settings.pxl_parallax_bg_img != 'undefined' && settings.pxl_parallax_bg_img.url != '') { 623 624 html += '<div class="pxl-section-bg-parallax"></div>'; 625 626 } 627 628 return html; 629 630 }); 631 632 } 633 634 function pxl_scroll_list_iconbox() { 635 636 $(".pxl-icons-list").each(function (index) { 637 if (window.innerWidth < 1201) { 638 return; 639 } 640 const parent = this; 641 const el = parent.querySelector(".pxl-image-scroll-bg"); 642 if (!el) return; 643 ScrollTrigger.getAll().forEach(st => { 644 if (st.vars && st.vars.id === "pxl-scroll-iconbox-" + index) { 645 st.kill(); 646 } 647 }); 648 649 const parentHeight = parent.offsetHeight; 650 const elHeight = el.offsetHeight; // 100vh 651 652 ScrollTrigger.create({ 653 id: "pxl-scroll-iconbox-" + index, 654 trigger: parent, 655 start: "top top", 656 end: () => "+=" + (parentHeight - elHeight), 657 pin: el, 658 pinSpacing: false, 659 scrub: false, 660 anticipatePin: 1 661 }); 662 }); 663 }; 664 665 function pxlIconsList1Active() { 666 const $items = $('.pxl-icons-list1 .list-item .pxl-iconbox-item'); 667 if (!$items.length) return; 668 669 let ticking = false; 670 671 const update = () => { 672 ticking = false; 673 const vh = window.innerHeight; 674 let $best = null, min = Infinity; 675 676 $items.each(function () { 677 const r = this.getBoundingClientRect(); 678 if (r.bottom <= 0 || r.top >= vh) return; 679 680 const d = Math.abs((r.top + r.bottom) / 2 - vh / 2); 681 if (d < min) { 682 min = d; 683 $best = $(this); 684 } 685 }); 686 687 if ($best && !$best.hasClass('active')) { 688 $items.removeClass('active'); 689 $best.addClass('active'); 690 } 691 }; 692 693 const onScroll = () => { 694 if (!ticking) { 695 ticking = true; 696 requestAnimationFrame(update); 697 } 698 }; 699 700 $(window).on('scroll', onScroll); 701 }; 702 703 function pxl_min_height_testimonial_desc($scope) { 704 const $carousels = $scope 705 ? $scope.find('.pxl-testimonial-carousel5') 706 : $('.pxl-testimonial-carousel5'); 707 708 if (!$carousels.length) return; 709 710 $carousels.each(function () { 711 const $descs = $(this).find('.pxl-swiper-slide .pxl-item--desc'); 712 if (!$descs.length) return; 713 714 let maxH = 0; 715 716 // reset trưá»c khi Äo 717 $descs.css('min-height', ''); 718 719 $descs.each(function () { 720 const h = this.getBoundingClientRect().height; 721 if (h > maxH) maxH = h; 722 }); 723 724 if (maxH > 0) { 725 $descs.css('min-height', maxH + 'px'); 726 } 727 }); 728 } 729 730 $(window).on('elementor/frontend/init', function () { 731 elementorFrontend.hooks.addAction('frontend/element_ready/global', function ($scope) { 732 herrington_svg_color($scope); 733 herrington_scroll_checkp($scope); 734 }); 735 herrington_section_start_render(); 736 herrington_section_start_render2(); 737 pxl_scroll_list_iconbox(); 738 pxlIconsList1Active(); 739 pxl_min_height_testimonial_desc(); 740 herrington_column_before_render(); 741 herrington_css_inline_js(); 742 herrington_section_before_render(); 743 herrington_zoom_point(); 744 herrington_scroll_fixed_section(); 745 elementorFrontend.hooks.addAction('frontend/element_ready/pxl_contact_form.default', PXL_Icon_Contact_Form); 746 elementorFrontend.hooks.addAction('frontend/element_ready/global', pxl_widget_elementor_handler); 747 elementorFrontend.hooks.addAction('frontend/element_ready/pxl_heading.default', function ($scope) { 748 herrington_split_text($scope); 749 herrington_scroll_text($scope); 750 }); 751 elementorFrontend.hooks.addAction('frontend/element_ready/pxl_text_editor.default', function ($scope) { 752 herrington_split_text($scope); 753 }); 754 elementorFrontend.hooks.addAction('frontend/element_ready/pxl_post_slip.default', function ($scope) { 755 herrington_split_text($scope); 756 }); 757 elementorFrontend.hooks.addAction('frontend/element_ready/pxl_section_scale.default', function ($scope) { 758 herrington_scroll_trigger($scope); 759 }); 760 elementorFrontend.hooks.addAction('frontend/element_ready/pxl_logo_marquee.default', function ($scope) { 761 herrington_logo_marquee($scope); 762 }); 763 elementorFrontend.hooks.addAction('frontend/element_ready/pxl_text_marquee.default', function ($scope) { 764 herrington_text_marquee($scope); 765 }); 766 });
767})(jQuery);
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.