wavelovers/docs/js/app.5291f554.js
2022-07-22 18:36:52 +03:00

2 lines
18 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.

(function(){"use strict";var e={970:function(e,t,a){var n=a(9242),r=a(3396);function o(e,t,a,n,o,i){const s=(0,r.up)("AppHeader"),c=(0,r.up)("router-view"),l=(0,r.up)("AppFooter");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(s),(0,r.Wm)(c),(0,r.Wm)(l)],64)}const i={class:"header"},s={class:"header-wrapper container"},c=(0,r._)("div",{class:"logo-wrapper"},[(0,r._)("span",{class:"logo-wrapper__logo",translate:"no"},"Wavelovers")],-1),l={class:"menu-wrapper"},d={class:"navigation"},u={class:"navigation__item"},v=(0,r.Uk)("Home"),m={class:"navigation__item"},p=(0,r.Uk)("FAQ"),h={class:"navigation__item"},g=(0,r.Uk)("About"),f={class:"navigation__item"},b=(0,r.Uk)("Donate");function w(e,t,a,n,o,w){const y=(0,r.up)("router-link");return(0,r.wg)(),(0,r.iD)("header",i,[(0,r._)("div",s,[c,(0,r._)("nav",l,[(0,r._)("ul",d,[(0,r._)("li",u,[(0,r.Wm)(y,{to:"/",class:"navigation__link"},{default:(0,r.w5)((()=>[v])),_:1})]),(0,r._)("li",m,[(0,r.Wm)(y,{to:"/faq",class:"navigation__link"},{default:(0,r.w5)((()=>[p])),_:1})]),(0,r._)("li",h,[(0,r.Wm)(y,{to:"/about",class:"navigation__link"},{default:(0,r.w5)((()=>[g])),_:1})]),(0,r._)("li",f,[(0,r.Wm)(y,{to:"/donate",class:"navigation__link"},{default:(0,r.w5)((()=>[b])),_:1})])])])])])}var y=(0,r.aZ)({name:"AppHeader"}),W=a(89);const _=(0,W.Z)(y,[["render",w]]);var k=_;const A={class:"footer"},V=(0,r.uE)('<div class="footer-wrapper container"><div class="annotation"><span class="annotation__text">© 2022 Wavelovers. Content licensed under </span><a href="https://wavelovers.ru/LICENSE.md" target="_blank">GNU General Public License v3.0</a><br><span class="annotation__text">This site is open source. </span><a href="https://github.com/eugene-serb/wavelovers/" target="_blank">Improve this page.</a></div><div class="annotation created-by"><span class="annotation__text">Created by</span><a href="https://eugene-serb.github.io/" target="_blank" translate="no">Eugene Serb</a></div></div>',1),T=[V];function P(e,t,a,n,o,i){return(0,r.wg)(),(0,r.iD)("footer",A,T)}var G=(0,r.aZ)({name:"AppFooter"});const C=(0,W.Z)(G,[["render",P]]);var E=C,j=(0,r.aZ)({name:"App",components:{AppHeader:k,AppFooter:E}});const Z=(0,W.Z)(j,[["render",o]]);var x=Z,D=a(2483);const M={class:"page container"},L=(0,r._)("h1",{class:"visually-hidden"},"Wavelovers",-1);function O(e,t,a,n,o,i){const s=(0,r.up)("WaveloversApp");return(0,r.wg)(),(0,r.iD)("main",M,[L,(0,r.Wm)(s)])}const S={class:"wavelovers"},F=(0,r.Uk)("Loading..."),q=(0,r.Uk)("Press any gamepad's button or connect new gamepad.");function I(e,t,a,n,o,i){const s=(0,r.up)("PatternList"),c=(0,r.up)("MessageItem"),l=(0,r.up)("GamepadList");return(0,r.wg)(),(0,r.iD)("div",S,[e.patterns.length>0?((0,r.wg)(),(0,r.j4)(s,{key:0,patterns:e.patterns,mode:e.mode,isActive:e.isActive,onChange:e.change},null,8,["patterns","mode","isActive","onChange"])):((0,r.wg)(),(0,r.j4)(c,{key:1},{default:(0,r.w5)((()=>[F])),_:1})),e.gamepads.length>0?((0,r.wg)(),(0,r.j4)(l,{key:2,gamepads:e.gamepads},null,8,["gamepads"])):((0,r.wg)(),(0,r.j4)(c,{key:3},{default:(0,r.w5)((()=>[q])),_:1}))])}const N={class:"pattern-list"};function U(e,t,a,n,o,i){const s=(0,r.up)("PatternItem");return(0,r.wg)(),(0,r.iD)("div",N,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.patterns,((t,a)=>((0,r.wg)(),(0,r.j4)(s,{key:t.name,pattern:t,index:a,mode:e.mode,isActive:e.isActive,onChange:e.change},null,8,["pattern","index","mode","isActive","onChange"])))),128))])}var H=a(7139);const z=["textContent"],B=["textContent"];function Q(e,t,a,n,o,i){return(0,r.wg)(),(0,r.iD)("div",{onClick:t[0]||(t[0]=t=>e.change(e.index)),class:(0,H.C_)(["pattern-item",e.index===e.mode&&!0===e.isActive?"pattern-item_selected":""])},[(0,r._)("span",{class:"pattern-item__icon",textContent:(0,H.zw)(e.pattern.icon)},null,8,z),(0,r._)("span",{class:"pattern-item__name",textContent:(0,H.zw)(e.pattern.name)},null,8,B)],2)}var R=(0,r.aZ)({name:"PatternItem",props:{pattern:{type:Object},index:{type:Number},mode:{type:Number},isActive:{type:Boolean}},methods:{change(e){this.$emit("change",e)}}});const K=(0,W.Z)(R,[["render",Q]]);var Y=K,$=(0,r.aZ)({name:"PatternList",props:{patterns:{type:Array},mode:{type:Number},isActive:{type:Boolean}},components:{PatternItem:Y},methods:{change(e){this.$emit("change",e)}}});const J=(0,W.Z)($,[["render",U]]);var X=J;const ee={class:"device-list"};function te(e,t,a,n,o,i){const s=(0,r.up)("GamepadItem");return(0,r.wg)(),(0,r.iD)("div",ee,[((0,r.wg)(!0),(0,r.iD)(r.HY,null,(0,r.Ko)(e.gamepads,(e=>((0,r.wg)(),(0,r.j4)(s,{key:e.id,textContent:(0,H.zw)(e.unit.id)},null,8,["textContent"])))),128))])}const ae={class:"list-item"};function ne(e,t,a,n,o,i){return(0,r.wg)(),(0,r.iD)("div",ae)}var re=(0,r.aZ)({name:"GamepadItem"});const oe=(0,W.Z)(re,[["render",ne]]);var ie=oe,se=(0,r.aZ)({name:"GamepadList",props:{gamepads:{type:Array}},components:{GamepadItem:ie}});const ce=(0,W.Z)(se,[["render",te]]);var le=ce;const de={class:"message"};function ue(e,t,a,n,o,i){return(0,r.wg)(),(0,r.iD)("div",de,[(0,r._)("span",null,[(0,r.WI)(e.$slots,"default")])])}var ve=(0,r.aZ)({name:"MessageItem"});const me=(0,W.Z)(ve,[["render",ue]]);var pe=me,he=a(2482);class ge{constructor(e){(0,he.Z)(this,"id",void 0),(0,he.Z)(this,"canVibrate",void 0),(0,he.Z)(this,"isVibrating",void 0),(0,he.Z)(this,"unit",void 0),(0,he.Z)(this,"pattern",void 0),this.unit=e,this.id=Date.now(),this.canVibrate=!!this.unit.vibrationActuator,this.isVibrating=!1,this.pattern=[]}update(){const e=navigator.getGamepads();this.unit=e[this.unit.index]}reset(){this.isVibrating=!1,this.unit.vibrationActuator.reset()}async vibrate(e){this.isVibrating=!0,this.pattern=e;while(!0===this.isVibrating)for(let e=0;e<this.pattern.length;e++){if(!0!==this.isVibrating)return;this.unit.vibrationActuator.playEffect("dual-rumble",this.pattern[e]),await this.sleep(this.pattern[e].startDelay+this.pattern[e].duration+100)}}sleep(e){return new Promise((t=>setTimeout(t,e)))}}var fe=(0,r.aZ)({name:"WaveloversApp",components:{PatternList:X,GamepadList:le,MessageItem:pe},data:()=>({gamepads:[],patterns:[],isActive:!1,mode:0}),methods:{loadPatterns:async function(){const e="https://wavelovers.ru/assets/patterns.json";try{const t=await fetch(e);if(t.ok){let e=await t.json();this.patterns=e}else console.log("Connect to the Internet for download more patterns...")}catch(t){console.log(t)}},addEventListeners(){window.addEventListener("gamepadconnected",(e=>this.addGamepad(e))),window.addEventListener("gamepaddisconnected",(e=>this.deleteGamepad(e)))},addGamepad(e){const t=e;this.gamepads.length>=1||this.gamepads.push(new ge(t.gamepad))},deleteGamepad(e){this.gamepads.forEach(((t,a)=>{t.unit.id===e.gamepad.id&&this.gamepads.splice(a,1)}))},change(e){this.mode===e?(this.isActive=!this.isActive,this.reset()):(this.isActive=!0,this.mode=e),!0===this.isActive&&(this.reset(),this.vibrate())},vibrate(){this.gamepads.forEach((e=>{e.vibrate(this.patterns[this.mode].pattern)}))},reset(){this.gamepads.forEach((e=>{e.reset()}))}},mounted(){this.loadPatterns(),this.addEventListeners()}});const be=(0,W.Z)(fe,[["render",I]]);var we=be,ye=(0,r.aZ)({name:"HomeView",components:{WaveloversApp:we}});const We=(0,W.Z)(ye,[["render",O]]);var _e=We;function ke(e,t){e.map((e=>{const a=document.createElement(t);return Object.keys(e).forEach((t=>{a.setAttribute(t,e[t])})),a.setAttribute("data-vue-router-controlled",""),a})).forEach((e=>document.head.appendChild(e)))}function Ae(e,t,a){const n=e.matched.slice().reverse().find((e=>e.meta&&e.meta.title)),r=e.matched.slice().reverse().find((e=>e.meta&&e.meta.metaTags&&e.meta.linkTags));if(n&&(document.title=n.meta.title),Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map((e=>{e.parentNode&&e.parentNode.removeChild(e)})),!r)return a();const o=r.meta.linkTags,i=r.meta.metaTags;return ke(o,"link"),ke(i,"meta"),a()}const Ve={update:Ae};var Te=Ve;const Pe=[{path:"/",name:"home",component:_e,meta:{title:"Wavelovers",metaTags:[{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"og:title",content:"Wavelovers"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/"},{name:"twitter:title",content:"Wavelovers"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/"}]}},{path:"/about",name:"about",component:()=>a.e(548).then(a.bind(a,2548)),meta:{title:"Wavelovers About",metaTags:[{name:"description",content:"Wavelovers. Page with information about the project and data on donations."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, advertise, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, реклама"},{name:"og:title",content:"Wavelovers About"},{name:"og:description",content:"Wavelovers. Page with information about the project and data on donations."},{name:"og:url",content:"https://wavelovers.ru/about"},{name:"twitter:title",content:"Wavelovers About"},{name:"twitter:description",content:"Wavelovers. Page with information about the project and data on donations."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/about"}]}},{path:"/faq",name:"faq",component:()=>a.e(877).then(a.bind(a,877)),meta:{title:"Wavelovers FAQ",metaTags:[{name:"description",content:"Wavelovers. Frequently asked questions page."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, FAQ, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, часто задаваемые вопросы"},{name:"og:title",content:"Wavelovers FAQ"},{name:"og:description",content:"Wavelovers. Frequently asked questions page."},{name:"og:url",content:"https://wavelovers.ru/faq"},{name:"twitter:title",content:"Wavelovers FAQ"},{name:"twitter:description",content:"Wavelovers. Frequently asked questions page."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/faq"}]}},{path:"/donate",name:"donate",component:()=>a.e(93).then(a.bind(a,93)),meta:{title:"Wavelovers Donate",metaTags:[{name:"description",content:"Wavelovers. Donate to the author."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, Donate, Support, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, задонатить, пожертвовать, помочь, поблагодарить"},{name:"og:title",content:"Wavelovers Donate"},{name:"og:description",content:"Wavelovers. Donate to the author."},{name:"og:url",content:"https://wavelovers.ru/donate"},{name:"twitter:title",content:"Wavelovers Donate"},{name:"twitter:description",content:"Wavelovers. Donate to the author."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/donate"}]}},{path:"/404",name:"404",component:()=>a.e(447).then(a.bind(a,8447)),meta:{title:"Wavelovers 404 Page not found",metaTags:[{name:"description",content:"Wavelovers. Page not found."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, 404, page not found, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, 404, страница не найдена"},{name:"og:title",content:"Wavelovers 404 Page not found"},{name:"og:description",content:"Wavelovers. Page not found."},{name:"og:url",content:"https://wavelovers.ru/404"},{name:"twitter:title",content:"Wavelovers 404 Page not found"},{name:"twitter:description",content:"Wavelovers. Page not found."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/404"}]}},{path:"/:catchAll(.*)",redirect:"/404"}],Ge=(0,D.p7)({history:(0,D.PO)("/"),routes:Pe});Ge.beforeEach(Te.update);var Ce=Ge;(0,n.ri)(x).use(Ce).mount("#app")}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.m=e,function(){var e=[];a.O=function(t,n,r,o){if(!n){var i=1/0;for(d=0;d<e.length;d++){n=e[d][0],r=e[d][1],o=e[d][2];for(var s=!0,c=0;c<n.length;c++)(!1&o||i>=o)&&Object.keys(a.O).every((function(e){return a.O[e](n[c])}))?n.splice(c--,1):(s=!1,o<i&&(i=o));if(s){e.splice(d--,1);var l=r();void 0!==l&&(t=l)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]}}(),function(){a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,{a:t}),t}}(),function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,n){return a.f[n](e,t),t}),[]))}}(),function(){a.u=function(e){return"js/"+e+"."+{93:"22832789",447:"cde26208",548:"8603e4a4",877:"a8dd8d41"}[e]+".js"}}(),function(){a.miniCssF=function(e){return"css/"+e+".c8608f84.css"}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="wavelovers:";a.l=function(n,r,o,i){if(e[n])e[n].push(r);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+o){s=u;break}}s||(c=!0,s=document.createElement("script"),s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",t+o),s.src=n),e[n]=[r];var v=function(t,a){s.onerror=s.onload=null,clearTimeout(m);var r=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach((function(e){return e(a)})),t)return t(a)},m=setTimeout(v.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=v.bind(null,s.onerror),s.onload=v.bind(null,s.onload),c&&document.head.appendChild(s)}}}(),function(){a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){a.p="/"}(),function(){var e=function(e,t,a,n){var r=document.createElement("link");r.rel="stylesheet",r.type="text/css";var o=function(o){if(r.onerror=r.onload=null,"load"===o.type)a();else{var i=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.href||t,c=new Error("Loading CSS chunk "+e+" failed.\n("+s+")");c.code="CSS_CHUNK_LOAD_FAILED",c.type=i,c.request=s,r.parentNode.removeChild(r),n(c)}};return r.onerror=r.onload=o,r.href=t,document.head.appendChild(r),r},t=function(e,t){for(var a=document.getElementsByTagName("link"),n=0;n<a.length;n++){var r=a[n],o=r.getAttribute("data-href")||r.getAttribute("href");if("stylesheet"===r.rel&&(o===e||o===t))return r}var i=document.getElementsByTagName("style");for(n=0;n<i.length;n++){r=i[n],o=r.getAttribute("data-href");if(o===e||o===t)return r}},n=function(n){return new Promise((function(r,o){var i=a.miniCssF(n),s=a.p+i;if(t(i,s))return r();e(n,s,r,o)}))},r={143:0};a.f.miniCss=function(e,t){var a={447:1};r[e]?t.push(r[e]):0!==r[e]&&a[e]&&t.push(r[e]=n(e).then((function(){r[e]=0}),(function(t){throw delete r[e],t})))}}(),function(){var e={143:0};a.f.j=function(t,n){var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(a,n){r=e[t]=[a,n]}));n.push(r[2]=o);var i=a.p+a.u(t),s=new Error,c=function(n){if(a.o(e,t)&&(r=e[t],0!==r&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",s.name="ChunkLoadError",s.type=o,s.request=i,r[1](s)}};a.l(i,c,"chunk-"+t,t)}},a.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,o,i=n[0],s=n[1],c=n[2],l=0;if(i.some((function(t){return 0!==e[t]}))){for(r in s)a.o(s,r)&&(a.m[r]=s[r]);if(c)var d=c(a)}for(t&&t(n);l<i.length;l++)o=i[l],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(d)},n=self["webpackChunkwavelovers"]=self["webpackChunkwavelovers"]||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var n=a.O(void 0,[998],(function(){return a(970)}));n=a.O(n)})();
//# sourceMappingURL=app.5291f554.js.map