1(function($) { 2 "use strict"; 3 4 UNCODE.rowParallax = function(){ 5 6 if ( SiteParameters.is_frontend_editor || SiteParameters.smoothScroll !== 'on' ) { 7 return; 8 } 9 10 var $rows = $('.parallax-move'), 11 stableHeight = UNCODE.wheight; 12 $rows.each(function(){ 13 var $row = $(this), 14 _row = $row[0], 15 dataMove = $row.attr('data-parallax-move'), 16 dataSafe = $row.attr('data-parallax-safe'), 17 rowInViewport = false, 18 trans; 19 20 if ( $row.find('.parallax-move').length ) { 21 return; 22 } 23 24 dataSafe = typeof dataSafe === 'undefined' ? '' : dataSafe; 25 dataMove = typeof dataMove === 'undefined' || dataMove === '' ? 3 : dataMove; 26 dataMove = dataMove / 10; 27 28 if ( 'IntersectionObserver' in window ) { 29 var observer = new IntersectionObserver(function(entries) { 30 31 entries.forEach(function(entry){ 32 if ( entry.isIntersecting ) { 33 rowInViewport = true; 34 } else { 35 rowInViewport = false; 36 } 37 }); 38 39 }, { 40 root: document, 41 }); 42 43 observer.observe(_row); 44 } else { 45 rowInViewport = true; 46 } 47 48 var loopRAF = function() { 49 if( rowInViewport ) { 50 var bound = _row.getBoundingClientRect(), 51 bound_top = bound.top, 52 bound_height = bound.height, 53 move = true, 54 scrolled = window.pageYOffset || window.document.documentElement.scrollTop, 55 docH = Math.max( document.body.scrollHeight, document.body.offsetHeight, 56 document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight ), 57 fromBottom = docH - (scrolled + bound_top + bound_height); 58 59 if ( bound_height > stableHeight && dataSafe === 'yes' ) { 60 $row.find('>div').css({ 61 'transform':'none' 62 }); 63 move = false; 64 } 65 66 if ( UNCODE.wwidth < SiteParameters.smoothScrollQuery ) { 67 $row.find('>div').css({ 68 'transform':'none' 69 }); 70 move = false; 71 } 72 73 if ( move ) { 74 75 if ( fromBottom < stableHeight ) { 76 //maybe Footer 77 trans = (stableHeight - (bound_top + bound_height + fromBottom))*(dataMove); 78 } else if ( scrolled + bound_top < stableHeight ) { 79 //maybe Header 80 trans = scrolled*(dataMove); 81 } else { 82 trans = (((stableHeight/2) - (bound_top + (bound_height/2)))*dataMove); 83 } 84 85 $row.find('>div').css({ 86 'transform':'translateY(' + (trans) + 'px) translateZ(0)', 87 }); 88 } 89 } 90 91 requestAnimationFrame(loopRAF); 92 }; 93 94 requestAnimationFrame(loopRAF); 95 96 }); 97 98 $(window).on( 'load resize', function(e) { 99 if ( ! UNCODE.isMobile ) { 100 stableHeight = UNCODE.wheight; 101 } 102 }); 103 104 $(window).on( 'load wwResize', function(e) { 105 if ( UNCODE.isMobile ) { 106 stableHeight = UNCODE.wheight; 107 } 108 }); 109 110} 111 112 113})(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.