MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / animateScroll

Function animateScroll

assets/js/rotating_nav_anim.js:158–169  ·  view source on GitHub ↗
(timestamp)

Source from the content-addressed store, hash-verified

156 currentTime = null;
157
158 var animateScroll = function(timestamp){
159 if (!currentTime) currentTime = timestamp;
160 var progress = timestamp - currentTime;
161 if(progress > duration) progress = duration;
162 var val = Math.easeInOutQuad(progress, start, final-start, duration);
163 window.scrollTo(0, val);
164 if(progress < duration) {
165 window.requestAnimationFrame(animateScroll);
166 } else {
167 cb && cb();
168 }
169 };
170
171 window.requestAnimationFrame(animateScroll);
172};

Callers

nothing calls this directly

Calls 1

cbFunction · 0.70

Tested by

no test coverage detected