mirror of
https://github.com/eugene-serb/wavelovers.git
synced 2023-09-09 23:41:16 +03:00
2 lines
5.8 KiB
JavaScript
2 lines
5.8 KiB
JavaScript
"use strict";(self["webpackChunkwavelovers"]=self["webpackChunkwavelovers"]||[]).push([[286],{3913:function(t,a,n){var e=n(2482);class s{constructor(t,a,n,s){(0,e.Z)(this,"startDelay",void 0),(0,e.Z)(this,"duration",void 0),(0,e.Z)(this,"weakMagnitude",void 0),(0,e.Z)(this,"strongMagnitude",void 0),this.startDelay=t,this.duration=a,this.weakMagnitude=n,this.strongMagnitude=s}}a["Z"]=s},1682:function(t,a,n){n.d(a,{Z:function(){return h}});var e=n(3396),s=n(7139);const i={class:"content-item device-list"};function o(t,a,n,o,d,u){const r=(0,e.up)("GamepadItem");return(0,e.wg)(),(0,e.iD)("div",i,[((0,e.wg)(!0),(0,e.iD)(e.HY,null,(0,e.Ko)(t.gamepads,(t=>((0,e.wg)(),(0,e.j4)(r,{key:t.id,textContent:(0,s.zw)(t.unit.id)},null,8,["textContent"])))),128))])}const d={class:"list-item"};function u(t,a,n,s,i,o){return(0,e.wg)(),(0,e.iD)("div",d)}var r=(0,e.aZ)({name:"GamepadItem"}),l=n(89);const m=(0,l.Z)(r,[["render",u]]);var p=m,c=(0,e.aZ)({name:"GamepadList",props:{gamepads:{type:Array}},components:{GamepadItem:p}});const g=(0,l.Z)(c,[["render",o]]);var h=g},322:function(t,a,n){n.d(a,{Z:function(){return r}});var e=n(3396);const s={class:"content-item message"};function i(t,a,n,i,o,d){return(0,e.wg)(),(0,e.iD)("div",s,[(0,e._)("span",null,[(0,e.WI)(t.$slots,"default")])])}var o=(0,e.aZ)({name:"MessageItem"}),d=n(89);const u=(0,d.Z)(o,[["render",i]]);var r=u},9100:function(t,a,n){n.d(a,{Z:function(){return r}});var e=n(3396);const s={class:"content-item navigation-list"};function i(t,a,n,i,o,d){const u=(0,e.up)("router-link");return(0,e.wg)(),(0,e.iD)("div",s,[(0,e.Wm)(u,{to:"/",class:"navigation-list__item"},{default:(0,e.w5)((()=>[(0,e.Uk)("Patterns")])),_:1}),(0,e.Wm)(u,{to:"/custom",class:"navigation-list__item"},{default:(0,e.w5)((()=>[(0,e.Uk)("Custom")])),_:1}),(0,e.Wm)(u,{to:"/manual",class:"navigation-list__item"},{default:(0,e.w5)((()=>[(0,e.Uk)("Manual")])),_:1}),(0,e.Wm)(u,{to:"/diagnostic",class:"navigation-list__item"},{default:(0,e.w5)((()=>[(0,e.Uk)("Diagnostic")])),_:1})])}var o=(0,e.aZ)({name:"NavigationList"}),d=n(89);const u=(0,d.Z)(o,[["render",i]]);var r=u},6259:function(t,a,n){n.d(a,{Z:function(){return d}});var e=n(3396),s=n(1746),i=(0,e.aZ)({name:"ComputedGamepads",data:()=>({timestamp:0,interval:0}),computed:{gamepads:function(){const t=this.timestamp,a=s.Z.getters.gamepads;return a.forEach((a=>{a.interval=t})),a}},methods:{updateComputed:function(){this.timestamp=Date.now()}},mounted(){this.interval=setInterval(this.updateComputed,1)},unmounted(){clearInterval(this.interval)}});const o=i;var d=o},5286:function(t,a,n){n.r(a),n.d(a,{default:function(){return I}});var e=n(3396);const s=(0,e._)("h1",{class:"visually-hidden"},"Wavelovers <20> Manual",-1);function i(t,a,n,i,o,d){const u=(0,e.up)("AppManual");return(0,e.wg)(),(0,e.iD)(e.HY,null,[s,(0,e.Wm)(u)],64)}var o=n(9242);const d={class:"content-item app-manual"},u={class:"manual-form__input"},r=(0,e._)("span",null,"Weak Magnitude",-1),l={class:"manual-form__input"},m=(0,e._)("span",null,"Strong Magnitude",-1),p=(0,e.uE)('<div class="manual-controls"><div><kbd>RT</kbd><span> – Vibrate</span></div><div><kbd>A</kbd><span> – Combined Mode</span></div><div><kbd>X</kbd><span> – Strong Mode</span></div><div><kbd>Y</kbd><span> – Light Mode</span></div><div><kbd>B</kbd><span> – Lock Intensity</span></div></div>',1);function c(t,a,n,s,i,c){const g=(0,e.up)("NavigationList"),h=(0,e.up)("GamepadList"),v=(0,e.up)("MessageItem");return(0,e.wg)(),(0,e.iD)(e.HY,null,[(0,e.Wm)(g),(0,e._)("div",d,[(0,e._)("label",u,[r,(0,e.wy)((0,e._)("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),[[o.nr,t.weakMagnitude]])]),(0,e._)("label",l,[m,(0,e.wy)((0,e._)("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),[[o.nr,t.strongMagnitude]])]),p]),t.gamepads.length>0?((0,e.wg)(),(0,e.j4)(h,{key:0,gamepads:t.gamepads},null,8,["gamepads"])):((0,e.wg)(),(0,e.j4)(v,{key:1},{default:(0,e.w5)((()=>[(0,e.Uk)("Press any gamepad button or connect a new gamepad to vibrate.")])),_:1}))],64)}var g=n(1746),h=n(9100),v=n(1682),k=n(322),f=n(6259),w=n(3913),M=(0,e.aZ)({name:"AppCustom",mixins:[f.Z],components:{NavigationList:h.Z,GamepadList:v.Z,MessageItem:k.Z},data:()=>({mode:0,lock:!1,startDelay:0,duration:260,weakMagnitude:0,strongMagnitude:0}),methods:{start:function(){const t=new w.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()},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)}}),Z=n(89);const b=(0,Z.Z)(M,[["render",c]]);var _=b,y=(0,e.aZ)({name:"ManualView",components:{AppManual:_}});const D=(0,Z.Z)(y,[["render",i]]);var I=D}}]);
|
||
//# sourceMappingURL=286.47bbc4a7.js.map
|