-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathScrubGSAPTimeline.min.js
More file actions
3 lines (3 loc) · 1.27 KB
/
ScrubGSAPTimeline.min.js
File metadata and controls
3 lines (3 loc) · 1.27 KB
1
2
3
window.ScrubGSAPTimeline=function(a){var d=new TimelineLite;if("[object Array]"===Object.prototype.toString.call(a))for(var e=a.length;-1<--e;)d.add(a[e],0);else d=a;(function(b){var a=function(a){c.innerHTML=parseFloat(b.time()).toFixed(2);b.pause();b.progress(a.clientX/window.innerWidth);f=a.clientX;g=a.clientY;TweenLite.set(c,{x:f>=window.innerWidth-48?f-48:f,y:20>=g?g+20:g-20})},d=function(a){b.pause();b.play(0);TweenLite.set(c,{autoAlpha:1})},e=function(a){b.play(a.clientX/window.innerWidth*
b.duration());TweenLite.set(c,{autoAlpha:0})},c=document.createElement("div"),f,g;c.style.cssText="position:fixed;border-radius:4px;font-size:14px;padding:5px;user-select:none;pointer-events:none;text-align:center;color:#53A018;top:0;left:0;font-family:Helvetica, Arial, sans-serif;background-color:#262626;line-height:1 !important;z-index:99999999";document.body.appendChild(c);document.body.onmousemove=a;document.body.onmouseover=d;document.body.onmouseout=e;document.body.ondblclick=function(f){document.body.onmousemove?
(TweenLite.to(c,.2,{color:"#A31632"}),document.body.onmousemove=null,document.body.onmouseover=null,document.body.onmouseout=null,b.pause()):(TweenLite.to(c,.2,{color:"#53A018"}),document.body.onmousemove=a,document.body.onmouseover=d,document.body.onmouseout=e)}})(d)};