1$(function () { 2 var headerHeight = $('header').outerHeight(); 3 var footerHeight = $('footer').outerHeight(); 4 if ($('#wpadminbar').length) { 5 adminBar = $('#wpadminbar').outerHeight(); 6 }else{ 7 adminBar = 0; 8 } 9 $('#offCanvas,.sticky-form-popup').css({ 10 'top': 0, 11 'padding-top': headerHeight + adminBar 12 }); 13 $('.fade-sections').css({ 14 'height': window.innerHeight 15 }) 16 $('.inner-top-padding').css({ 17 'padding-top': headerHeight 18 }) 19 // mobile menu style 20 $('.mobile_menu_button .triggerMobileMenu').click(function () { 21 $(this).toggleClass('open'); 22 var targetID = $(this).data('toggle'); 23 $('#' + targetID).toggleClass('is-open'); 24 $(this).find('.tab').toggleClass('active'); 25 $('body').toggleClass('has-overflow'); 26 setTimeout(function () { 27 set_visible_objects(); 28 }, 500) 29 }); 30 $('ul#mobile-menu li a').click(function(){ 31 if (!$(this).parent().hasClass('menu-item-has-children')) { 32 $('body').toggleClass('has-overflow'); 33 $('.off-canvas').toggleClass('is-open'); 34 } 35 }); 36 $('ul#mobile-menu > li > a').each(function(){ 37 $(this).contents().eq(0).wrap('<span></span>') 38 });
39 /////// slow scroll ////// 40 $('ul#main-menu li a,.button,.jumper').click(function(e){ 41 var scrollToElement = e.currentTarget.hash; 42 if ($(scrollToElement).hasClass('popup')) { 43 $(scrollToElement).addClass('active-popup') 44 } else if ($(scrollToElement).length){ 45 e.preventDefault(); 46 if ($('.plans-header').length) { 47 $('.plans-header').addClass('fixed'); 48 fixed_sub_header = $('.plans-header.fixed').outerHeight(); 49 } else { 50 fixed_sub_header = 0 51 } 52 53 var scrollTo = headerHeight + adminBar + fixed_sub_header; 54 $('html, body').animate({ 55 scrollTop: $(scrollToElement).offset().top - scrollTo 56 }, 1000); 57 } 58 }); 59 60 $('ul.open_menu > li > ul > li.menu-item-has-children > a').on('click', function (e) { 61 // var container = $("ul.open_menu > li > ul > li.menu-item-has-children > a"); 62 // if the target of the click isn't the container nor a descendant of the container 63 // if (!container.is(e.target) && container.has(e.target).length === 0) { 64 e.preventDefault() 65 $(this).parent('li.menu-item-has-children').toggleClass('show').find('ul').slideToggle(); 66 // } 67 }); 68 69 if ($(window).width() < 768) { 70 $('ul.open_menu > li.menu-item-has-children > a').on('click', function (e) { 71 e.preventDefault() 72 $('.off-canvas').addClass('is-open'); 73 $(this).parent().toggleClass('show').find('ul').first().slideToggle(); 74 }); 75 } 76 77 if ($('.home-popup').length) { 78 setTimeout(function () { 79 $('.home-popup').addClass('active-popup'); 80 }, 5000) 81 } 82 83 $('.single-member').find('.plus').click(function () { 84 $(this).parents('.single-member').find('.popup').addClass('active-popup'); 85 }); 86 $('.signup-form').click(function () { 87 $('.signup-form-popup').addClass('active-popup'); 88 }); 89 $('.create-event-button').click(function () { 90 $('.create-event-popup').addClass('active-popup'); 91 }); 92 93 $('.open-search-popup').click(function () { 94 $('.search-popup').addClass('active-popup'); 95 setTimeout(function () { 96 $('.search-popup').find('.searchform input[type=text]').focus(); 97 }, 1000) 98 }); 99 100 101 $(document).mouseup(function (e) { 102 if ($('.popup.active-popup').length) { 103 var container = $('.popup-content'); 104 // if the target of the click isn't the container nor a descendant of the container 105 if (!container.is(e.target) && container.has(e.target).length === 0) { 106 $('.popup.active-popup').removeClass('active-popup'); 107 } 108 } 109 }); 110 if ($('.popup').length) { 111 $('.popup .closing-x').click(function () { 112 $(this).parents('.popup').removeClass('active-popup'); 113 }); 114 } 115 116 $(document).on('click', '.top-accordion', function () { 117 that = $(this); 118 parent = that.parents('.single-row'); 119 parent.find('.hidden').slideToggle(); 120 parent.toggleClass('active'); 121 parent.siblings().find('.hidden').slideUp(40); 122 parent.siblings().removeClass('active'); 123 setTimeout(function () { 124 $('html, body').animate({ 125 scrollTop: parent.offset().top - headerHeight - adminBar 126 }, 400); 127 }, 50); 128 }); 129 130 $(document).on('click', '.hidden-content-button', function () { 131 $('.banner .hidden').slideDown(); 132 $(this).hide(); 133 }); 134 135 $(document).on('click', '.en-newsletter-top button', function () { 136 $('.en-newsletter-section .contact-form').slideDown(); 137 $(this).hide(); 138 }); 139 140 $(document).on('click', '.single-method .top-part', function () { 141 $(this).parents('.single-method').find('.hidden').slideToggle(); 142 $(this).parents('.single-method').toggleClass('active'); 143 $(this).parents('.single-method').siblings().find('.hidden').slideUp(); 144 $(this).parents('.single-method').siblings().removeClass('active'); 145 }); 146 147 $(document).on('click', '.donation-option .title', function () { 148 $(this).parents('.donation-option').find('.hidden').slideToggle(); 149 $(this).parents('.donation-option').toggleClass('active'); 150 $(this).parents('.donation-option').siblings().find('.hidden').slide
150Up(); 151 $(this).parents('.donation-option').siblings().removeClass('active'); 152 if ($(this).parents('.donation-option').hasClass('show-form')) { 153 $('.donate-form-section').addClass('active'); 154 }else{ 155 $('.donate-form-section').removeClass('active'); 156 } 157 }); 158 159 $(document).on('click', '.qgive_open_modal', function () { 160 (function(w, d, s, id) { 161 var js, fjs = d.getElementsByTagName(s)[0]; 162 if (d.getElementById(id)) return; 163 js = d.createElement(s); 164 js.id = id; 165 js.src = "https://secure.qgiv.com/resources/core/js/embed.js"; 166 fjs.parentNode.insertBefore(js, fjs); 167 })(window, document, 'script', 'qgiv-embedjs'); 168 $('.qgiv-embed-container').parents('.popup').addClass('active-popup') 169 }); 170 171 172 $(document).on('click', '.canada_open_modal', function () { 173 $('.canada-modal').parents('.popup').addClass('active-popup') 174 }); 175 176 $('.choose-amount input').change(function () { 177 if ($.isNumeric(this.value)){ 178 $val = this.value; 179 }else{ 180 $val = ''; 181 } 182 setTimeout(function () { 183 $(document).find('input.amount-field').val($val).focus(); 184 }, 100); 185 }); 186 187 if ($('.sticky-form-popup').length) { 188 if ($(window).width() > 1200 && !$('.sticky-form-popup').hasClass('en-sticky-form-popup')) { 189 $('.sticky-form-popup').removeClass('hidden'); 190 191 }else{ 192 $('.sticky-form-button').removeClass('hidden'); 193 } 194 $(document).on('click', '.sticky-form-button', function () { 195 if ($(this).data('button')) { 196 data = $(this).data('button'); 197 $('.sticky-form-popup[data-popup='+data +']').removeClass('hidden'); 198 $('.sticky-form-button').addClass('hidden'); 199 }else{ 200 $('.sticky-form-popup').removeClass('hidden'); 201 $('.sticky-form-button').addClass('hidden'); 202 } 203 }); 204 $(document).on('click', '.sticky-form-popup .close-x', function () { 205 $('.sticky-form-popup').addClass('hidden'); 206 $('.sticky-form-button').removeClass('hidden'); 207 }); 208 } 209 210 if ($('.team-section button.plus').length) { 211 $(document).on('click', '.single-member button.plus', function () { 212 var parent = $(this).parents('.single-member'); 213 parent.toggleClass('active').find('.hidden').slideToggle(); 214 }); 215 } 216 217 if ($('.inner-founder').length) { 218 $(document).on('click', '.top-founder .button', function () { 219 target = $(this).data('buttonid'); 220 $(this).toggleClass('active'); 221 $(this).parent('.top-founder').siblings('.top-founder').find('button').removeClass('active'); 222 $('.inner-founder[data-sectionid=' + target + ']').slideToggle().toggleClass('active'); 223 $('.inner-founder[data-sectionid=' + target + ']').siblings('.inner-founder').removeClass('active').hide(); 224 setTimeout(function () { 225 $('html, body').animate({ 226 scrollTop: $('.inner-founder[data-sectionid=' + target + ']').offset().top - 130 227 }, 500); 228 }, 500); 229 }); 230 } 231 232 if ($('.decades-sections').length) { 233 $(document).on('click', '.decade .main-part', function () { 234 var parent = $(this).parents('.decade'); 235 parent.toggleClass('active').find('.hidden').slideToggle(); 236 $('html, body').animate({ 237 scrollTop: $(this).offset().top - 130 238 }, 500); 239 }); 240 setTimeout(function () { 241 set_visible_objects(); 242 }, 1100); 243 } 244 if ($('.opening_tabs-sections').length) { 245 $(document).on('click', '.opening_tab .main-part', function () { 246 var parent = $(this).parents('.opening_tab'); 247 parent.toggleClass('active').find('.hidden').slideToggle(); 248 $('html, body').animate({ 249 scrollTop: $(this).offset().top - headerHeight - adminBar 250 }, 500); 251 }); 252 setTimeout(function () { 253 set_visible_objects(); 254 }, 1100); 255 } 256 257 if ($('#fullpage').length) { 258 new fullpage('#fullpage', { 259 // Get your license at https://alvarotrigo.com/fullPage/pricing/ 260 licenseKey: 'YOUR LICENSE KEY HERE ', 261 afterLoad: function (origin, destination, direction, trigger) { 262 var origin = this; 263 264 if ($(destination.item).hasClass('slide-section')) { 265 $(header).addClass('minimal-header'); 266 } else { 267 $(header).removeClass('minimal-header'); 268 } 269 $('.fp-section:not(.slide-section)').css({ 270 'padding-top': headerHeight + adminBar 271 }); 272 set_visible_objects(); 273 }, 274 onLeave: function (origin, destination, direction, trigger) { 275 var leavingSection = this; 276 //after leaving section 2 277 if ($(destination.item).hasClass('slide-section')) { 278 $(header).addClass('minimal-header'); 279 }else{ 280 $(header).removeClass('minimal-header'); 281 } 282 283 } 284 }); 285 } 286 287 if ($('#services-menu').length) { 288 var services_menu = $('#services-menu'); 289 var sub_menu = services_menu.find('li.active').find('ul.sub-menu').html(); 290 var li_classes = services_menu.find('li.active').attr("class"); 291 var index = services_menu.find('li.active').index(); 292 services_menu.append($('.services .backgrounds'));
293 $('.sub-menu-container').attr("class", 'sub-menu-container').addClass(li_classes); 294 $('.sub-menu-container').html(sub_menu); 295 $('.services .backgrounds .bg').eq(index).addClass('active').siblings().removeClass('active'); 296 297 298 if ($('#services-menu').parents('.en-services-section').length) { 299 $(document).on('mouseenter', '#services-menu > li > a', function (e) { 300 li = $(this).parent('li'); 301 li_classes = li.attr("class"); 302 sub_menu = li.find('ul.sub-menu').html(); 303 li.addClass('active'); 304 li.siblings().removeClass('active'); 305 index = li.index(); 306 $('.sub-menu-container').attr("class", 'sub-menu-container').addClass(li_classes); 307 $('.sub-menu-container').html(sub_menu); 308 $('.services .backgrounds .bg').eq(index).addClass('active').siblings().removeClass('active'); 309 }); 310 }else{ 311 $(document).on('click', '#services-menu > li > a', function (e) { 312 e.preventDefault(); 313 li = $(this).parent('li'); 314 li_classes = li.attr("class"); 315 sub_menu = li.find('ul.sub-menu').html(); 316 li.addClass('active'); 317 li.siblings().removeClass('active'); 318 index = li.index(); 319 $('.sub-menu-container').attr("class",'sub-menu-container').addClass(li_classes); 320 $('.sub-menu-container').html(sub_menu); 321 $('.services .backgrounds .bg').eq(index).addClass('active').siblings().removeClass('active'); 322 }); 323 } 324 } 325 326 $(document).on('mouseenter', '.en-services-section .swiper-slide', function (e) { 327 $(this).addClass('hover'); 328 $(this).find('.hidden').slideDown(); 329 $(this).find('.plus').slideUp(); 330 }); 331 $(document).on('mouseleave', '.en-services-section .swiper-slide', function (e) { 332 $(this).removeClass('hover'); 333 $(this).find('.hidden').slideUp(); 334 $(this).find('.plus').slideDown(); 335 }); 336 337 $('h3.service-title').each(function(){ 338 text = $(this).text().trim() 339 $('#wpcf7-f3936-o1 select').append($('<option>', { 340 value: text, 341 text: text 342 })); 343 }); 344 345 $('h3.service-title').each(function () { 346 text = $(this).text().trim() 347 $('#wpcf7-f6619-o1 select').append($('<option>', { 348 value: text, 349 text: text 350 })); 351 }); 352 353 $(document).on('mouseenter', '.single-therapy-wrapper', function (e) { 354 $(this).find('.sub-services').slideDown(); 355 }); 356 $(document).on('mouseleave', '.single-therapy-wrapper', function (e) { 357 $(this).find('.sub-services').slideUp(); 358 }); 359 360 361 const swiperImpact = new Swiper('.impacts-slider', { 362 slidesPerView: 1, 363 watchOverflow: true, 364 loop: true, 365 reverseDirection: true, 366 navigation: { 367 nextEl: '.swiper-button-next', 368 prevEl: '.swiper-button-prev', 369 }, 370 }); 371 372 const swiperQuotes = new Swiper('.quotes-slider', { 373 slidesPerView: 1, 374 watchOverflow: true, 375 loop: true, 376 effect: 'fade', 377 fadeEffect: { 378 crossFade: true 379 }, 380 reverseDirection: true, 381 navigation: { 382 nextEl: '.swiper-button-next', 383 prevEl: '.swiper-button-prev', 384 }, 385 }); 386 387 const swiperPartners = new Swiper('.partners-slider', { 388 slidesPerView: 2, 389 watchOverflow: true, 390 loop: false, 391 reverseDirection: true, 392 navigation: { 393 nextEl: '.swiper-button-next', 394 prevEl: '.swiper-button-prev', 395 }, 396 breakpoints: { 397 768: { 398 slidesPerView: 3, 399 }, 400 1024: { 401 slidesPerView: 4, 402 }, 403 }, 404 }); 405 406 const swiperGallery = new Swiper('.gallery-slider', { 407 //slidesPerView: 2.2, 408 slidesPerView: 'auto', 409 watchOverflow: true, 410 loop: false, 411 reverseDirection: true, 412 navigation: { 413 nextEl: '.swiper-button-next', 414 prevEl: '.swiper-button-prev', 415 }, 416 breakpoints: { 417 768: { 418 //slidesPerView: 2.5, 419 }, 420 1024: { 421 slidesPerView: 'auto' 422 }, 423 }, 424 }); 425 426 $('.popup-gallery').magnificPopup({ 427 delegate: 'a', 428 type: 'image', 429 tLoading: 'Loading image #%curr%...', 430 mainClass: 'mfp-img-mobile', 431 gallery: { 432 enabled: true, 433 navigateByImgClick: true, 434 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 435 }, 436 image: { 437 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 438 }, 439 callbacks: { 440 elementParse: function (item) { 441 // the class name 442 if (item.el[0].classList.contains("video-link")) { 443 item.type = 'iframe'; 444 } else { 445 item.type = 'image'; 446 } 447 } 448 } 449 }); 450 451 452 const swiperAttendees = new Swiper('.attendees-slider', { 453 //slidesPerView: 2.2, 454 slidesPerView: 'auto', 455 watchOverflow: true, 456 loop: false, 457 reverseDirection: true, 458 navigation: { 459 nextEl: '.swiper-button-next', 460 prevEl: '.swiper-button-prev', 461 }, 462 breakpoints: { 463 768: { 464 //slidesPerView: 2.5, 465 }, 466 1024: { 467 slidesPerView: 'auto' 468 }, 469 }, 470 }); 471 472 473 plansHeaderHeight = $('.plans-header').outerHeight(); 474 $('.plans-header-wrapper').height(plansHeaderHeight); 475 476 477 // var lastScrollTop = 0; 478 // var allowScroll = true; 479 // $(window).scroll(function (event) { 480 // var st = $(this).scrollTop(); 481 // var sb = st + $(window).height(); 482 // if (st > lastScrollTop && allowScroll) { 483 // allowScroll = false;
484 // // downscroll code 485 // if ($('.slide-section').length) { 486 // $('.slide-section.active').each(function () { 487 // var that = $(this); 488 // if (that.isInViewport()) { 489 // console.log(that); 490 // section_top = that.offset().top 491 // section_bottom = section_top + that.outerHeight(); 492 // //console.log(section_bottom); 493 // //console.log(sb); 494 // if (section_bottom <= sb) { 495 // nextSection = that.next(); 496 // if (nextSection) { 497 // allowScroll = false; 498 499 // $('html, body').animate({ 500 // scrollTop: nextSection.offset().top 501 // }, 700); 502 // } 503 // } 504 // setTimeout(function () { 505 // allowScroll = true; 506 // that.removeClass('active'); 507 // }, 1000); 508 // } 509 510 // }); 511 // } 512 // } else { 513 // // upscroll code 514 // } 515 // lastScrollTop = st; 516 // }); 517 setTimeout(function () { 518 set_visible_objects(); 519 if ($('.fade-sections').hasClass('viewed')) { 520 $('html, body').animate({ 521 scrollTop: 0 522 }, 1000); 523 if ($(window).scrollTop() == 0) { 524 $('body').css('overflow', 'hidden'); 525 }else{ 526 $('body').css('overflow', 'visible'); 527 } 528 } 529 }, 1000); 530 var about_sticky_el = $('.about-main-section .sticky-part'); 531 if (about_sticky_el.length) { 532 var sticky_top = about_sticky_el.offset().top; 533 var sticky_bottom = sticky_top + about_sticky_el.outerHeight(); 534 about_sticky_el.addClass('fixed'); 535 } 536 537 var qoute_sticky_el = $('.sticky-quote'); 538 if (qoute_sticky_el.length) { 539 var sticky_top = qoute_sticky_el.offset().top; 540 var sticky_bottom = sticky_top + qoute_sticky_el.outerHeight(); 541 qoute_sticky_el.addClass('fixed'); 542 } 543 $(window).on('resize scroll', function () { 544 set_visible_objects(); 545 var sticky_el = $('.sticky-form-popup'); 546 if (sticky_el.length) { 547 var sticky_wrapper = $('#page-wrap'); 548 var viewportTop = $(window).scrollTop(); 549 var viewportBottom = viewportTop + $(window).height(); 550 var wrapper_top = sticky_wrapper.offset().top; 551 var wrapper_bottom = wrapper_top + sticky_wrapper.outerHeight(); 552 if ($(window).width() >= 768) { 553 if (viewportBottom < wrapper_bottom) { 554 sticky_el.removeClass('stick'); 555 }else{ 556 sticky_el.addClass('stick'); 557 } 558 } 559 } 560 561 if (about_sticky_el.length) { 562 var sticky_wrapper = $('.about-main-section'); 563 var viewportTop = $(window).scrollTop(); 564 var viewportBottom = viewportTop + $(window).height(); 565 var wrapper_top = sticky_wrapper.offset().top; 566 var wrapper_bottom = wrapper_top + sticky_wrapper.outerHeight(); 567 if ($(window).width() >= 768) { 568 if (wrapper_bottom > viewportTop + sticky_bottom) { 569 about_sticky_el.removeClass('stick').addClass('fixed'); 570 } else { 571 about_sticky_el.addClass('stick').removeClass('fixed'); 572 } 573 } 574 } 575 576 if (qoute_sticky_el.length) { 577 var sticky_wrapper = qoute_sticky_el.parents('.section'); 578 var viewportTop = $(window).scrollTop(); 579 var viewportBottom = viewportTop + $(window).height(); 580 var wrapper_top = sticky_wrapper.offset().top; 581 var wrapper_bottom = wrapper_top + sticky_wrapper.outerHeight(); 582 if ($(window).width() >= 768) { 583 if (wrapper_bottom > viewportTop + sticky_bottom) { 584 qoute_sticky_el.removeClass('stick').addClass('fixed'); 585 } else { 586 qoute_sticky_el.addClass('stick').removeClass('fixed'); 587 } 588 } 589 } 590 }); 591 $('.fp-overflow').on('resize scroll', function () { 592 set_visible_objects() 593 }); 594 595 if ($('body').hasClass('page-template-home') || $('body').hasClass('page-template-en-home')) { 596 if ($(window).scrollTop() == 0) { 597 $('body').css('overflow', 'hidden'); 598 } else { 599 $('body').css('overflow', 'visible'); 600 }
601 var scrollDelay = false; 602 $(document).on('mousewheel', '.slide-section', function (e) { 603 if ($('.fade-sections').hasClass('viewed')) { 604 $activeSlide = $('.slide-section.active'); 605 if ($(window).scrollTop() == 0) { 606 if (!scrollDelay) { // prevent slides from scrolling all at once 607 $('body').css('overflow', 'hidden'); 608 if (typeof e.originalEvent.detail == 'number' && e.originalEvent.detail !== 0) { 609 if (e.originalEvent.detail > 0) { //down 610 scrollNextSlide($activeSlide) 611 } else if (e.originalEvent.detail < 0) { //up 612 scrollPrevSlide($activeSlide) 613 } 614 } else if (typeof e.originalEvent.wheelDelta == 'number') { 615 if (e.originalEvent.wheelDelta < 0) { //down 616 scrollNextSlide($activeSlide) 617 } else if (e.originalEvent.wheelDelta > 0) { //up 618 scrollPrevSlide($activeSlide) 619 } 620 } 621 scrollDelay = true 622 setTimeout(function () { 623 scrollDelay = false 624 }, 1000); 625 } 626 } 627 } 628 }); 629 630 var ts; 631 $(document).bind('touchstart', function (e) { 632 if ($(window).scrollTop() == 0) { 633 ts = e.originalEvent.touches[0].clientY; 634 } 635 }); 636 $(document).bind('touchend', function (e) { 637 if(e.target.classList[0] !== 'button'){ 638 639 if ($(window).scrollTop() == 0) { 640 $activeSlide = $('.slide-section.active'); 641 $('body').css('overflow', 'hidden'); 642 var te = e.originalEvent.changedTouches[0].clientY; 643 if (ts > te + 5) { 644 scrollNextSlide($activeSlide) 645 } else if (ts < te - 5) { 646 scrollPrevSlide($activeSlide) 647 } 648 } 649 } 650 }); 651 652 $(document).on('click', '.fade-sections .tag a', function (e) { 653 e.preventDefault(); 654 id = $(this).attr('href'); 655 656 $activeSlide = $('.slide-section.active'); 657 $(id).addClass('active'); 658 $activeSlide.removeClass('active'); 659 }); 660 661 $(document).on('click', '.fade-sections .skip-button', function (e) { 662 e.preventDefault(); 663 $('.slide-section.active').removeClass('active'); 664 $('.slide-section').last().addClass('active'); 665 $('body').css('overflow', 'overlay'); 666 var scrollToElement = e.currentTarget.hash; 667 var scrollTo = headerHeight - 30; 668 $('html, body').animate({ 669 scrollTop: $('.fade-sections').next().offset().top - scrollTo 670 }, 1000); 671 }); 672 } 673 674 var interval = setInterval(function () { 675 676 var widget = $('equally-widget-ui')[0]; 677 678 if (!widget || !widget.shadowRoot) { 679 return; 680 } 681 682 var $button = $(widget.shadowRoot).find('#equally-ai___init-button'); 683 684 if (!$button.length) { 685 return; 686 } 687 688 $button.css({ 689 top: (headerHeight + adminBar + 10) + 'px', 690 left: '15px', 691 bottom: 'auto' 692 }); 693 694 clearInterval(interval); 695 696 }, 200); 697}) 698$.fn.isInViewport = function () { 699 var elementTop = $(this).offset().top; 700 var elementBottom = elementTop + $(this).outerHeight(); 701 var viewportTop = $(window).scrollTop(); 702 var viewportBottom = viewportTop + $(window).height(); 703 return elementBottom > viewportTop && elementTop < viewportBottom; 704}; 705function set_visible_objects() { 706 $('.not-viewed,.viewed').each(function () { 707 that = $(this); 708 if (that.isInViewport()) { 709 that.addClass('viewed'); 710 that.removeClass('not-viewed'); 711 } else { 712 if (!$(this).hasClass('stay-viewed')) { 713 that.removeClass('viewed'); 714 that.addClass('not-viewed'); 715 } 716 } 717 }); 718 sum = 0; 719 $('.hidden-auto').each(function () { 720 var that = $(this); 721 if (that.isInViewport() && !that.hasClass('active')) { 722 sum += 400; 723 $('.hidden-auto').each(function () { 724 setTimeout(function () { 725 that.addClass('active'); 726 }, sum); 727 }); 728 } 729 }); 730 731 sumMenu = 0; 732 $('.open_menu').each(function () { 733 var that = $(this); 734 if (that.isInViewport() && !that.hasClass('active')) { 735 that.addClass('active'); 736 that.find('> li').each(function () { 737 sumMenu += 150; 738 var li = $(this); 739 setTimeout(function () { 740 li.addClass('active'); 741 }, sumMenu); 742 }); 743 } 744 }); 745 if ($('.fade-sections').hasClass('viewed')) { 746 if ($(window).scrollTop() == 0) { 747 $(header).addClass('minimal-header'); 748 }else{ 749 $('.fade-sections .slide-section').removeClass('active'); 750 $('.fade-sections .slide-section').last().addClass('active'); 751 $(header).removeClass('minimal-header'); 752 } 753 }else{ 754 $(header).removeClass('minimal-header'); 755 } 756 757 if ($('#page-wrap').hasClass('minimal-header-page')) { 758 if ($(window).scrollTop() == 0) { 759 $(header).addClass('minimal-header'); 760 } else { 761 $(header).removeClass('minimal-header'); 762 } 763 } 764 765 if ($('.building-seperator-wrapper').length) { 766 $('.building-seperator-wrapper').each(function () { 767 that = $(this); 768 if (that.isInViewport()) { 769 var $el = that, 770 scrollTop = $(window).scrollTop(), 771 scrollBot = scrollTop + $(window).height(), 772 elTop = $el.offset().top, 773 elBottom = $el.offset().top + $el.outerHeight(), 774 visibleTop = elTop < scrollTop ? scrollTop : elTop, 775 visibleBottom = elBottom > scrollBot ? scrollBot : elBottom; 776 visibleHeight = visibleBottom - visibleTop; 777 778 if (elTop < scrollTop) { // line height should be MORE then screen height 779 upperLineHeight = scrollTop - elTop; 780 lineHeight = visibleHeight + upperLineHeight; 781 } else { // line height should be LESS then screen height 782 lineHeight = visibleHeight; 783 } 784 if (lineHeight == $el.outerHeight()) { 785 that.find('.building-seperator').css({ 'height': lineHeight }); 786 }else{ 787 that.find('.building-seperator').css({ 'height': lineHeight - 10 }); 788 } 789 } 790 }); 791 } 792 793 if ($('.plans-header').length) { 794 var headerHeight = $('header').outerHeight(); 795 if ($('#wpadminbar').length) { 796 adminBar = $('#wpadminbar').outerHeight(); 797 } else { 798 adminBar = 0; 799 } 800 $('.plans-header').css({ 801 'top': headerHeight + adminBar 802 }) 803 if ($(window).scrollTop() > $('.plans-header-wrapper').offset().top && $('.plans-sections').isInViewport() && $(window).width() > 768) { 804 $('.plans-header').addClass('fixed'); 805 }else{ 806 $('.plans-header').removeClass('fixed'); 807 } 808 809 $('.single-plan').each(function () { 810 that = $(this); 811 if (that.isInViewport()) { 812 id = that.attr('id'); 813 $('.single-plan-button[href="#' + id + '"]').addClass('active').siblings().removeClass('active'); 814 } 815 }); 816 } 817} 818 819function scrollNextSlide(activeSlide) { 820 var window_width = $(window).width() 821 822 if (activeSlide.next().is(':not(:last-child)')) { 823 $('.fade-sections').css({ 824 'height': window.innerHeight 825 }) 826 } 827 if (activeSlide.is(':last-child')) { 828 $('body').css('overflow', 'overlay'); 829 }else{ 830 if (window_width > 768) { 831 activeSlide.find('.color-bg').css({ 832 'transform-origin': 'top' 833 }); 834 } 835 activeSlide.next().addClass('active'); 836 activeSlide.removeClass('active'); 837 setTimeout(function () { 838 if (window_width > 768) { 839 activeSlide.find('.color-bg').css({ 840 'transform-origin': 'bottom' 841 }); 842 } 843 if (activeSlide.next().is(':last-child')) { 844 $('body').css('overflow', 'overlay'); 845 } 846 }, 500) 847 } 848 849 850} 851 852function scrollPrevSlide(activeSlide) { 853 var window_width = $(window).width(); 854 if (!activeSlide.is(':first-child')) { 855 $('.fade-sections').css({ 856 'height': window.innerHeight 857 }) 858 if (window_width > 768) { 859 activeSlide.prev().find('.color-bg').css({ 860 'transform-origin': 'top', 861 }); 862 } 863 activeSlide.prev().addClass('active'); 864 activeSlide.removeClass('active'); 865 if (window_width > 768) { 866 setTimeout(function () { 867 activeSlide.prev().find('.color-bg').css({ 868 'transform-origin': 'bottom' 869 }); 870 }, 1000) 871 } 872 } 873} 874
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.