import{d as T,C as V,a0 as z,r,ag as y,ae as $,k as C,o as s,f as v,n as a,u as e,c as _,b as E,i as F,t as w,A as P,J as B,K as L,z as R,$ as N,_ as S}from"./index-CUMBhq1p.js";const H={class:"wooden-fish"},U={class:"btn-box"},W={key:0,class:"el-slider-box"},q={class:"ml-4"},D=["src"],J=["src"],K={class:"soce"},M=T({name:"WoodenFishContent",__name:"content",setup(j){const x=V(),h=z(),n=r([]),u=new Audio;u.src=`${y}/yy_music/dong.aac`;let g;const k=()=>{clearTimeout(g),g=setTimeout(()=>{n.value=[]},1e3),n.value.length>100&&(n.value.length=10),N(()=>{n.value.push(1)}),h.woodenFish.score++,m.value&&(m.value.style.transform="rotate(0deg)"),setTimeout(()=>{m.value.style.transform="rotate(15deg)"},50),f.value&&(u.pause(),u.currentTime=0,u.play())},t=r(!1),m=r();let d;const b=i=>{i?t.value=i:t.value=!t.value,t.value?(clearInterval(d),d=setInterval(()=>{k()},l.value)):clearInterval(d)};$(()=>{x.openComponentList.findIndex(i=>i.component=="WoodenFish")==-1&&(t.value=!1,clearInterval(d))});const f=r(!0),A=()=>{f.value=!f.value},l=r(600);return(i,o)=>{const p=C("svg-icon"),I=C("el-slider");return s(),v("div",H,[a("div",U,[a("span",{onClick:o[0]||(o[0]=c=>b()),class:"play-icon",title:"自动敲木鱼"},[e(t)?(s(),_(p,{key:0,class:"btn cursor-pointer",name:"fa fa-pause-circle",size:"24"})):(s(),_(p,{key:1,class:"btn cursor-pointer",name:"fa fa-play-circle",size:"24"}))]),a("span",{onClick:A,class:"play-icon",title:"敲击声音"},[e(f)?(s(),_(p,{key:1,class:"btn",name:"fa fa-volume-up",size:"24"})):(s(),_(p,{key:0,class:"btn",name:"fa fa-volume-off",size:"24"}))]),e(t)?(s(),v("div",W,[E(I,{size:"small",min:100,max:3e3,step:50,modelValue:e(l),"onUpdate:modelValue":o[1]||(o[1]=c=>F(l)?l.value=c:null),onChange:o[2]||(o[2]=c=>b(!0))},null,8,["modelValue"]),a("span",q,w(e(l))+"ms",1)])):P("",!0)]),a("div",{class:"wooden-fish-content",onClick:R(k,["stop"])},[(s(!0),v(B,null,L(e(n),c=>(s(),v("div",{key:c,class:"add"},"功德 +1"))),128)),a("img",{class:"fish-img cursor-pointer",src:`${e(y)}/yy_image/muyu.webp`},null,8,D),a("img",{class:"hammer-img",ref_key:"hammerRef",ref:m,src:`${e(y)}/yy_image/hammer.webp`},null,8,J),a("div",K,"功德:"+w(e(h).woodenFish.score),1)])])}}}),O=S(M,[["__scopeId","data-v-504c8d02"]]);export{O as default};
