https://www.sierranortemadrid.org/wp-content/plugins/dynamic-conte…/assets/js/scrolling.js?ver=3.4.7
1(function ($) { 2 var smoothScroll = null; 3 const math = { 4 lerp: (a, b, n) => { 5 return (1 - n) * a + n * b; 6 }, 7 norm: (value, min, max) => { 8 return (value - min) / (max - min); 9 }, 10 }; 11 12 const config = { 13 height: window.innerHeight, 14 width: window.innerWidth, 15 }; 16 17 class Smooth { 18 constructor() { 19 this.bindMethods(); 20 21 this.data = { 22 ease: coefSpeed_inertiaScroll || 0.05, 23 current: 0, 24 last: 0, 25 }; 26 27 this.dom = { 28 el: main, 29 content: mainWrap, 30 }; 31 32 this.rAF = null; 33 this.init(); 34 } 35 36 bindMethods() { 37 ["scroll", "run", "resize"].forEach( 38 (fn) => (this[fn] = this[fn].bind(this)), 39 ); 40 } 41 42 setStyles() { 43 Object.assign(this.dom.el.style, { 44 position: "fixed", 45 top: 0, 46 left: 0, 47 height: "100%", 48 width: "100%", 49 overflow: "hidden", 50 }); 51 } 52 53 setWidth() { 54 heightAdminBar = 0; 55 if ($("body").is(".admin-bar") && !elementorFrontend.isEditMode()) { 56 heightAdminBar = 45; 57 } 58 var larghezza = window.innerWidth; 59 var altezza = this.dom.el.offsetHeight + heightAdminBar; 60 61 // Total Length 62 var larghezzaTotale = 63 this.dom.el.offsetHeight + larghezza * sectionsAvailable.length; 64 65 // Body Height 66 var altezza = larghezzaTotale - this.dom.el.offsetWidth; 67 sizeTotalScroll = altezza; 68 document.body.style.height = `${altezza}px`; 69 70 var l = larghezza * sectionsAvailable.length; 71 // Wrapper 72 sectionsWrapper.width(`${l}px`); 73 // Section 74 sectionsAvailable.each(function (i, el) { 75 $(this).width(larghezza); 76 }); 77 } 78 79 setHeight() { 80 heightAdminBar = 0; 81 if ($("body").is(".admin-bar") && !elementorFrontend.isEditMode()) { 82 heightAdminBar = 45; 83 } 84 var height = this.dom.content.offsetHeight - heightAdminBar; 85 sizeTotalScroll = height; 86 document.body.style.height = `${height}px`; 87 } 88 89 preload() { 90 imagesLoaded(this.dom.content, (instance) => { 91 if (directionScroll == "vertical") { 92 this.setHeight(); 93 } else if (directionScroll == "horizontal") { 94 this.setWidth(); 95 } 96 }); 97 } 98 99 scroll() { 100 this.data.current = window.scrollY; 101 } 102 103 run() { 104 this.data.last = math.lerp( 105 this.data.last, 106 this.data.current, 107 this.data.ease, 108 ); 109 this.data.last = Math.floor(this.data.last * 100) / 100; 110 111 if (this.data.last < 0.1) { 112 this.data.last = 0; 113 } 114 115 const skewVal = skew_inertiaScroll; 116 const scaleVal = bounce_inertiaScroll; 117 const diff = this.data.current - this.data.last; 118 const acc = diff / config.width; 119 const velo = +acc; 120 const bounce = 1 - Math.abs(velo * scaleVal); 121 const skew = velo * skewVal; 122 123 var percentOfScroll = (this.data.current / sizeTotalScroll) * 100; 124 125 if (directionScroll == "vertical") { 126 var verticalmovement = this.data.last; 127 this.dom.content.style.transform = `translate3d(0, -${verticalmovement}px, 0) skewY(${skew}deg) scaleY(${bounce})`; 128 this.dom.content.style.transformOrigin = `50% ${percentOfScroll}% 0`; 129 } else if (directionScroll == "horizontal") { 130 var horizontalmovement = this.data.last; 131 this.dom.content.style.transform = `translate3d(-${horizontalmovement}px, 0, 0) skewX(${skew}deg) scaleY(${bounce})`; 132 this.dom.content.style.transformOrigin = `${percentOfScroll}% 50% 0`; 133 } 134 135 this.requestAnimationFrame(); 136 } 137 138 on() { 139 this.setStyles(); 140 if (directionScroll == "vertical") { 141 this.setHeight(); 142 } else if (directionScroll == "horizontal") { 143 this.setWidth(); 144 } 145 this.addEvents(); 146 147 this.requestAnimationFrame(); 148 } 149 150 off() { 151 this.cancelAnimationFrame(); 152 this.removeEvents(); 153 } 154 155 requestAnimationFrame() { 156 this.rAF = requestAnimationFrame(this.run); 157 } 158 159 cancelAnimationFrame() { 160 cancelAnimationFrame(this.rAF); 161 } 162 163 destroy() { 164 document.body.style.height = ""; 165 this.data = null; 166 167 this.removeEvents(); 168 this.cancelAnimationFrame(); 169 } 170 171 resize() { 172 if (directionScroll == "vertical") { 173 this.setHeight(); 174 } else if (directionScroll == "horizontal") { 175 this.setWidth(); 176 } 177 this.scroll(); 178 } 179 180 addEvents() { 181 window.addEventListener("resize", this.resize, { passive: true }); 182 window.addEventListener("scroll", this.scroll, { passive: true }); 183 } 184 185 removeEvents() { 186 window.removeEventListener("resize", this.resize, { 187 passive: true, 188 }); 189 window.removeEventListener("scroll", this.scroll, { 190 passive: true, 191 }); 192 } 193 194 init() { 195 this.preload(); 196 this.on(); 197 } 198 } 199 200 var settings_page = {}; 201 var sectionsAvailable = []; 202 var sections = ""; 203 var sectionsWrapper = null; 204 205 var heightAdminBar = 0; 206 var sizeTotalScroll = 0; 207 208 is_pageScroll = false;
209 // Scrollify 210 var is_scrollify = false, 211 titleStyle = "", 212 navStyle = "default"; 213 214 // ScrollEffects 215 var isScrollEffects = false; 216 var currentPostId; 217 var is_enable_dceScrolling, 218 is_enable_scrollify, 219 is_enable_scrollEffects, 220 is_enable_inertiaScroll; 221 222 var datalax = [ 223 "data-lax-opacity", 224 "data-lax-translate", 225 "data-lax-translate-x", 226 "data-lax-translate-y", 227 "data-lax-scale", 228 "data-lax-scale-x", 229 "data-lax-scale-y", 230 "data-lax-skew", 231 "data-lax-skew-x", 232 "data-lax-skew-y", 233 "data-lax-rotate", 234 "data-lax-rotate-x", 235 "data-lax-rotate-y", 236 "data-lax-brightness", 237 "data-lax-contrast", 238 "data-lax-hue-rotate", 239 "data-lax-blur", 240 "data-lax-invert", 241 "data-lax-saturate", 242 "data-lax-grayscale", 243 "data-lax-bg-pos", 244 "data-lax-bg-pos-x", 245 "data-lax-bg-pos-y", 246 "data-lax-anchor", 247 ]; 248 // InertiaScroll 249 250 // Version 1 251 var is_inertiaScroll = false; 252 var directionScroll = "vertical"; 253 var coefSpeed_inertiaScroll = 0.05; 254 255 // Version 2 256 const body = document.body; 257 var main = {}; 258 var mainWrap = {}; 259 var skew_inertiaScroll = 20; 260 var bounce_inertiaScroll = 0; 261 var requestId; 262 263 // Init - Page Snap 264 var init_Scrollify = function () { 265 $("body").addClass("dce-scrollify dce-scrolling"); 266 267 if (settings_page.custom_class_section_sfy) { 268 $customClass = settings_page.custom_class_section_sfy; 269 if ("." === settings_page.custom_class_section_sfy[0]) { 270 $customClass = 271 settings_page.custom_class_section_sfy.substring(1); 272 } 273 } else { 274 $customClass = 275 "elementor-section:not(.elementor-inner-section):not(.elementor-sticky__spacer)"; 276 } 277 278 target_sections = ".elementor-" + currentPostId; 279 if (!target_sections) { 280 target_sections = ""; 281 } 282 283 if (!$(".elementor-section-wrap").length) { 284 $("body .elementor").wrapInner( 285 '<div class="elementor-section-wrap"></div>', 286 ); 287 } 288 289 sections = 290 target_sections + 291 ".elementor .elementor-section-wrap ." + 292 $customClass; 293 sectionsWrapper = $( 294 target_sections + ".elementor .elementor-section-wrap", 295 ); 296 297 // Class direction 298 $(target_sections).addClass( 299 "scroll-direction-" + settings_page.directionScroll, 300 ); 301 302 $.scrollify({ 303 section: sections, 304 sectionName: "id", 305 interstitialSection: settings_page.interstitialSection, 306 easing: "easeOutExpo", 307 scrollSpeed: Number(settings_page.scrollSpeed.size) || 1100, 308 offset: Number(settings_page.offset.size) || 0, 309 scrollbars: Boolean(settings_page.scrollBars), 310 setHeights: Boolean(settings_page.setHeights), 311 overflowScroll: Boolean(settings_page.overflowScroll), 312 updateHash: Boolean(settings_page.updateHash), 313 touchScroll: Boolean(settings_page.touchScroll), 314 before: function (i, panels) { 315 var ref = panels[i].attr("data-id"); 316 $(".dce-scrollify-pagination .nav__item--current").removeClass( 317 "nav__item--current", 318 ); 319 $(".dce-scrollify-pagination") 320 .find('a[href="#' + ref + '"]') 321 .addClass("nav__item--current"); 322 }, 323 afterRender: function () { 324 is_scrollify = true; 325 if ( 326 settings_page.enable_scrollify_nav || 327 elementorFrontend.isEditMode() 328 ) { 329 var scrollify_pagination = ""; 330 createNavigation(settings_page.snapscroll_nav_style); 331 332 // At pagination click 333 $("body").on( 334 "click", 335 ".dce-scrollify-pagination a", 336 function () { 337 $.scrollify.move($(this).attr("href")); 338 return false; 339 }, 340 ); 341 342 if (!Boolean(settings_page.enable_scrollify_nav)) { 343 handleScrollify_enablenavigation(""); 344 } 345 if (Boolean(settings_page.enable_scrollEffects)) { 346 handleScrollEffects(settings_page.enable_scrollEffects); 347 } 348 } 349 }, 350 }); 351 $.scrollify.update(); 352 }; 353 var createNavigationTitles = function ($style, $reload = false) { 354 titleStyle = $style; 355 if ($reload) { 356 createNavigation(settings_page.snapscroll_nav_style); 357 } 358 }; 359 var createNavigation = function ($style) { 360 navStyle = $style; 361 362 if ($(".dce-scrollify-pagination").length > 0) 363 $(".dce-scrollify-pagination").remove(); 364 365 var newPagination = ""; 366 var activeClass; 367 var titleString; 368 createNavigationTitles(settings_page.snapscroll_nav_title_style); 369 370 newPagination = 371 '<ul class="dce-scrollify-pagination nav--' + $style + '">'; 372 373 if ($style == "ayana") { 374 newPagination += 375 '<svg class="hidden"><defs><symbol id="icon-circle" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6.215"></circle></symbol></defs></svg>'; 376 } 377 if ($style == "desta") { 378 newPagination += 379 '<svg class="hidden"><defs><symbol id="icon-triangle" viewBox="0 0 24 24">
379<path d="M4.5,19.8C4.5,19.8,4.5,19.8,4.5,19.8V4.2c0-0.3,0.2-0.5,0.4-0.7c0.2-0.1,0.5-0.1,0.8,0l13.5,7.8c0.2,0.1,0.4,0.4,0.4,0.7c0,0.3-0.2,0.5-0.4,0.7L5.7,20.4c-0.1,0.1-0.3,0.1-0.5,0.1C4.8,20.6,4.5,20.2,4.5,19.8z M6,5.6v12.8L17.2,12L6,5.6z"/></symbol></defs></svg>'; 380 } 381 $(sections).each(function (i) { 382 activeClass = ""; 383 if (i === 0) { 384 activeClass = "nav__item--current"; 385 } 386 387 if (titleStyle == "number") { 388 var prefN = ""; 389 if (i < 9) { 390 prefN = "0"; 391 } 392 titleString = prefN + (i + 1); 393 } else if (titleStyle == "classid") { 394 titleString = $(this).attr("id") || "no id"; 395 titleString = titleString.replace(/_|-|\./g, " "); 396 } else { 397 titleString = ""; 398 } 399 400 if ($style == "default") { 401 newPagination += 402 '<li><a class="' + 403 activeClass + 404 '" href="#' + 405 $(this).attr("data-id") + 406 '"></a></li>'; 407 } else { 408 $itemInner = ""; 409 $itemTitle = 410 '<span class="nav__item-title">' + titleString + "</span>"; 411 412 if ($style == "etefu") { 413 $itemInner = '<span class="nav__item-inner"></span>'; 414 } else if ($style == "ayana") { 415 $itemTitle = 416 '<svg class="nav__icon"><use xlink:href="#icon-circle"></use></svg>'; 417 } else if ($style == "totit") { 418 var navIcon = settings_page.scrollify_nav_icon.value; 419 if (navIcon) 420 $itemInner = 421 '<i class="nav__icon ' + 422 navIcon + 423 '" aria-hidden="true"></i>'; 424 } else if ($style == "desta") { 425 $itemInner = 426 '<svg class="nav__icon"><use xlink:href="#icon-triangle"></use></svg>'; 427 } else if ( 428 $style == "magool" || 429 $style == "ayana" || 430 $style == "timiro" 431 ) { 432 $itemTitle = ""; 433 } 434 newPagination += 435 '<li><a href="#' + 436 $(this).attr("data-id") + 437 '" class="' + 438 activeClass + 439 ' nav__item" aria-label="' + 440 (i + 1) + 441 '">' + 442 $itemInner + 443 $itemTitle + 444 "</a></li>"; 445 } 446 }); 447 newPagination += "</ul>"; 448 449 $("body").append(newPagination); 450 }; 451 452 // Init - Scroll Effects 453 function initScrollEffects() { 454 $("body").addClass("dce-pageScroll dce-scrolling"); 455 456 let customClass = "elementor-section:not(.elementor-inner-section)"; 457 if (settings_page.custom_class_section) { 458 customClass = settings_page.custom_class_section.replace(/^\./, ''); 459 } 460 461 let target_sections = ".elementor-" + currentPostId; 462 if (!target_sections) { 463 target_sections = ""; 464 } 465 466 // Build the correct selector 467 const sections = target_sections + " ." + customClass; 468 sectionsAvailable = $(sections); 469 470 // Class direction 471 $(target_sections).addClass("scroll-direction-" + settings_page.directionScroll); 472 473 // property 474 animationType = settings_page.animation_effects || ["scaleDown"]; 475 var animationType_string = ""; 476 477 if (Array.isArray(animationType) && animationType.length) { 478 animationType_string = animationType.join(" "); 479 } else if (typeof animationType === 'string') { 480 animationType_string = animationType; 481 } 482 483 // Determine starting section for scroll effects 484 var startingSection = 0; 485 if (settings_page.remove_first_scrollEffects) { 486 startingSection = 1; 487 } 488 489 sectionsAvailable.each(function () { 490 if ($(this).index() >= startingSection) { 491 $(this).addClass("lax"); 492 } 493 }); 494 495 lax.init() 496 497 // Add a driver that we use to control our animations 498 lax.addDriver('scrollY', function () { 499 return window.scrollY 500 }, { 501 inertiaEnabled: true, 502 inertia: 0.1, 503 frameStep: 1 504 }) 505 506 const presets = { 507 scaleDown: { 508 scale: [ 509 ["elInY", "elCenterY", "elOutY"], 510 [0, 1, 1], 511 { 512 easing: 'easeOutQuad' 513 } 514 ] 515 }, 516 opacity: { 517 opacity: [ 518 ["elInY", "elCenterY", "elOutY"], 519 [0, 1, 1], 520 { 521 easing: 'easeOutQuad' 522 } 523 ] 524 }, 525 fixed: { 526 translateY: [ 527 ["elInY", "elCenterY", "elOutY"], 528 [0, 0, -window.innerHeight], 529 { 530 easing: 'easeOutQuad' 531 } 532 ] 533 }, 534 rotation: { 535 rotate: [ 536 ["elInY", "elCenterY", "elOutY"], 537 [30, 0, 0], 538 { 539 easing: 'easeOutQuad' 540 } 541 ] 542 }, 543 spin: { 544 rotate: [ 545 ["elInY", "elCenterY", "elOutY"], 546 [-180, 0, 0], 547 { 548 easing: 'easeOutQuad' 549 } 550 ] 551 }, 552 spinRev: { 553 rotate: [ 554 ["elInY", "elCenterY", "elOutY"], 555 [180, 0, 0], 556 { 557 easing: 'easeOutQuad' 558 } 559 ] 560 }, 561 leftToRight: { 562 translateX: [ 563 ["elInY", "elCenterY", "elOutY"], 564 [-window.innerWidth, 0, 0], 565 { 566 easing: 'easeOutQuad' 567 } 568 ] 569 }, 570 rightToLeft: { 571 translateX: [ 572 ["elInY", "elCenterY", "elOutY"], 573 [window.innerWidth, 0, 0], 574 { 575 easing: 'easeOutQuad' 576 } 577 ] 578 }, 579 zoomInOut: { 580 scale: [ 581 ["elInY", "elCenterY", "elOutY"], 582 [0, 1, 1], 583 { 584 easing: 'easeOutQuad' 585 } 586 ] 587 }, 588 zoomIn: { 589 scale: [ 590 ["elInY", "elCenterY", "elOutY"], 591 [0.5, 1, 1], 592 { 593 easing: 'easeOutQuad' 594 } 595 ] 596 }, 597 zoomOut: { 598 scale: [ 599 ["elInY", "elCenterY", "elOutY"], 600 [1.5, 1, 1], 601 { 602 easing: 'easeOutQuad' 603 } 604 ] 605 }, 606 driftLeft: { 607 translateX: [ 608 ["elInY", "elCenterY", "elOutY"], 609 [100, 0, 0], 610 { 611 easing: 'easeOutQuad' 612 } 613 ] 614 }, 615 driftRight: { 616 translateX: [ 617 ["elInY", "elCenterY", "elOutY"], 618 [-100, 0, 0], 619 { 620 easing: 'easeOutQuad' 621 } 622 ] 623 }, 624 slalom: { 625 translateX: [ 626 ["elInY", "elCenterY", "elOutY"], 627 [-50, 50, 50], 628 { 629 easing: 'easeInOutQuad' 630 } 631 ] 632 }, 633 lazy: { 634 translateY: [ 635 ["elInY", "elCenterY", "elOutY"], 636 [0, 0, 0], 637 { 638 easing: 'easeOutQuad' 639 } 640 ] 641 }, 642 eager: { 643 translateY: [ 644 ["elInY", "elCenterY", "elOutY"], 645 [100, 0, 0], 646 { 647 easing: 'easeOutQuad' 648 } 649 ] 650 }, 651 swing: { 652 rotate: [ 653 ["elInY", "elCenterY", "elOutY"], 654 [-10, 10, 10], 655 { 656 easing: 'easeInOutQuad' 657 } 658 ] 659 }, 660 speedy: { 661 translateY: [ 662 ["elInY", "elCenterY", "elOutY"], 663 [-100, 0, 0], 664 { 665 easing: 'easeInOutQuad' 666 } 667 ], 668 rotate: [ 669 ["elInY", "elCenterY", "elOutY"], 670 [10, 0, 0], 671 { 672 easing: 'easeInOutQuad' 673 } 674 ] 675 } 676 }; 677 678 const selectedEffects = (animationType_string || "").split(" ").filter(
678Boolean); 679 680 lax.addElements('.lax', { 681 scrollY: selectedEffects.reduce((acc, effect) => { 682 if (presets[effect]) { 683 return { ...acc, ...presets[effect] }; 684 } 685 return acc; 686 }, {}) 687 }); 688 689 isScrollEffects = true; 690 } 691 692 // Init - Inertia Scroll 693 var initInertiaScroll = function () { 694 if (settings_page.custom_class_section) { 695 $customClass = settings_page.custom_class_section; 696 } else { 697 $customClass = "elementor-top-section"; 698 } 699 700 // SPEED 701 if (typeof settings_page.coefSpeed_inertiaScroll.size !== "undefined") 702 coefSpeed_inertiaScroll = Number( 703 settings_page.coefSpeed_inertiaScroll.size, 704 ); 705 // SKEW 706 if (typeof settings_page.skew_inertiaScroll.size !== "undefined") 707 skew_inertiaScroll = Number(settings_page.skew_inertiaScroll.size); 708 // BOUNCE 709 if (typeof settings_page.bounce_inertiaScroll.size !== "undefined") 710 bounce_inertiaScroll = Number( 711 settings_page.bounce_inertiaScroll.size, 712 ); 713 // DIRECTIONS 714 if (typeof settings_page.directionScroll !== "undefined") 715 directionScroll = settings_page.directionScroll || "vertical"; 716 717 target_sections = ".elementor-" + currentPostId; 718 if (!target_sections) { 719 target_sections = ""; 720 } 721 722 if (!$(".elementor-section-wrap").length) { 723 $("body .elementor").wrapInner( 724 '<div class="elementor-section-wrap"></div>', 725 ); 726 } 727 728 // Get the section widgets of first level in content-page 729 sections = 730 target_sections + 731 ".elementor .elementor-section-wrap ." + 732 $customClass; 733 sectionsAvailable = $(sections); 734 sectionsWrapper = $( 735 target_sections + ".elementor .elementor-section-wrap", 736 ); 737 738 // Define Wrapper 739 if ($(".elementor-template-canvas").length) { 740 main = document.querySelector(target_sections); 741 mainWrap = document.querySelector( 742 target_sections + ".elementor .elementor-section-wrap", 743 ); 744 } else { 745 if (settings_page.automatic_wrapper) { 746 if (!$("#outer-wrap").length) { 747 $("body .elementor").wrapInner( 748 '<div id="outer-wrap"><div id="wrap"></div></div>', 749 ); 750 } 751 main = document.querySelector("#outer-wrap"); 752 mainWrap = document.querySelector("#wrap"); 753 } else { 754 main = 755 document.querySelector(settings_page.scroll_viewport) || 756 document.querySelector("#outer-wrap"); 757 mainWrap = 758 document.querySelector( 759 settings_page.scroll_contentScroll, 760 ) || document.querySelector("#wrap"); 761 } 762 } 763 764 // per distribuire le section orizzontalmente 765 if (directionScroll == "horizontal") { 766 sectionsWrapper.css("display", "flex"); 767 } 768 769 // Class direction 770 $(target_sections).addClass("scroll-direction-" + directionScroll); 771 772 // configure 773 sectionsAvailable.addClass("inertia-scroll"); 774 775 if (smoothScroll) { 776 smoothScroll.destroy(); 777 } 778 779 smoothScroll = new Smooth(); 780 is_inertiaScroll = true; 781 }; 782 783 function reloadScrolling() { 784 if (settings_page.enable_dceScrolling) { 785 handlescroll_viewport(""); 786 handlescroll_viewport("yes"); 787 } 788 } 789 790 // UTIL ScrollEffects ---------------------------------------- 791 function removeScrollEffects() { 792 $("body").removeClass("dce-pageScroll"); 793 if (sectionsAvailable.length) sectionsAvailable.removeClass("lax"); 794 795 if (lax && typeof lax !== "undefined") { 796 lax.removeElements('.lax'); 797 } 798 799 window.cancelAnimationFrame(requestId); 800 isScrollEffects = false; 801 } 802 803 // UTIL Inertia ---------------------------------------- 804 function removeInertiaScroll() { 805 $("body").removeClass("dce-inertiaScroll"); 806 if (sectionsAvailable.length) 807 sectionsAvailable.removeClass("inertia-scroll"); 808 809 sectionsAvailable.each(function (i, el) { 810 $(this).removeAttr("style"); 811 }); 812 sectionsWrapper.removeAttr("style"); 813 814 smoothScroll.destroy(); 815 is_inertiaScroll = false; 816 817 $(main).removeAttr("style"); 818 $(mainWrap).removeAttr("style"); 819 } 820 821 // Change CallBack 822 function handlescroll_viewport(newValue) { 823 is_pageScroll = Boolean(newValue); 824 if (settings_page.enable_scrollEffects) handleScrollEffects(newValue); 825 if (settings_page.enable_scrollify) handleScrollify(newValue); 826 if (settings_page.enable_inertiaScroll) handleInertiaScroll(newValue); 827 } 828 829 // Change CallBack SCROLLIFY 830 function handleScrollify(newValue) { 831 if (newValue) { 832 if (is_scrollify) { 833 $.scrollify.enable(); 834 } 835 init_Scrollify(); 836 handleScrollify_enablenavigation( 837 settings_page.enable_scrollify_nav, 838 ); 839 } else { 840 // NO 841 $.scrollify.destroy(); 842 if (sectionsAvailable.length) { 843 sectionsAvailable.removeAttr("style"); 844 } 845 handleScrollify_enablenavigation(""); 846 847 is_scrollify = false;
848 } 849 } 850 function handleScrollify_speed(newValue) { 851 $.scrollify.setOptions({ scrollSpeed: newValue.size }); 852 } 853 function handleScrollify_interstitialSection(newValue) { 854 $.scrollify.setOptions({ scrollSpeed: newValue }); 855 } 856 function handleScrollify_offset(newValue) { 857 $.scrollify.setOptions({ offset: newValue.size }); 858 } 859 function handleScrollify_ease(newValue) { 860 $.scrollify.setOptions({ easing: newValue }); 861 } 862 function handleScrollify_setHeights(newValue) { 863 $.scrollify.setOptions({ setHeights: newValue ? true : false }); 864 } 865 function handleScrollify_overflowScroll(newValue) { 866 $.scrollify.setOptions({ overflowScroll: newValue ? true : false }); 867 } 868 function handleScrollify_updateHash(newValue) { 869 $.scrollify.setOptions({ updateHash: newValue ? true : false }); 870 } 871 function handleScrollify_touchScroll(newValue) { 872 $.scrollify.setOptions({ touchScroll: newValue ? true : false }); 873 } 874 function handleScrollify_scrollBars(newValue) { 875 $.scrollify.setOptions({ scrollbars: newValue ? true : false }); 876 } 877 function handleScrollify_enablenavigation(newValue) { 878 if (newValue) { 879 $("body") 880 .addClass("dce-scrollify") 881 .find(".dce-scrollify-pagination") 882 .show(); 883 } else { 884 $("body") 885 .removeClass("dce-scrollify") 886 .find(".dce-scrollify-pagination") 887 .hide(); 888 } 889 } 890 function handleScrollify_navstyle(newValue) { 891 if (newValue) { 892 createNavigation(newValue); 893 } 894 } 895 function handleScrollify_titlestyle(newValue) { 896 if (newValue) { 897 createNavigationTitles(newValue, true); 898 } 899 } 900 // Change CallBack SCROLL-EFFECTS 901 function handleScrollEffects(newValue) { 902 if (newValue) { 903 if (isScrollEffects) { 904 removeScrollEffects(); 905 } 906 initScrollEffects(); 907 } else { 908 removeScrollEffects(); 909 } 910 } 911 function handleScrollEffects_animations(newValue) { 912 var animationType_string = newValue.join(" "); 913 if (newValue.length) { 914 removeScrollEffects(); 915 initScrollEffects(); 916 } 917 918 reloadScrolling(); 919 } 920 function handleScrollEffects_removefirst(newValue) { 921 removeScrollEffects(); 922 initScrollEffects(); 923 } 924 925 // Change CallBack INERTIA-SCROLL 926 function handleInertiaScroll(newValue) { 927 if (newValue) { 928 if (is_inertiaScroll) { 929 removeInertiaScroll(); 930 } 931 if (settings_page.enable_inertiaScroll) { 932 initInertiaScroll(); 933 } 934 } else { 935 removeInertiaScroll(); 936 } 937 } 938 function handleInertiaScroll_direction(newValue) { 939 directionScroll = newValue; 940 if (newValue) { 941 if (is_inertiaScroll) { 942 removeInertiaScroll(); 943 } 944 if (settings_page.enable_inertiaScroll) { 945 initInertiaScroll(); 946 } 947 } else { 948 removeInertiaScroll(); 949 } 950 } 951 952 $(window).on("elementor/frontend/init", function () { 953 elementorFrontend.hooks.addAction("frontend/element_ready/global", function () { 954 if (typeof elementorFrontendConfig.settings.page !== "undefined") { 955 settings_page = elementorFrontendConfig.settings.page; 956 currentPostId = elementorFrontendConfig.post.id; 957 958 // Check if scrolling is enabled globally 959 if (!settings_page.enable_dceScrolling) { 960 return; 961 } 962 963 var deviceMode = $("body").attr("data-elementor-device-mode"); 964 965 // Initialize only the effects that are enabled and compatible with the device 966 if (settings_page.enable_scrollEffects && 967 settings_page.responsive_scrollEffects && 968 $.inArray(deviceMode, settings_page.responsive_scrollEffects) >= 0) { 969 initScrollEffects(); 970 } 971 972 if (settings_page.enable_scrollify && 973 settings_page.responsive_snapScroll && 974 $.inArray(deviceMode, settings_page.responsive_snapScroll) >= 0) { 975 init_Scrollify(); 976 } 977 978 if (settings_page.enable_inertiaScroll && 979 settings_page.responsive_inertiaScroll && 980 $.inArray(deviceMode, settings_page.responsive_inertiaScroll) >= 0) { 981 initInertiaScroll(); 982 } 983 984 // Editor mode callbacks 985 if (elementorFrontend.isEditMode()) { 986 if (elementor) { 987 settings_page = 988 elementor.settings.page.model.attributes; 989 990 elementor.settings.page.addChangeCallback( 991 "enable_dceScrolling", 992 handlescroll_viewport, 993 ); 994 995 // Scrollify 996 elementor.settings.page.addChangeCallback( 997 "enable_scrollify", 998 handleScrollify, 999 ); 1000 elementor.settings.page.addChangeCallback( 1001 "scrollSpeed", 1002 handleScrollify_speed, 1003 ); 1004 elementor.settings.page.addChangeCallback( 1005 "offset", 1006 handleScrollify_offset, 1007 ); 1008 elementor.settings.page.addChangeCallback( 1009 "ease_scrollify", 1010 handleScrollify_ease, 1011 ); 1012 elementor.settings.page.addChangeCallback( 1013 "setHeights", 1014 handleScrollify_setHeights, 1015 ); 1016 elementor.settings.page.addChangeCallback( 1017 "overflowScroll", 1018 handleScrollify_overflowScroll, 1019 ); 1020 elementor.settings.page.addChangeCallback( 1021 "updateHash", 1022 handleScrollify_updateHash, 1023 ); 1024 elementor.settings.page.addChangeCallback( 1025 "scrollBars", 1026 handleScrollify_scrollBars, 1027 ); 1028 elementor.settings.page.addChangeCallback( 1029 "touchScroll", 1030 handleScrollify_touchScroll, 1031 ); 1032 elementor.settings.page.addChangeCallback( 1033 "enable_scrollify_nav", 1034 handleScrollify_enablenavigation, 1035 ); 1036 elementor.settings.page.addChangeCallback( 1037 "snapscroll_nav_style", 1038 handleScrollify_navstyle, 1039 ); 1040 elementor.settings.page.addChangeCallback( 1041 "snapscroll_nav_title_style", 1042 handleScrollify_titlestyle, 1043 ); 1044 1045 // ScrollEffects 1046 elementor.settings.page.addChangeCallback( 1047 "enable_scrollEffects", 1048 handleScrollEffects, 1049 ); 1050 elementor.settings.page.addChangeCallback( 1051 "animation_effects", 1052 handleScrollEffects_animations, 1053 ); 1054 elementor.settings.page.addChangeCallback( 1055 "remove_first_scrollEffects", 1056 handleScrollEffects_removefirst, 1057 ); 1058 1059 // InertiaScroll 1060 elementor.settings.page.addChangeCallback( 1061 "enable_inertiaScroll", 1062 handleInertiaScroll, 1063 ); 1064 elementor.settings.page.addChangeCallback( 1065 "directionScroll", 1066 handleInertiaScroll_direction, 1067 ); 1068 1069 elementor.settings.page.addChangeCallback( 1070 "coefSpeed_inertiaScroll", 1071 handleInertiaScroll, 1072 ); 1073 elementor.settings.page.addChangeCallback( 1074 "skew_inertiaScroll", 1075 handleInertiaScroll, 1076 ); 1077 elementor.settings.page.addChangeCallback( 1078 "bounce_inertiaScroll", 1079 handleInertiaScroll, 1080 ); 1081 } 1082 } 1083 } 1084 }); 1085 }); 1086})(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.