1// SCROLLING 2var windowWidth = 0; 3var html = document.documentElement; 4var body = document.body; 5var scroller = { 6 ease: 0.02, // <= scroll speed 7 endY: 0, 8 y: 0, 9 resizeRequest: 1, 10 scrollRequest: 0, 11}; 12var requestId = null; 13$(document).ready(function() { 14 windowWidth = $(window).width(); 15}); 16 17//window.addEventListener("load", onLoad); 18 19function initLerpScroll(target) { 20 if(target) { 21 scroller.target = target; 22 body = document.body; 23 24 TweenLite.set(scroller.target, { 25 rotation: 0.01, 26 force3D: true 27 }); 28 29 updateScroller(); 30 window.focus(); 31 window.addEventListener("resize", onResize); 32 document.addEventListener("scroll", onScroll); 33 } 34} 35 36function updateScroller() { 37 if (scroller.target) { 38 39 var resized = scroller.resizeRequest > 0; 40 41 if (resized) { 42 var height = scroller.target.clientHeight; 43 body.style.height = height + "px"; 44 scroller.resizeRequest = 0; 45 } 46 47 var scrollY = window.pageYOffset || html.scrollTop || body.scrollTop || 0; 48 49 scroller.endY = scrollY; 50 scroller.y += (scrollY - scroller.y) * scroller.ease; 51 52 if (Math.abs(scrollY - scroller.y) < 0.05 || resized) { 53 scroller.y = scrollY; 54 scroller.scrollRequest = 0; 55 } 56 57 TweenLite.set(scroller.target, { 58 y: -scroller.y * 0.5 59 }); 60 61 requestId = 62 scroller.scrollRequest > 0 ? requestAnimationFrame(updateScroller) : null; 63 } 64} 65 66function onScroll() { 67 scroller.scrollRequest++; 68 if (!requestId) { 69 requestId = requestAnimationFrame(updateScroller); 70 } 71} 72 73function onResize() { 74 if ($(window).width() != windowWidth) { 75 windowWidth = $(window).width(); 76 77 scroller.resizeRequest++; 78 if (!requestId) { 79 requestId = requestAnimationFrame(updateScroller); 80 } 81 } 82}
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.