wavelovers/docs/js/941.6295b5fd.js
2022-08-11 14:16:57 +03:00

2 lines
3.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self["webpackChunkwavelovers"]=self["webpackChunkwavelovers"]||[]).push([[941],{3913:function(t,a,e){var s=e(2482);class n{constructor(t,a,e,n){(0,s.Z)(this,"startDelay",void 0),(0,s.Z)(this,"duration",void 0),(0,s.Z)(this,"weakMagnitude",void 0),(0,s.Z)(this,"strongMagnitude",void 0),this.startDelay=t,this.duration=a,this.weakMagnitude=e,this.strongMagnitude=n}}a["Z"]=n},8941:function(t,a,e){e.r(a),e.d(a,{default:function(){return w}});var s=e(3396);function n(t,a,e,n,i,d){const u=(0,s.up)("AppManual");return(0,s.wg)(),(0,s.j4)(u)}var i=e(9242);const d={class:"content-item app-manual"},u={class:"manual-form__input"},o=(0,s._)("span",null,"Weak Magnitude",-1),r={class:"manual-form__input"},p=(0,s._)("span",null,"Strong Magnitude",-1),h=(0,s.uE)('<div class="manual-controls"><div><kbd>RT</kbd><span> Vibrate</span></div><div><kbd>A</kbd><span> Light Mode</span></div><div><kbd>X</kbd><span> Heavy Mode</span></div><div><kbd>Y</kbd><span> Combined Mode</span></div><div><kbd>B</kbd><span> Lock</span></div></div>',1);function l(t,a,e,n,l,g){return(0,s.wg)(),(0,s.iD)("div",d,[(0,s._)("label",u,[o,(0,s.wy)((0,s._)("input",{"onUpdate:modelValue":a[0]||(a[0]=a=>t.weakMagnitude=a),type:"range",required:"",disabled:"",min:"0.0",max:"1.0",step:"0.01"},null,512),[[i.nr,t.weakMagnitude]])]),(0,s._)("label",r,[p,(0,s.wy)((0,s._)("input",{"onUpdate:modelValue":a[1]||(a[1]=a=>t.strongMagnitude=a),type:"range",required:"",disabled:"",min:"0.0",max:"1.0",step:"0.01"},null,512),[[i.nr,t.strongMagnitude]])]),h])}var g=e(1746),m=e(3913),c=(0,s.aZ)({name:"AppCustom",data:()=>({timestamp:0,interval:0,mode:0,lock:!1,startDelay:0,duration:260,weakMagnitude:0,strongMagnitude:0}),computed:{gamepads:function(){const t=this.timestamp,a=g.Z.getters.gamepads;return a.forEach((a=>{a.interval=t})),a}},methods:{start:function(){const t=new m.Z(this.startDelay,this.duration,this.weakMagnitude,this.strongMagnitude);g.Z.dispatch("vibrate",t)},stop:function(){g.Z.dispatch("setIsActive",!1),g.Z.dispatch("setMode",0),g.Z.dispatch("reset")},eventLoop:function(){this.updateComputed(),this.updateMode(),this.updatePattern(),this.handle()},updateComputed:function(){this.timestamp=Date.now()},updateMode:function(){this.gamepads.length>0&&(!0===this.gamepads[0].unit.buttons[1].pressed&&(this.lock=!this.lock),!1===this.lock&&(!0===this.gamepads[0].unit.buttons[0].pressed&&(this.mode=0),!0===this.gamepads[0].unit.buttons[2].pressed&&(this.mode=1),!0===this.gamepads[0].unit.buttons[3].pressed&&(this.mode=2)))},updatePattern:function(){this.gamepads.length>0&&!1===this.lock&&(0===this.mode&&(this.weakMagnitude=this.gamepads[0].unit.buttons[7].value,this.strongMagnitude=this.gamepads[0].unit.buttons[7].value),1===this.mode&&(this.weakMagnitude=0,this.strongMagnitude=this.gamepads[0].unit.buttons[7].value),2===this.mode&&(this.weakMagnitude=this.gamepads[0].unit.buttons[7].value,this.strongMagnitude=0))},handle:function(){this.gamepads.length>0&&this.gamepads.forEach((t=>{t.unit.buttons[7].value>0||!0===this.lock?this.start():this.stop()}))}},mounted(){this.interval=setInterval(this.eventLoop,250)},unmounted(){clearInterval(this.interval)}}),v=e(89);const k=(0,v.Z)(c,[["render",l]]);var M=k,b=(0,s.aZ)({name:"ManualView",components:{AppManual:M}});const f=(0,v.Z)(b,[["render",n]]);var w=f}}]);
//# sourceMappingURL=941.6295b5fd.js.map