text: !function(e){"function"==typeof define&&define.amd?define(["jquery","TweenMax"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery,TweenMax)}(function(e,t){var i=function(i,a){function n(e,t,i){t=t+"s "+i,e.css({"-webkit-transition":t,transition:t})}function s(){n(d,.3,"cubic-bezier(0.44,0.09,0.29,1)"),n(m,.5,"cubic-bezier(0.72,-0.21,0.17,1)")}var o={menu:["part1","part2","part3","part4"],themeColor:"#dc1e24",txtColor:"#fff",position:"right"};e.extend(o,i);var c=this,u=e("#"+o.id);u.append('<article class="km-side-navi-outer"><div class="km-name-tag"><figure class="km-bg"></figure><ul></ul></div><ul class="km-side-navi-ul"></ul></article>');var r=u.find(".km-side-navi-outer"),l=u.find(".km-side-navi-ul"),f=l.find("li"),d=(f.find(".km-semi-circle"),f.find("span.km-circle"),u.find(".km-name-tag")),m=d.find("ul"),p=d.find(".km-bg"),h=[],v=0,g=!1,T=32;this.crtID=-1,this.menu=[],u.css(o.position,"2%"),t.to(u,1,{opacity:1}),t.set(p,{css:{"background-color":o.themeColor}}),this.init=function(){for(var e in o.menu)v+=100*e,c.appendMenu(o.menu[e],100*e,parseInt(e)+1);o.afterInit&&setTimeout(o.afterInit,v+600),setTimeout(function(){g=!0},v+599)},this.appendMenu=function(i,a,n){var s=e("<li>"+i+"</li>").appendTo(m);s.css("color",o.txtColor),h[n]={li:s,offsetX:s.offset().left-r.offset().left,width:s.outerWidth()};var u=e("<li data-menuanchor='"+n+"'></li>"),p=e('<a class="km-hiddenBtn" href="#'+n+'"></a>'),v=e('<span class="km-circle"></span>'),g=e('<div class="km-semi-circle"></div>');t.set(f,{transformPerspective:1e3}),t.set(g,{css:{"background-color":o.themeColor}}),"left"===o.position?t.set(g,{css:{transform:"rotate(40deg)"}}):t.set(g,{css:{transform:"rotate(-40deg)"}}),this.menu[n]={name:i,li:u,circle:v,id:n,lime:g,offsetY:0},t.set([v,g],{scale:0,opacity:0}),v.appendTo(u),g.appendTo(u),p.appendTo(u),t.set(d,{y:T-8}),setTimeout(function(){u.appendTo(l),t.to(u,2,{minHeight:16,paddingTop:8,paddingBottom:8,ease:Elastic.easeOut}),t.to(g,1,{scale:1,opacity:1,ease:Elastic.easeOut}),t.to(g,.5,{delay:.6,scale:0,opacity:0,ease:Elastic.easeOut}),t.to(v,2,{delay:.5,scale:1,opacity:1,ease:Elastic.easeOut}),u.on("mouseover",function(){c.activeMenu(n),c.moveTag(n)}),u.on("mouseout",function(){c.activeMenu(c.crtID),c.moveTag(-1)})},a)},this.activeOn=function(e,i){t.to(e,2,{scale:1,opacity:1,ease:Elastic.easeOut}),t.to(i,1,{scale:0,opacity:0,ease:Elastic.easeOut})},this.activeOff=function(e,i){t.to(e,1,{scale:0,opacity:0,ease:Elastic.easeOut}),t.to(i,2,{scale:1,opacity:1,ease:Elastic.easeOut})},this.moveTag=function(e){if(clearTimeout(y),-1==e)"left"===o.position?t.set(d,{left:40,width:0}):t.set(d,{right:40,width:0});else{var i=-h[e].offsetX;"left"===o.position?t.set(d,{left:50,y:32*e,width:h[e].width}):t.set(d,{right:50,y:32*e,width:h[e].width}),t.set(m,{x:i})}},this.activeMenu=function(e){for(var t in c.menu){var i=c.menu[t];t==e?this.activeOn(i.lime,i.circle):this.activeOff(i.lime,i.circle)}},this.menuChange=function(e){c.crtID=e,c.activeMenu(e)};var y=null;this.tagViewMoment=function(e){this.moveTag(e),clearTimeout(y),y=setTimeout(function(){c.moveTag(-1),y=null},900)},this.activeMenuAndTag=function(e){g&&(this.menuChange(e),this.tagViewMoment(e))},s.call(this),this.init()};return window.SideNavi=i,i});