vendor: 3,737 bytes, lines 1-30
1function wavify(wave_element,options){if("undefined"===typeof options)options={};var settings=Object.assign({},{container:options.container?options.container:"body",height:200,amplitude:100,speed:0.15,bones:3,color:"rgba(255,255,255, 0.20)"},options);var wave=wave_element,width=document.querySelector(settings.container).getBoundingClientRect().width,height=document.querySelector(settings.container).getBoundingClientRect().height,points=[],lastUpdate,totalTime=0,animationInstance=false,tweenMaxInstance=false;function rebuilSettings(params){settings=Object.assign({},settings,params);} 2function drawPoints(factor){var points=[];for(var i=0;i<=settings.bones;i++){var x=(i/settings.bones)*width;var sinSeed=(factor+(i+(i%settings.bones)))*settings.speed*100;var sinHeight=Math.sin(sinSeed/100)*settings.amplitude;var yPos=Math.sin(sinSeed/100)*sinHeight+settings.height;points.push({x:x,y:yPos});} 3return points;} 4function drawPath(points){var SVGString="M "+points[0].x+" "+points[0].y;var cp0={x:(points[1].x-points[0].x)/2,y:points[1].y-points[0].y+points[0].y+(points[1].y-points[0].y)};SVGString+=" C "+ 5cp0.x+" "+ 6cp0.y+" "+ 7cp0.x+" "+ 8cp0.y+" "+ 9points[1].x+" "+ 10points[1].y;var prevCp=cp0;var inverted=-1;for(var i=1;i<points.length-1;i++){var cpLength=Math.sqrt(prevCp.x*prevCp.x+prevCp.y*prevCp.y);var cp1={x:points[i].x-prevCp.x+points[i].x,y:points[i].y-prevCp.y+points[i].y};SVGString+=" C "+ 11cp1.x+" "+ 12cp1.y+" "+ 13cp1.x+" "+ 14cp1.y+" "+ 15points[i+1].x+" "+ 16points[i+1].y;prevCp=cp1;inverted=-inverted;} 17SVGString+=" L "+width+" "+height;SVGString+=" L 0 "+height+" Z";return SVGString;} 18function draw(){var now=window.Date.now();if(lastUpdate){var elapsed=(now-lastUpdate)/1000;lastUpdate=now;totalTime+=elapsed;var factor=totalTime*Math.PI;tweenMaxInstance=TweenMax.to(wave,settings.speed,{attr:{d:drawPath(drawPoints(factor))},ease:Power1.easeInOut});}else{lastUpdate=now;} 19animationInstance=requestAnimationFrame(draw);} 20function debounce(func,wait,immediate){var timeout;return function(){var context=this,args=arguments;clearTimeout(timeout);timeout=setTimeout(function(){timeout=null;if(!immediate)func.apply(context,args);},wait);if(immediate&&!timeout)func.apply(context,args);};} 21var redraw=debounce(function(){pause();points=[];totalTime=0;width=document.querySelector(settings.container).getBoundingClientRect().width;height=document.querySelector(settings.container).getBoundingClientRect().height;lastUpdate=false;play();},250);function boot(){if(!animationInstance){tweenMaxInstance=TweenMax.set(wave,{attr:{fill:settings.color}});play();window.addEventListener("resize",redraw);}} 22function reboot(options){kill();if(typeof options!==undefined){rebuilSettings(options);} 23tweenMaxInstance=TweenMax.set(wave,{attr:{fill:settings.color}});play();window.addEventListener("resize",redraw);} 24function play(){if(!animationInstance){animationInstance=requestAnimationFrame(draw);}} 25function pause(){if(animationInstance){cancelAnimationFrame(animationInstance);animationInstance=false;}} 26function updateColor(options){if(typeof options.timing===undefined){options.timing=1;} 27if(typeof options.color===undefined){options.color=settings.color;} 28tweenMaxInstance=TweenMax.to(wave,parseInt(options.timing),{attr:{fill:options.color},onComplete:function(){if(typeof options.onComplete!==undefined&&{}.toString.call(options.onComplete)==="[object Function]"){options.onComplete();}}});} 29function kill(){if(animationInstance){pause();tweenMaxInstance.kill();tweenMaxInstance=TweenMax.set(wave,{x:0,y:0,rotation:0,opacity:0,clearProps:"all",attr:{d:"M0,0",fill:""}});window.removeEventListener("resize",redraw);animationInstance=false;}} 30boot();return{reboot:reboot,play:play,pause:pause,kill:kill,updateColor:updateColor};}
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.