import{B as d,a as u,b as T}from"./DanceInfo.js";import{o as r,c as a,d as h,t as n,f as i,a as c,e as S,_}from"./index.js";const m={class:"dance-track"},b={key:0,class:"track-button-text"},x={key:2,class:"track-progress"},p={class:"track-progress-text"},f={class:"track-progress-scores"};function g(t,e,s,v,l,o){return r(),a("div",m,[this.text.state!=0?(r(),a("div",{key:0,class:"track-text",style:h(o.getDanceStyle(this.text.id))},n(o.getDanceText(this.text.id)),5)):i("",!0),this.button.state!=0?(r(),a("div",{key:1,class:"track-button",style:h(o.getButtonStyle),onClick:e[0]||(e[0]=E=>o.isMobile&&o.onButtonClick())},[this.button.state!=0?(r(),a("div",b,n(o.getButtonName()),1)):i("",!0)],4)):i("",!0),this.lessonTimerSeconds>0?(r(),a("div",x,[c("div",p,n(o.getDancingLessonTime()),1),c("div",f,[c("span",null,n(l.lessonScores),1),S(" ОЧКОВ")])])):i("",!0)])}const w="rgba(109, 183, 54, 0.9)",k="rgba(211, 85, 13, 0.9)",y="rgba(255, 255, 255, 1.0)",B={name:"dance-track",props:["openParams"],data(){return{button:{id:0,state:1},text:{id:0,state:1,scores:0},lessonTimerSeconds:0,lessonScores:0,buttonParams:{blurShadow:0,stretchShadow:0,colorShadow:"#B3A7C5"},buttonTypes:d}},computed:{getButtonStyle(){return{width:this.buttonTypes[this.button.id].width+"px",height:"60px",top:this.buttonTypes[this.button.id].top+"px",left:this.buttonTypes[this.button.id].left+"px","box-shadow":"0 0 "+this.buttonParams.blurShadow+"px "+this.buttonParams.stretchShadow+"px "+this.buttonParams.colorShadow}},isMobile(){return this.$root.isMobile}},created(){this.openParams&&(this.lessonTimerSeconds=this.openParams);let t=0,e=!1;setInterval(()=>{this.button.state===u&&(e?(t--,t||(e=!1)):(t++,t>=10&&(e=!0)),this.buttonParams.blurShadow=t,this.buttonParams.stretchShadow=(t+1)/2),this.text.state>0&&(this.text.state-=20,this.text.state<0&&(this.text.state=0))},20);let s=setInterval(()=>{this.lessonTimerSeconds>0&&(this.lessonTimerSeconds-=1,this.lessonTimerSeconds<=0&&s&&(clearInterval(s),s=null))},1e3)},methods:{showButton(t){let e=JSON.parse(t);this.button.id=e[0],this.button.state=u,window.setCursorStatus("DanceTrack",!1)},getButtonName(){return this.buttonTypes[this.button.id].name},getDancingLessonTime(){return getTimeFormatSeconds(this.lessonTimerSeconds)},pressButton(t,e,s){this.text.state=e,this.text.id=t,this.text.scores=0,this.button.state=T,this.lessonScores=s},showDanceText(t,e,s){this.text.state=e,this.text.id=t,this.text.scores=s},getDanceStyle(t){return t==0||t==11?{color:y}:t>=1&&t<=5?{color:w}:{color:k}},getDanceText(t){switch(t){case 0:return"ПРИГОТОВЬСЯ!";case 1:return"МОЛОДЕЦ!";case 2:return"ТАК ДЕРЖАТЬ!";case 3:return"ХОРОШО ДВИГАЕШЬСЯ!";case 4:return"ТЫ КРУТ!";case 5:return"КОРОЛЬ ТАНЦПОЛА!";case 6:return"ПЛОХО!";case 7:return"ТЫ ОПОЗДАЛ!";case 8:return"УЖАСНО!";case 9:return"НЕУДАЧА!";case 10:return"ПРОМАХ!";case 11:return"ВЫ НАБРАЛИ "+this.text.scores+" ОЧКОВ ЗА УРОК!"}},onButtonClick(){window.sendKeyEvent(window[`KEY_CODE_${this.getButtonName()}`])}}},C=_(B,[["render",g]]);export{C as default};
