text: var ease={exponentialIn:function(a){return 0==a?a:Math.pow(2,10*(a-1))},exponentialOut:function(a){return 1==a?a:1-Math.pow(2,-10*a)},exponentialInOut:function(a){return 0==a||1==a?a:.5>a?.5*Math.pow(2,20*a-10):-.5*Math.pow(2,10-20*a)+1},sineOut:function(a){return Math.sin(1.5707963267948966*a)},circularInOut:function(a){return.5>a?.5*(1-Math.sqrt(1-4*a*a)):.5*(Math.sqrt((3-2*a)*(2*a-1))+1)},cubicIn:function(a){return a*a*a},cubicOut:function(a){--a;return a*a*a+1},cubicInOut:function(a){return.5>a?4*a*a*a:.5*Math.pow(2*a-2,3)+1},quadraticOut:function(a){return-a*(a-2)},quarticOut:function(a){return Math.pow(a-1,3)*(1-a)+1}};class ShapeOverlays{constructor(elm){this.elm=elm;this.path=elm.querySelectorAll('path');this.numPoints=4;this.duration=800;this.delayPointsArray=[];this.delayPointsMax=180;this.delayPerPath=70;this.timeStart=Date.now();this.isOpened=false;this.isAnimating=false;}
  toggle(){this.isAnimating=true;const range=Math.random()*Math.PI*2;for(var i=0;i<this.numPoints;i++){const radian=(i/(this.numPoints-1))*Math.PI*2;this.delayPointsArray[i]=(Math.sin(radian+range)+1)/2*this.delayPointsMax;}
  if(this.isOpened===false){this.open();}else{this.close();}}
  open(){this.isOpened=true;this.elm.classList.add('is-opened');this.timeStart=Date.now();this.renderLoop();}
  close(){this.isOpened=false;this.elm.classList.remove('is-opened');this.timeStart=Date.now();this.renderLoop();}
  updatePath(time){const points=[];for(var i=0;i<this.numPoints;i++){points[i]=ease.cubicInOut(Math.min(Math.max(time-this.delayPointsArray[i],0)/this.duration,1))*100}
  let str='';str+=(this.isOpened)?`M 0 0 V ${points[0]} `:`M 0 ${points[0]} `;for(var i=0;i<this.numPoints-1;i++){const p=(i+1)/(this.numPoints-1)*100;const cp=p-(1/(this.numPoints-1)*100)/2;str+=`C ${cp} ${points[i]} ${cp} ${points[i+1]} ${p} ${points[i+1]} `;}
  str+=(this.isOpened)?`V 0 H 0`:`V 100 H 0`;return str;}
  render(){if(this.isOpened){for(var i=0;i<this.path.length;i++){this.path[i].setAttribute('d',this.updatePath(Date.now()-(this.timeStart+this.delayPerPath*i)));}}else{for(var i=0;i<this.path.length;i++){this.path[i].setAttribute('d',this.updatePath(Date.now()-(this.timeStart+this.delayPerPath*(this.path.length-i-1))));}}}
  renderLoop(){this.render();if(Date.now()-this.timeStart<this.duration+this.delayPerPath*(this.path.length-1)+this.delayPointsMax){requestAnimationFrame(()=>{this.renderLoop();});}
  else{this.isAnimating=false;}}}
  (function(){const elmHamburger=document.querySelector('.hamburger');const gNavItems=document.querySelectorAll('.global-menu__item');const elmOverlay=document.querySelector('.shape-overlays');const overlay=new ShapeOverlays(elmOverlay);elmHamburger.addEventListener('click',()=>{if(overlay.isAnimating){return false;}
  overlay.toggle();if(overlay.isOpened===true){elmHamburger.classList.add('is-opened-navi');for(var i=0;i<gNavItems.length;i++){gNavItems[i].classList.add('is-opened');}}else{elmHamburger.classList.remove('is-opened-navi');for(var i=0;i<gNavItems.length;i++){gNavItems[i].classList.remove('is-opened');}}});}());