From b368b359d8c9add4680aab93f2cda5a7ff70b501 Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sat, 10 Sep 2022 20:48:33 +0300 Subject: [PATCH] - recoded MetaTagUpdater. - added metas array with metas. - added interfaces IRouteMeta, IMeta, ITag. - deleted metas from routes. - modified metas by types. - updated router index. - up minor version. --- docs/index.html | 2 +- docs/js/app.5845d133.js | 2 ++ docs/js/app.5845d133.js.map | 1 + docs/js/app.c1a049b3.js | 2 -- docs/js/app.c1a049b3.js.map | 1 - package-lock.json | 4 +-- package.json | 3 +- src/router/assets/metas.ts | 46 +++++++++++++++++++++++++++ src/router/assets/metas/404.ts | 4 ++- src/router/assets/metas/About.ts | 4 ++- src/router/assets/metas/Custom.ts | 4 ++- src/router/assets/metas/Diagnostic.ts | 4 ++- src/router/assets/metas/Donate.ts | 4 ++- src/router/assets/metas/Faq.ts | 4 ++- src/router/assets/metas/Manual.ts | 4 ++- src/router/assets/metas/Patterns.ts | 4 ++- src/router/assets/routes.ts | 16 ---------- src/router/index.ts | 3 +- src/router/models/IMeta.ts | 9 ++++++ src/router/models/IRouteMeta.ts | 8 +++++ src/router/models/ITag.ts | 5 +++ src/router/modules/MetaTagUpdater.ts | 45 ++++++++++++-------------- 22 files changed, 122 insertions(+), 57 deletions(-) create mode 100644 docs/js/app.5845d133.js create mode 100644 docs/js/app.5845d133.js.map delete mode 100644 docs/js/app.c1a049b3.js delete mode 100644 docs/js/app.c1a049b3.js.map create mode 100644 src/router/assets/metas.ts create mode 100644 src/router/models/IMeta.ts create mode 100644 src/router/models/IRouteMeta.ts create mode 100644 src/router/models/ITag.ts diff --git a/docs/index.html b/docs/index.html index 57e22cf..bd4b5d9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,4 +15,4 @@ webvisor: true });
\ No newline at end of file + }
\ No newline at end of file diff --git a/docs/js/app.5845d133.js b/docs/js/app.5845d133.js new file mode 100644 index 0000000..aee8b80 --- /dev/null +++ b/docs/js/app.5845d133.js @@ -0,0 +1,2 @@ +(function(){"use strict";var e={2272:function(e,t,a){var n=a(9242),o=a(3396);const r={class:"page container"},i={class:"wavelovers"};function s(e,t,a,n,s,c){const d=(0,o.up)("HeaderItem"),u=(0,o.up)("router-view"),v=(0,o.up)("FooterItem");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.Wm)(d),(0,o._)("main",r,[(0,o._)("div",i,[(0,o.Wm)(u)])]),(0,o.Wm)(v)],64)}var c=a(1746);const d={class:"header"},u={class:"header-wrapper container"},v=(0,o._)("div",{class:"logo-wrapper"},[(0,o._)("span",{class:"logo-wrapper__logo",translate:"no"},"Wavelovers")],-1),l={class:"menu-wrapper"},m={class:"navigation"},p={class:"navigation__item"},f=(0,o.Uk)("Home"),h={class:"navigation__item"},g=(0,o.Uk)("FAQ"),b={class:"navigation__item"},w=(0,o.Uk)("About"),y={class:"navigation__item"},W=(0,o.Uk)("Donate");function V(e,t,a,n,r,i){const s=(0,o.up)("router-link");return(0,o.wg)(),(0,o.iD)("header",d,[(0,o._)("div",u,[v,(0,o._)("nav",l,[(0,o._)("ul",m,[(0,o._)("li",p,[(0,o.Wm)(s,{to:"/"},{default:(0,o.w5)((()=>[f])),_:1})]),(0,o._)("li",h,[(0,o.Wm)(s,{to:"/faq"},{default:(0,o.w5)((()=>[g])),_:1})]),(0,o._)("li",b,[(0,o.Wm)(s,{to:"/about"},{default:(0,o.w5)((()=>[w])),_:1})]),(0,o._)("li",y,[(0,o.Wm)(s,{to:"/donate"},{default:(0,o.w5)((()=>[W])),_:1})])])])])])}var k=(0,o.aZ)({name:"HeaderItem"}),M=a(89);const G=(0,M.Z)(k,[["render",V]]);var T=G;const _={class:"footer"},A=(0,o.uE)('',1),P=[A];function E(e,t,a,n,r,i){return(0,o.wg)(),(0,o.iD)("footer",_,P)}var q=(0,o.aZ)({name:"FooterItem"});const C=(0,M.Z)(q,[["render",E]]);var L=C,S=(0,o.aZ)({name:"App",components:{HeaderItem:T,FooterItem:L},methods:{addGamepad:function(e){c.Z.dispatch("addGamepad",e)},deleteGamepad:function(e){c.Z.dispatch("deleteGamepad",e)},addEventListeners:function(){window.addEventListener("gamepadconnected",this.addGamepad),window.addEventListener("gamepaddisconnected",this.deleteGamepad)},removeEventListeners:function(){window.removeEventListener("gamepadconnected",this.addGamepad),window.removeEventListener("gamepaddisconnected",this.deleteGamepad)}},mounted(){this.addEventListeners()},unmounted(){this.removeEventListeners()}});const j=(0,M.Z)(S,[["render",s]]);var D=j,U=a(2483);function I(e,t,a,n,o){return o.forEach((t=>{t.query===e.fullPath&&n.push(t.path)})),a()}const O={update:I};var x=O;function F(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 Z(e,t,a,n){Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map((e=>{e.parentNode&&e.parentNode.removeChild(e)}));let o="",r=[],i=[];return n.forEach((t=>{t.route===e.fullPath&&t.meta&&(o=t.meta.title,r=t.meta.metaTags,i=t.meta.linkTags)})),o&&(document.title=o),r&&F(r,"meta"),i&&F(i,"link"),a()}const N={update:Z};var z=N;const R=[{path:"/",name:"patterns-view",component:()=>a.e(743).then(a.bind(a,2743))},{path:"/custom",name:"custom-view",component:()=>a.e(402).then(a.bind(a,4402))},{path:"/manual",name:"manual-view",component:()=>a.e(286).then(a.bind(a,5286))},{path:"/diagnostic",name:"diagnostic-view",component:()=>a.e(114).then(a.bind(a,2114))},{path:"/faq",name:"faq-view",component:()=>a.e(370).then(a.bind(a,6370))},{path:"/about",name:"about-view",component:()=>a.e(994).then(a.bind(a,3994))},{path:"/donate",name:"donate-view",component:()=>a.e(37).then(a.bind(a,3037))},{path:"/404",name:"404",component:()=>a.e(784).then(a.bind(a,7784))},{path:"/:catchAll(.*)*",redirect:"/404"}];var H=R;const Q=[{query:"/?custom",path:"/custom"},{query:"/?manual",path:"/manual"},{query:"/?diagnostic",path:"/diagnostic"},{query:"/?faq",path:"/faq"},{query:"/?about",path:"/about"},{query:"/?donate",path:"/donate"}];var B=Q;const K={title:"Wavelovers",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{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:[{rel:"canonical",href:"https://wavelovers.ru/"}]};var Y=K;const J={title:"Wavelovers – Custom",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:title",content:"Wavelovers – Custom"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/custom"},{name:"twitter:title",content:"Wavelovers – Custom"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/custom"}]};var X=J;const $={title:"Wavelovers – Manual",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:title",content:"Wavelovers – Manual"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/manual"},{name:"twitter:title",content:"Wavelovers – Manual"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/manual"}]};var ee=$;const te={title:"Wavelovers – Diagnostic",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:title",content:"Wavelovers – Diagnostic"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/diagnostic"},{name:"twitter:title",content:"Wavelovers – Diagnostic"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/diagnostic"}]};var ae=te;const ne={title:"Wavelovers – FAQ",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, FAQ, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, часто задаваемые вопросы"},{name:"description",content:"Wavelovers. Frequently asked questions page."},{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:[{rel:"canonical",href:"https://wavelovers.ru/faq"}]};var oe=ne;const re={title:"Wavelovers – About",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, advertise, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, реклама"},{name:"description",content:"Wavelovers. Page with information about the project and data on donations."},{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:[{rel:"canonical",href:"https://wavelovers.ru/about"}]};var ie=re;const se={title:"Wavelovers – Donate",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, Donate, Support, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, задонатить, пожертвовать, помочь, поблагодарить"},{name:"description",content:"Wavelovers. Donate to the author."},{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:[{rel:"canonical",href:"https://wavelovers.ru/donate"}]};var ce=se;const de={title:"Wavelovers – Page not found",metaTags:[{name:"og:title",content:"Wavelovers – Page not found"},{name:"og:url",content:"https://wavelovers.ru/404"}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/404"}]};var ue=de;const ve=[{route:"/",meta:Y},{route:"/custom",meta:X},{route:"/manual",meta:ee},{route:"/diagnostic",meta:ae},{route:"/faq",meta:oe},{route:"/about",meta:ie},{route:"/donate",meta:ce},{route:"/404",meta:ue}];var le=ve;const me=(0,U.p7)({history:(0,U.PO)("/"),routes:H});me.beforeEach(((e,t,a)=>{x.update(e,t,a,me,B),z.update(e,t,a,le)}));var pe=me;(0,n.ri)(D).use(c.Z).use(pe).mount("#app")},1746:function(e,t,a){a.d(t,{Z:function(){return l}});var n=a(65),o=a(2482);class r{constructor(e){(0,o.Z)(this,"unit",void 0),(0,o.Z)(this,"id",void 0),(0,o.Z)(this,"canVibrate",void 0),(0,o.Z)(this,"isVibrating",void 0),(0,o.Z)(this,"interval",void 0),this.unit=e,this.id=Date.now(),this.canVibrate=!!this.unit.vibrationActuator,this.isVibrating=!1,this.update=this.update.bind(this),this.interval=setInterval(this.update,1)}update(){const e=navigator.getGamepads();this.unit=e[this.unit.index]}async loop(e){this.isVibrating=!0;const t=10;while(!0===this.isVibrating)for(let a=0;asetTimeout(t,e)))}}var i=r;const s={state:()=>({gamepads:[]}),getters:{gamepads:function(e){return e.gamepads}},mutations:{addGamepad:function(e,t){e.gamepads.push(t)},deleteGamepad:function(e,t){e.gamepads.splice(t,1)}},actions:{addGamepad:function(e,t){const a=t;e.getters.gamepads.length>=1||e.commit("addGamepad",new i(a.gamepad))},deleteGamepad:function(e,t){e.getters.gamepads.forEach(((a,n)=>{a.unit.id===t.gamepad.id&&e.commit("deleteGamepad",n)}))},loop:function(e,t){e.getters.gamepads.forEach((e=>{e.loop(t)}))},vibrate:function(e,t){e.getters.gamepads.forEach((e=>{e.vibrate(t)}))},reset:function(e){e.getters.gamepads.forEach((e=>{e.reset()}))}}};var c=s;const d={state:()=>({patterns:[]}),getters:{patterns:function(e){return e.patterns}},mutations:{setPatterns:function(e,t){e.patterns=t}},actions:{loadPatterns:async function(e){const t="https://wavelovers.ru/assets/patterns.json";try{const a=await fetch(t);if(a.ok){const t=await a.json();e.commit("setPatterns",t)}else console.log("Connect to the Internet for download more patterns...")}catch(a){console.log(a)}}}};var u=d;const v=(0,n.MT)({state:()=>({mode:0,isActive:!1}),getters:{mode:function(e){return e.mode},isActive:function(e){return e.isActive}},mutations:{setMode:function(e,t){e.mode=t},setIsActive:function(e,t){e.isActive=t}},actions:{setMode:function(e,t){e.commit("setMode",t)},setIsActive:function(e,t){e.commit("setIsActive",t)},change:function(e,t){e.getters.mode===t?e.dispatch("setIsActive",!e.getters.isActive):(e.dispatch("setIsActive",!0),e.dispatch("setMode",t)),!0===e.getters.isActive?(e.dispatch("reset"),e.dispatch("loop",e.getters.patterns[e.getters.mode].pattern)):e.dispatch("reset")},startCustom:function(e,t){e.dispatch("setIsActive",!1),e.dispatch("setMode",0),e.dispatch("reset"),e.dispatch("loop",t)}},modules:{MGamepads:c,MPatterns:u}});var l=v}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.m=e,function(){var e=[];a.O=function(t,n,o,r){if(!n){var i=1/0;for(u=0;u=r)&&Object.keys(a.O).every((function(e){return a.O[e](n[c])}))?n.splice(c--,1):(s=!1,r0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[n,o,r]}}(),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+"."+{37:"e3372f87",114:"98880cb6",286:"cdd8d127",370:"2a33e7b8",402:"5e25729c",743:"4b374804",784:"8d118bb9",994:"7e011783"}[e]+".js"}}(),function(){a.miniCssF=function(e){return"css/"+e+"."+{37:"bb6440f7",114:"266e2dcc",286:"d84ba812",402:"c3fb6094",743:"ef4a4981",994:"278b2bb3"}[e]+".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,o,r,i){if(e[n])e[n].push(o);else{var s,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),u=0;u [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"li\", _hoisted_8, [\n _createVNode(_component_router_link, { to: \"/faq\" }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"li\", _hoisted_10, [\n _createVNode(_component_router_link, { to: \"/about\" }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"li\", _hoisted_12, [\n _createVNode(_component_router_link, { to: \"/donate\" }, {\n default: _withCtx(() => [\n _hoisted_13\n ]),\n _: 1\n })\n ])\n ])\n ])\n ])\n ]))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'HeaderItem',\r\n });\r\n","import { render } from \"./HeaderItem.vue?vue&type=template&id=b3272126&ts=true\"\nimport script from \"./HeaderItem.vue?vue&type=script&lang=ts\"\nexport * from \"./HeaderItem.vue?vue&type=script&lang=ts\"\n\nimport \"./HeaderItem.vue?vue&type=style&index=0&id=b3272126&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { createElementVNode as _createElementVNode, createStaticVNode as _createStaticVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"footer\" }\nconst _hoisted_2 = /*#__PURE__*/_createStaticVNode(\"
© 2022 Wavelovers. Content licensed under GNU General Public License v3.0
This site is open source. Improve this page.
Created byEugene Serb
\", 1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"footer\", _hoisted_1, _hoisted_3))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'FooterItem',\r\n });\r\n","import { render } from \"./FooterItem.vue?vue&type=template&id=c1770678&ts=true\"\nimport script from \"./FooterItem.vue?vue&type=script&lang=ts\"\nexport * from \"./FooterItem.vue?vue&type=script&lang=ts\"\n\nimport \"./FooterItem.vue?vue&type=style&index=0&id=c1770678&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import store from '@/store/index';\r\n import HeaderItem from '@/components/HeaderItem.vue';\r\n import FooterItem from '@/components/FooterItem.vue';\r\n\r\n export default defineComponent({\r\n name: 'App',\r\n components: {\r\n HeaderItem: HeaderItem,\r\n FooterItem: FooterItem,\r\n },\r\n methods: {\r\n addGamepad: function (event: GamepadEvent): void {\r\n store.dispatch('addGamepad', event);\r\n },\r\n deleteGamepad: function (event: GamepadEvent): void {\r\n store.dispatch('deleteGamepad', event);\r\n },\r\n addEventListeners: function (): void {\r\n window.addEventListener('gamepadconnected', this.addGamepad);\r\n window.addEventListener('gamepaddisconnected', this.deleteGamepad);\r\n },\r\n removeEventListeners: function (): void {\r\n window.removeEventListener('gamepadconnected', this.addGamepad);\r\n window.removeEventListener('gamepaddisconnected', this.deleteGamepad);\r\n },\r\n },\r\n mounted() {\r\n this.addEventListeners();\r\n },\r\n unmounted() {\r\n this.removeEventListeners();\r\n },\r\n });\r\n","import { render } from \"./App.vue?vue&type=template&id=385bacb8&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import {\r\n Router, NavigationGuardNext, RouteLocationNormalized\r\n} from \"vue-router\";\r\nimport IQueryRoute from '@/router/models/IQueryRoute';\r\n\r\nfunction updateRoute(\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext,\r\n router: Router,\r\n routes: Array\r\n): void {\r\n routes.forEach((route) => {\r\n if (route.query === to.fullPath) {\r\n router.push(route.path);\r\n }\r\n });\r\n return next();\r\n}\r\n\r\nconst QueryRouter = {\r\n update: updateRoute,\r\n};\r\n\r\nexport default QueryRouter;\r\n","import { NavigationGuardNext, RouteLocationNormalized } from \"vue-router\";\r\nimport IRouteMeta from \"@/router/models/IRouteMeta\";\r\nimport ITag from '@/router/models/ITag';\r\n\r\nfunction appendTags(tagsArray: object[], type: string) {\r\n tagsArray.map(\r\n (meta: object) => {\r\n const tag = document.createElement(type);\r\n\r\n (Object.keys(meta) as Array)\r\n .forEach((key) => {\r\n tag.setAttribute(key, meta[key] as string);\r\n });\r\n tag.setAttribute('data-vue-router-controlled', '');\r\n\r\n return tag;\r\n }\r\n ).forEach(tag => document.head.appendChild(tag));\r\n}\r\n\r\nfunction updateMetatag(\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext,\r\n metas: Array\r\n) {\r\n Array.from(document.querySelectorAll('[data-vue-router-controlled]'))\r\n .map(el => {\r\n if (el.parentNode) {\r\n el.parentNode.removeChild(el);\r\n }\r\n });\r\n\r\n let title: string = '' as string;\r\n let metaTags: Array = [] as Array;\r\n let linkTags: Array = [] as Array;\r\n\r\n metas.forEach((item) => {\r\n if (item.route === to.fullPath) {\r\n if (item.meta) {\r\n title = item.meta.title;\r\n metaTags = item.meta.metaTags;\r\n linkTags = item.meta.linkTags;\r\n }\r\n }\r\n });\r\n\r\n if (title) document.title = title;\r\n if (metaTags) appendTags(metaTags, 'meta');\r\n if (linkTags) appendTags(linkTags, 'link');\r\n\r\n return next();\r\n}\r\n\r\nconst MetaTagUpdater = {\r\n update: updateMetatag,\r\n};\r\n\r\nexport default MetaTagUpdater;\r\n","import { RouteRecordRaw } from 'vue-router';\r\n\r\nconst routes: Array = [\r\n {\r\n path: '/',\r\n name: 'patterns-view',\r\n component: () => import('@/views/PatternsView.vue'),\r\n },\r\n {\r\n path: '/custom',\r\n name: 'custom-view',\r\n component: () => import('@/views/CustomView.vue'),\r\n },\r\n {\r\n path: '/manual',\r\n name: 'manual-view',\r\n component: () => import('@/views/ManualView.vue'),\r\n },\r\n {\r\n path: '/diagnostic',\r\n name: 'diagnostic-view',\r\n component: () => import('@/views/DiagnosticView.vue'),\r\n },\r\n {\r\n path: '/faq',\r\n name: 'faq-view',\r\n component: () => import('@/views/FaqView.vue'),\r\n },\r\n {\r\n path: '/about',\r\n name: 'about-view',\r\n component: () => import('@/views/AboutView.vue'),\r\n },\r\n {\r\n path: '/donate',\r\n name: 'donate-view',\r\n component: () => import('@/views/DonateView.vue'),\r\n },\r\n {\r\n path: '/404',\r\n name: '404',\r\n component: () => import('@/views/NotFoundView.vue'),\r\n },\r\n {\r\n path: '/:catchAll(.*)*',\r\n redirect: '/404',\r\n },\r\n];\r\n\r\nexport default routes;\r\n","import IQueryRoute from '@/router/models/IQueryRoute';\r\n\r\nconst queries: Array = [\r\n {\r\n query: '/?custom',\r\n path: '/custom',\r\n },\r\n {\r\n query: '/?manual',\r\n path: '/manual',\r\n },\r\n {\r\n query: '/?diagnostic',\r\n path: '/diagnostic',\r\n },\r\n {\r\n query: '/?faq',\r\n path: '/faq',\r\n },\r\n {\r\n query: '/?about',\r\n path: '/about',\r\n },\r\n {\r\n query: '/?donate',\r\n path: '/donate',\r\n }\r\n];\r\n\r\nexport default queries;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers – Custom',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Custom',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/custom',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Custom',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/custom',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers – Manual',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Manual',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/manual',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Manual',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/manual',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers – Diagnostic',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Diagnostic',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/diagnostic',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Diagnostic',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/diagnostic',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers – FAQ',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, FAQ, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, часто задаваемые вопросы',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Frequently asked questions page.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – FAQ',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Frequently asked questions page.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/faq',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – FAQ',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Frequently asked questions page.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/faq',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers – About',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, advertise, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, реклама',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Page with information about the project and data on donations.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – About',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Page with information about the project and data on donations.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/about',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – About',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Page with information about the project and data on donations.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/about',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers – Donate',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, Donate, Support, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, задонатить, пожертвовать, помочь, поблагодарить',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Donate to the author.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Donate',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Donate to the author.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/donate',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Donate',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Donate to the author.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/donate',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IMeta from '@/router/models/IMeta';\r\n\r\nconst meta: IMeta = {\r\n title: 'Wavelovers – Page not found',\r\n metaTags: [\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Page not found',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/404',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/404',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import IRouteMeta from '@/router/models/IRouteMeta';\r\nimport metaPatterns from '@/router/assets/metas/Patterns';\r\nimport metaCustom from '@/router/assets/metas/Custom';\r\nimport metaManual from '@/router/assets/metas/Manual';\r\nimport metaDiagnostic from '@/router/assets/metas/Diagnostic';\r\nimport metaFaq from '@/router/assets/metas/Faq';\r\nimport metaAbout from '@/router/assets/metas/About';\r\nimport metaDonate from '@/router/assets/metas/Donate';\r\nimport meta404 from '@/router/assets/metas/404';\r\n\r\nconst metas: Array = [\r\n {\r\n route: '/',\r\n meta: metaPatterns,\r\n },\r\n {\r\n route: '/custom',\r\n meta: metaCustom,\r\n },\r\n {\r\n route: '/manual',\r\n meta: metaManual,\r\n },\r\n {\r\n route: '/diagnostic',\r\n meta: metaDiagnostic,\r\n },\r\n {\r\n route: '/faq',\r\n meta: metaFaq,\r\n },\r\n {\r\n route: '/about',\r\n meta: metaAbout,\r\n },\r\n {\r\n route: '/donate',\r\n meta: metaDonate,\r\n },\r\n {\r\n route: '/404',\r\n meta: meta404,\r\n },\r\n];\r\n\r\nexport default metas;\r\n","import {\r\n createRouter, createWebHistory,\r\n NavigationGuardNext, RouteLocationNormalized\r\n} from 'vue-router';\r\nimport QueryRouter from '@/router/modules/QueryRouter';\r\nimport MetaTagUpdater from '@/router/modules/MetaTagUpdater';\r\nimport routes from '@/router/assets/routes';\r\nimport queries from '@/router/assets/queries';\r\nimport metas from '@/router/assets/metas';\r\n\r\nconst router = createRouter({\r\n history: createWebHistory(process.env.BASE_URL),\r\n routes,\r\n});\r\n\r\nrouter.beforeEach((\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext\r\n) => {\r\n QueryRouter.update(to, from, next, router, queries);\r\n MetaTagUpdater.update(to, from, next, metas)\r\n});\r\n\r\nexport default router;\r\n","import { createApp } from 'vue';\r\nimport App from '@/App.vue';\r\nimport router from '@/router';\r\nimport store from '@/store';\r\n\r\ncreateApp(App)\r\n .use(store)\r\n .use(router)\r\n .mount('#app');\r\n","import TPatternUnit from '@/models/TPatternUnit';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IVibrator from '@/models/IVibrator';\r\n\r\nclass Vibrator implements IVibrator {\r\n\r\n unit: IGamepad;\r\n readonly id: number;\r\n readonly canVibrate: boolean;\r\n isVibrating: boolean;\r\n interval: number;\r\n\r\n constructor(unit: IGamepad) {\r\n this.unit = unit;\r\n this.id = Date.now();\r\n this.canVibrate = (this.unit.vibrationActuator) ? true : false;\r\n this.isVibrating = false;\r\n this.update = this.update.bind(this);\r\n this.interval = setInterval(this.update, 1);\r\n }\r\n\r\n update(): void {\r\n const gamepads = navigator.getGamepads();\r\n this.unit = gamepads[this.unit.index] as unknown as IGamepad;\r\n }\r\n\r\n async loop(pattern: TPatternUnit[]): Promise {\r\n this.isVibrating = true;\r\n const offsetTime = 10;\r\n while (this.isVibrating === true) {\r\n for (let i = 0; i < pattern.length; i++) {\r\n if (this.isVibrating === true) {\r\n this.vibrate(pattern[i]);\r\n await this.sleep(pattern[i].startDelay + pattern[i].duration - offsetTime);\r\n } else {\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n vibrate(pattern: TPatternUnit): void {\r\n this.unit.vibrationActuator.playEffect('dual-rumble', pattern);\r\n }\r\n\r\n reset(): void {\r\n this.isVibrating = false;\r\n this.unit.vibrationActuator.reset();\r\n }\r\n\r\n sleep(ms: number): Promise {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n }\r\n}\r\n\r\nexport default Vibrator;\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IGamepadsState from '@/store/models/IGamepadsState';\r\nimport Vibrator from '@/models/Vibrator';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IGamepadEvent from '@/models/IGamepadEvent';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst MGamepads: Module = {\r\n state: () => ({\r\n gamepads: [] as Vibrator[],\r\n }),\r\n getters: {\r\n gamepads: function (state: IGamepadsState): Vibrator[] {\r\n return state.gamepads as Vibrator[];\r\n },\r\n },\r\n mutations: {\r\n addGamepad: function (state: IGamepadsState, gamepad: Vibrator): void {\r\n state.gamepads.push(gamepad as Vibrator);\r\n },\r\n deleteGamepad: function (state: IGamepadsState, index: number): void {\r\n state.gamepads.splice(index, 1);\r\n },\r\n },\r\n actions: {\r\n addGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n const iEvent: IGamepadEvent = event as unknown as IGamepadEvent;\r\n if (context.getters.gamepads.length >= 1) {\r\n return;\r\n } else {\r\n context.commit('addGamepad', new Vibrator(iEvent.gamepad as IGamepad));\r\n }\r\n },\r\n deleteGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator, index: number) => {\r\n if (gamepad.unit.id === event.gamepad.id) {\r\n context.commit('deleteGamepad', index as number);\r\n }\r\n });\r\n },\r\n loop: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit[]\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.loop(pattern);\r\n });\r\n },\r\n vibrate: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.vibrate(pattern);\r\n });\r\n },\r\n reset: function (\r\n context: ActionContext\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.reset();\r\n });\r\n },\r\n },\r\n};\r\n\r\nexport default MGamepads;\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IPatternState from '@/store/models/IPatternState';\r\nimport TPattern from '@/models/TPattern';\r\n\r\nconst MPatterns: Module = {\r\n state: () => ({\r\n patterns: [] as TPattern[],\r\n }),\r\n getters: {\r\n patterns: function (state: IPatternState): TPattern[] {\r\n return state.patterns as TPattern[];\r\n },\r\n },\r\n mutations: {\r\n setPatterns: function (state: IPatternState, patterns: TPattern[]): void {\r\n state.patterns = patterns as TPattern[];\r\n },\r\n },\r\n actions: {\r\n loadPatterns: async function (\r\n context: ActionContext\r\n ): Promise {\r\n const url = 'https://wavelovers.ru/assets/patterns.json';\r\n try {\r\n const response: Response = await fetch(url);\r\n if (response.ok) {\r\n const json: TPattern[] = await response.json();\r\n context.commit('setPatterns', json as TPattern[]);\r\n } else {\r\n // eslint-disable-next-line\r\n console.log('Connect to the Internet for download more patterns...');\r\n }\r\n } catch (error) {\r\n // eslint-disable-next-line\r\n console.log(error);\r\n }\r\n },\r\n },\r\n};\r\n\r\nexport default MPatterns;\r\n","import { createStore, Store } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport MGamepads from '@/store/modules/MGamepads';\r\nimport MPatterns from '@/store/modules/MPatterns';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst store: Store = createStore({\r\n state: () => ({\r\n mode: 0 as number,\r\n isActive: false as boolean,\r\n }),\r\n getters: {\r\n mode: function (state: IRootState): number {\r\n return state.mode as number;\r\n },\r\n isActive: function (state: IRootState): boolean {\r\n return state.isActive as boolean;\r\n },\r\n },\r\n mutations: {\r\n setMode: function (state: IRootState, mode: number): void {\r\n state.mode = mode as number;\r\n },\r\n setIsActive: function (state: IRootState, isActive: boolean): void {\r\n state.isActive = isActive as boolean;\r\n },\r\n },\r\n actions: {\r\n setMode: function (context, index: number): void {\r\n context.commit('setMode', index as number);\r\n },\r\n setIsActive: function (context, isActive: boolean): void {\r\n context.commit('setIsActive', isActive as boolean);\r\n },\r\n change: function (context, index: number): void {\r\n if (context.getters.mode === index) {\r\n context.dispatch('setIsActive', !context.getters.isActive);\r\n } else {\r\n context.dispatch('setIsActive', true);\r\n context.dispatch('setMode', index);\r\n }\r\n if (context.getters.isActive === true) {\r\n context.dispatch('reset');\r\n context.dispatch('loop', context.getters.patterns[context.getters.mode].pattern);\r\n } else {\r\n context.dispatch('reset');\r\n }\r\n },\r\n startCustom: function (context, pattern: TPatternUnit[]): void {\r\n context.dispatch('setIsActive', false);\r\n context.dispatch('setMode', 0);\r\n context.dispatch('reset');\r\n context.dispatch('loop', pattern);\r\n },\r\n },\r\n modules: {\r\n MGamepads: MGamepads,\r\n MPatterns: MPatterns,\r\n },\r\n});\r\n\r\nexport default store;\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"37\":\"e3372f87\",\"114\":\"98880cb6\",\"286\":\"cdd8d127\",\"370\":\"2a33e7b8\",\"402\":\"5e25729c\",\"743\":\"4b374804\",\"784\":\"8d118bb9\",\"994\":\"7e011783\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"css/\" + chunkId + \".\" + {\"37\":\"bb6440f7\",\"114\":\"266e2dcc\",\"286\":\"d84ba812\",\"402\":\"c3fb6094\",\"743\":\"ef4a4981\",\"994\":\"278b2bb3\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"wavelovers:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","var createStylesheet = function(chunkId, fullhref, resolve, reject) {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = function(event) {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = function(href, fullhref) {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = function(chunkId) {\n\treturn new Promise(function(resolve, reject) {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.miniCss = function(chunkId, promises) {\n\tvar cssChunks = {\"37\":1,\"114\":1,\"286\":1,\"402\":1,\"743\":1,\"994\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function() {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, function(e) {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwavelovers\"] = self[\"webpackChunkwavelovers\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(2272); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["_hoisted_1","class","_hoisted_2","render","_ctx","_cache","$props","$setup","$data","$options","_component_HeaderItem","_resolveComponent","_component_router_view","_component_FooterItem","_openBlock","_createElementBlock","_Fragment","_createVNode","_createElementVNode","_hoisted_3","translate","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_createTextVNode","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_component_router_link","to","default","_withCtx","_","defineComponent","name","__exports__","_createStaticVNode","components","HeaderItem","FooterItem","methods","addGamepad","event","store","deleteGamepad","addEventListeners","window","addEventListener","this","removeEventListeners","removeEventListener","mounted","unmounted","updateRoute","from","next","router","routes","forEach","route","query","fullPath","push","path","QueryRouter","update","appendTags","tagsArray","type","map","meta","tag","document","createElement","Object","keys","key","setAttribute","head","appendChild","updateMetatag","metas","Array","querySelectorAll","el","parentNode","removeChild","title","metaTags","linkTags","item","MetaTagUpdater","component","redirect","queries","content","rel","href","metaPatterns","metaCustom","metaManual","metaDiagnostic","metaFaq","metaAbout","metaDonate","meta404","createRouter","history","createWebHistory","process","beforeEach","createApp","App","use","mount","Vibrator","constructor","unit","id","Date","now","canVibrate","vibrationActuator","isVibrating","bind","interval","setInterval","gamepads","navigator","getGamepads","index","pattern","offsetTime","i","length","vibrate","sleep","startDelay","duration","playEffect","reset","ms","Promise","resolve","setTimeout","MGamepads","state","getters","mutations","gamepad","splice","actions","context","iEvent","commit","loop","MPatterns","patterns","setPatterns","loadPatterns","async","url","response","fetch","ok","json","console","log","error","createStore","mode","isActive","setMode","setIsActive","change","dispatch","startCustom","modules","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","every","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","f","e","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","timeout","nc","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","target","Symbol","toStringTag","value","p","createStylesheet","fullhref","reject","linkTag","onLinkComplete","errorType","realHref","err","Error","code","request","findStylesheet","existingLinkTags","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","then","installedChunks","installedChunkData","promise","loadingEnded","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/docs/js/app.c1a049b3.js b/docs/js/app.c1a049b3.js deleted file mode 100644 index 065ddff..0000000 --- a/docs/js/app.c1a049b3.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){"use strict";var e={3692:function(e,t,a){var n=a(9242),o=a(3396);const r={class:"page container"},i={class:"wavelovers"};function s(e,t,a,n,s,c){const d=(0,o.up)("HeaderItem"),v=(0,o.up)("router-view"),u=(0,o.up)("FooterItem");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.Wm)(d),(0,o._)("main",r,[(0,o._)("div",i,[(0,o.Wm)(v)])]),(0,o.Wm)(u)],64)}var c=a(1746);const d={class:"header"},v={class:"header-wrapper container"},u=(0,o._)("div",{class:"logo-wrapper"},[(0,o._)("span",{class:"logo-wrapper__logo",translate:"no"},"Wavelovers")],-1),l={class:"menu-wrapper"},m={class:"navigation"},p={class:"navigation__item"},f=(0,o.Uk)("Home"),h={class:"navigation__item"},g=(0,o.Uk)("FAQ"),b={class:"navigation__item"},w=(0,o.Uk)("About"),y={class:"navigation__item"},W=(0,o.Uk)("Donate");function V(e,t,a,n,r,i){const s=(0,o.up)("router-link");return(0,o.wg)(),(0,o.iD)("header",d,[(0,o._)("div",v,[u,(0,o._)("nav",l,[(0,o._)("ul",m,[(0,o._)("li",p,[(0,o.Wm)(s,{to:"/"},{default:(0,o.w5)((()=>[f])),_:1})]),(0,o._)("li",h,[(0,o.Wm)(s,{to:"/faq"},{default:(0,o.w5)((()=>[g])),_:1})]),(0,o._)("li",b,[(0,o.Wm)(s,{to:"/about"},{default:(0,o.w5)((()=>[w])),_:1})]),(0,o._)("li",y,[(0,o.Wm)(s,{to:"/donate"},{default:(0,o.w5)((()=>[W])),_:1})])])])])])}var k=(0,o.aZ)({name:"HeaderItem"}),M=a(89);const G=(0,M.Z)(k,[["render",V]]);var T=G;const _={class:"footer"},A=(0,o.uE)('',1),P=[A];function E(e,t,a,n,r,i){return(0,o.wg)(),(0,o.iD)("footer",_,P)}var q=(0,o.aZ)({name:"FooterItem"});const C=(0,M.Z)(q,[["render",E]]);var L=C,S=(0,o.aZ)({name:"App",components:{HeaderItem:T,FooterItem:L},methods:{addGamepad:function(e){c.Z.dispatch("addGamepad",e)},deleteGamepad:function(e){c.Z.dispatch("deleteGamepad",e)},addEventListeners:function(){window.addEventListener("gamepadconnected",this.addGamepad),window.addEventListener("gamepaddisconnected",this.deleteGamepad)},removeEventListeners:function(){window.removeEventListener("gamepadconnected",this.addGamepad),window.removeEventListener("gamepaddisconnected",this.deleteGamepad)}},mounted(){this.addEventListeners()},unmounted(){this.removeEventListeners()}});const j=(0,M.Z)(S,[["render",s]]);var D=j,U=a(2483);function I(e,t,a,n,o){return o.forEach((t=>{t.query===e.fullPath&&n.push(t.path)})),a()}const O={update:I};var x=O;function F(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 Z(e,t,a){Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map((e=>{e.parentNode&&e.parentNode.removeChild(e)}));const n=e.matched.slice().reverse().find((e=>e.meta&&e.meta.title)),o=e.matched.slice().reverse().find((e=>e.meta&&e.meta.metaTags)),r=e.matched.slice().reverse().find((e=>e.meta&&e.meta.linkTags));if(n&&(document.title=n.meta.title),o){const e=o.meta.metaTags;F(e,"meta")}if(r){const e=r.meta.linkTags;F(e,"link")}return a()}const N={update:Z};var z=N;const R={title:"Wavelovers",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{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:[{rel:"canonical",href:"https://wavelovers.ru/"}]};var H=R;const Q={title:"Wavelovers – Custom",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:title",content:"Wavelovers – Custom"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/custom"},{name:"twitter:title",content:"Wavelovers – Custom"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/custom"}]};var B=Q;const K={title:"Wavelovers – Manual",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:title",content:"Wavelovers – Manual"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/manual"},{name:"twitter:title",content:"Wavelovers – Manual"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/manual"}]};var Y=K;const J={title:"Wavelovers – Diagnostic",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:title",content:"Wavelovers – Diagnostic"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/diagnostic"},{name:"twitter:title",content:"Wavelovers – Diagnostic"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/diagnostic"}]};var X=J;const $={title:"Wavelovers – FAQ",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, FAQ, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, часто задаваемые вопросы"},{name:"description",content:"Wavelovers. Frequently asked questions page."},{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:[{rel:"canonical",href:"https://wavelovers.ru/faq"}]};var ee=$;const te={title:"Wavelovers – About",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, advertise, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, реклама"},{name:"description",content:"Wavelovers. Page with information about the project and data on donations."},{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:[{rel:"canonical",href:"https://wavelovers.ru/about"}]};var ae=te;const ne={title:"Wavelovers – Donate",metaTags:[{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, Donate, Support, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, задонатить, пожертвовать, помочь, поблагодарить"},{name:"description",content:"Wavelovers. Donate to the author."},{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:[{rel:"canonical",href:"https://wavelovers.ru/donate"}]};var oe=ne;const re={title:"Wavelovers – Page not found",metaTags:[{name:"og:title",content:"Wavelovers – Page not found"},{name:"og:url",content:"https://wavelovers.ru/404"}],linkTags:[{rel:"canonical",href:"https://wavelovers.ru/404"}]};var ie=re;const se=[{path:"/",name:"patterns-view",component:()=>a.e(743).then(a.bind(a,2743)),meta:H},{path:"/custom",name:"custom-view",component:()=>a.e(402).then(a.bind(a,4402)),meta:B},{path:"/manual",name:"manual-view",component:()=>a.e(286).then(a.bind(a,5286)),meta:Y},{path:"/diagnostic",name:"diagnostic-view",component:()=>a.e(114).then(a.bind(a,2114)),meta:X},{path:"/faq",name:"faq-view",component:()=>a.e(370).then(a.bind(a,6370)),meta:ee},{path:"/about",name:"about-view",component:()=>a.e(994).then(a.bind(a,3994)),meta:ae},{path:"/donate",name:"donate-view",component:()=>a.e(37).then(a.bind(a,3037)),meta:oe},{path:"/404",name:"404",component:()=>a.e(784).then(a.bind(a,7784)),meta:ie},{path:"/:catchAll(.*)*",redirect:"/404"}];var ce=se;const de=[{query:"/?custom",path:"/custom"},{query:"/?manual",path:"/manual"},{query:"/?diagnostic",path:"/diagnostic"},{query:"/?faq",path:"/faq"},{query:"/?about",path:"/about"},{query:"/?donate",path:"/donate"}];var ve=de;const ue=(0,U.p7)({history:(0,U.PO)("/"),routes:ce});ue.beforeEach(((e,t,a)=>{x.update(e,t,a,ue,ve),z.update(e,t,a)}));var le=ue;(0,n.ri)(D).use(c.Z).use(le).mount("#app")},1746:function(e,t,a){a.d(t,{Z:function(){return l}});var n=a(65),o=a(2482);class r{constructor(e){(0,o.Z)(this,"unit",void 0),(0,o.Z)(this,"id",void 0),(0,o.Z)(this,"canVibrate",void 0),(0,o.Z)(this,"isVibrating",void 0),(0,o.Z)(this,"interval",void 0),this.unit=e,this.id=Date.now(),this.canVibrate=!!this.unit.vibrationActuator,this.isVibrating=!1,this.update=this.update.bind(this),this.interval=setInterval(this.update,1)}update(){const e=navigator.getGamepads();this.unit=e[this.unit.index]}async loop(e){this.isVibrating=!0;const t=10;while(!0===this.isVibrating)for(let a=0;asetTimeout(t,e)))}}var i=r;const s={state:()=>({gamepads:[]}),getters:{gamepads:function(e){return e.gamepads}},mutations:{addGamepad:function(e,t){e.gamepads.push(t)},deleteGamepad:function(e,t){e.gamepads.splice(t,1)}},actions:{addGamepad:function(e,t){const a=t;e.getters.gamepads.length>=1||e.commit("addGamepad",new i(a.gamepad))},deleteGamepad:function(e,t){e.getters.gamepads.forEach(((a,n)=>{a.unit.id===t.gamepad.id&&e.commit("deleteGamepad",n)}))},loop:function(e,t){e.getters.gamepads.forEach((e=>{e.loop(t)}))},vibrate:function(e,t){e.getters.gamepads.forEach((e=>{e.vibrate(t)}))},reset:function(e){e.getters.gamepads.forEach((e=>{e.reset()}))}}};var c=s;const d={state:()=>({patterns:[]}),getters:{patterns:function(e){return e.patterns}},mutations:{setPatterns:function(e,t){e.patterns=t}},actions:{loadPatterns:async function(e){const t="https://wavelovers.ru/assets/patterns.json";try{const a=await fetch(t);if(a.ok){const t=await a.json();e.commit("setPatterns",t)}else console.log("Connect to the Internet for download more patterns...")}catch(a){console.log(a)}}}};var v=d;const u=(0,n.MT)({state:()=>({mode:0,isActive:!1}),getters:{mode:function(e){return e.mode},isActive:function(e){return e.isActive}},mutations:{setMode:function(e,t){e.mode=t},setIsActive:function(e,t){e.isActive=t}},actions:{setMode:function(e,t){e.commit("setMode",t)},setIsActive:function(e,t){e.commit("setIsActive",t)},change:function(e,t){e.getters.mode===t?e.dispatch("setIsActive",!e.getters.isActive):(e.dispatch("setIsActive",!0),e.dispatch("setMode",t)),!0===e.getters.isActive?(e.dispatch("reset"),e.dispatch("loop",e.getters.patterns[e.getters.mode].pattern)):e.dispatch("reset")},startCustom:function(e,t){e.dispatch("setIsActive",!1),e.dispatch("setMode",0),e.dispatch("reset"),e.dispatch("loop",t)}},modules:{MGamepads:c,MPatterns:v}});var l=u}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.m=e,function(){var e=[];a.O=function(t,n,o,r){if(!n){var i=1/0;for(v=0;v=r)&&Object.keys(a.O).every((function(e){return a.O[e](n[c])}))?n.splice(c--,1):(s=!1,r0&&e[v-1][2]>r;v--)e[v]=e[v-1];e[v]=[n,o,r]}}(),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+"."+{37:"e3372f87",114:"98880cb6",286:"cdd8d127",370:"2a33e7b8",402:"5e25729c",743:"4b374804",784:"8d118bb9",994:"7e011783"}[e]+".js"}}(),function(){a.miniCssF=function(e){return"css/"+e+"."+{37:"bb6440f7",114:"266e2dcc",286:"d84ba812",402:"c3fb6094",743:"ef4a4981",994:"278b2bb3"}[e]+".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,o,r,i){if(e[n])e[n].push(o);else{var s,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),v=0;v [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"li\", _hoisted_8, [\n _createVNode(_component_router_link, { to: \"/faq\" }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"li\", _hoisted_10, [\n _createVNode(_component_router_link, { to: \"/about\" }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"li\", _hoisted_12, [\n _createVNode(_component_router_link, { to: \"/donate\" }, {\n default: _withCtx(() => [\n _hoisted_13\n ]),\n _: 1\n })\n ])\n ])\n ])\n ])\n ]))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'HeaderItem',\r\n });\r\n","import { render } from \"./HeaderItem.vue?vue&type=template&id=b3272126&ts=true\"\nimport script from \"./HeaderItem.vue?vue&type=script&lang=ts\"\nexport * from \"./HeaderItem.vue?vue&type=script&lang=ts\"\n\nimport \"./HeaderItem.vue?vue&type=style&index=0&id=b3272126&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { createElementVNode as _createElementVNode, createStaticVNode as _createStaticVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"footer\" }\nconst _hoisted_2 = /*#__PURE__*/_createStaticVNode(\"
© 2022 Wavelovers. Content licensed under GNU General Public License v3.0
This site is open source. Improve this page.
Created byEugene Serb
\", 1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"footer\", _hoisted_1, _hoisted_3))\n}","\r\n import { defineComponent } from 'vue';\r\n\r\n export default defineComponent({\r\n name: 'FooterItem',\r\n });\r\n","import { render } from \"./FooterItem.vue?vue&type=template&id=c1770678&ts=true\"\nimport script from \"./FooterItem.vue?vue&type=script&lang=ts\"\nexport * from \"./FooterItem.vue?vue&type=script&lang=ts\"\n\nimport \"./FooterItem.vue?vue&type=style&index=0&id=c1770678&lang=scss\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\r\n import { defineComponent } from 'vue';\r\n import store from '@/store/index';\r\n import HeaderItem from '@/components/HeaderItem.vue';\r\n import FooterItem from '@/components/FooterItem.vue';\r\n\r\n export default defineComponent({\r\n name: 'App',\r\n components: {\r\n HeaderItem: HeaderItem,\r\n FooterItem: FooterItem,\r\n },\r\n methods: {\r\n addGamepad: function (event: GamepadEvent): void {\r\n store.dispatch('addGamepad', event);\r\n },\r\n deleteGamepad: function (event: GamepadEvent): void {\r\n store.dispatch('deleteGamepad', event);\r\n },\r\n addEventListeners: function (): void {\r\n window.addEventListener('gamepadconnected', this.addGamepad);\r\n window.addEventListener('gamepaddisconnected', this.deleteGamepad);\r\n },\r\n removeEventListeners: function (): void {\r\n window.removeEventListener('gamepadconnected', this.addGamepad);\r\n window.removeEventListener('gamepaddisconnected', this.deleteGamepad);\r\n },\r\n },\r\n mounted() {\r\n this.addEventListeners();\r\n },\r\n unmounted() {\r\n this.removeEventListeners();\r\n },\r\n });\r\n","import { render } from \"./App.vue?vue&type=template&id=385bacb8&ts=true\"\nimport script from \"./App.vue?vue&type=script&lang=ts\"\nexport * from \"./App.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"E:\\\\Sources\\\\Repos\\\\wavelovers\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import {\r\n Router, NavigationGuardNext, RouteLocationNormalized\r\n} from \"vue-router\";\r\nimport IQueryRoute from '@/router/models/IQueryRoute';\r\n\r\nfunction updateRoute(\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext,\r\n router: Router,\r\n routes: Array\r\n): void {\r\n routes.forEach((route) => {\r\n if (route.query === to.fullPath) {\r\n router.push(route.path);\r\n }\r\n });\r\n return next();\r\n}\r\n\r\nconst QueryRouter = {\r\n update: updateRoute,\r\n};\r\n\r\nexport default QueryRouter;\r\n","import {\r\n NavigationGuardNext, RouteLocationNormalized, RouteRecordNormalized\r\n} from \"vue-router\";\r\n\r\nfunction appendTags(tagsArray: object[], type: string) {\r\n tagsArray.map(\r\n (meta: object) => {\r\n const tag = document.createElement(type);\r\n\r\n (Object.keys(meta) as Array)\r\n .forEach((key) => {\r\n tag.setAttribute(key, meta[key] as string);\r\n });\r\n tag.setAttribute('data-vue-router-controlled', '');\r\n\r\n return tag;\r\n }\r\n ).forEach(tag => document.head.appendChild(tag));\r\n}\r\n\r\nfunction updateMetatag(\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext\r\n) {\r\n Array.from(document.querySelectorAll('[data-vue-router-controlled]'))\r\n .map(el => {\r\n if (el.parentNode) {\r\n el.parentNode.removeChild(el);\r\n }\r\n });\r\n\r\n const hasTitle: RouteRecordNormalized =\r\n to.matched.slice().reverse()\r\n .find(r => r.meta && r.meta.title) as RouteRecordNormalized;\r\n const hasMetas: RouteRecordNormalized =\r\n to.matched.slice().reverse()\r\n .find(r => r.meta && r.meta.metaTags) as RouteRecordNormalized;\r\n const hasLinks: RouteRecordNormalized =\r\n to.matched.slice().reverse()\r\n .find(r => r.meta && r.meta.linkTags) as RouteRecordNormalized;\r\n\r\n if (hasTitle) {\r\n document.title = hasTitle.meta.title as string;\r\n }\r\n if (hasMetas) {\r\n const metaTags: object[] = hasMetas.meta.metaTags as object[];\r\n appendTags(metaTags, 'meta');\r\n }\r\n if (hasLinks) {\r\n const linkTags: object[] = hasLinks.meta.linkTags as object[];\r\n appendTags(linkTags, 'link');\r\n }\r\n\r\n return next();\r\n}\r\n\r\nconst MetaTagUpdater = {\r\n update: updateMetatag,\r\n};\r\n\r\nexport default MetaTagUpdater;\r\n","const meta = {\r\n title: 'Wavelovers',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","const meta = {\r\n title: 'Wavelovers – Custom',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Custom',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/custom',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Custom',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/custom',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","const meta = {\r\n title: 'Wavelovers – Manual',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Manual',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/manual',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Manual',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/manual',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","const meta = {\r\n title: 'Wavelovers – Diagnostic',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Diagnostic',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/diagnostic',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Diagnostic',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/diagnostic',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","const meta = {\r\n title: 'Wavelovers – FAQ',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, FAQ, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, часто задаваемые вопросы',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Frequently asked questions page.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – FAQ',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Frequently asked questions page.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/faq',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – FAQ',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Frequently asked questions page.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/faq',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","const meta = {\r\n title: 'Wavelovers – About',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, advertise, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, реклама',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Page with information about the project and data on donations.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – About',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Page with information about the project and data on donations.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/about',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – About',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Page with information about the project and data on donations.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/about',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","const meta = {\r\n title: 'Wavelovers – Donate',\r\n metaTags: [\r\n {\r\n name: 'keywords',\r\n content: 'Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Gamepad Massager, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, Donate, Support, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, задонатить, пожертвовать, помочь, поблагодарить',\r\n },\r\n {\r\n name: 'description',\r\n content: 'Wavelovers. Donate to the author.',\r\n },\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Donate',\r\n },\r\n {\r\n name: 'og:description',\r\n content: 'Wavelovers. Donate to the author.',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/donate',\r\n },\r\n {\r\n name: 'twitter:title',\r\n content: 'Wavelovers – Donate',\r\n },\r\n {\r\n name: 'twitter:description',\r\n content: 'Wavelovers. Donate to the author.',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/donate',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","const meta = {\r\n title: 'Wavelovers – Page not found',\r\n metaTags: [\r\n {\r\n name: 'og:title',\r\n content: 'Wavelovers – Page not found',\r\n },\r\n {\r\n name: 'og:url',\r\n content: 'https://wavelovers.ru/404',\r\n },\r\n ],\r\n linkTags: [\r\n {\r\n rel: 'canonical',\r\n href: 'https://wavelovers.ru/404',\r\n },\r\n ],\r\n};\r\n\r\nexport default meta;\r\n","import { RouteRecordRaw } from 'vue-router';\r\nimport metaPatterns from '@/router/assets/metas/Patterns';\r\nimport metaCustom from '@/router/assets/metas/Custom';\r\nimport metaManual from '@/router/assets/metas/Manual';\r\nimport metaDiagnostic from '@/router/assets/metas/Diagnostic';\r\nimport metaFaq from '@/router/assets/metas/Faq';\r\nimport metaAbout from '@/router/assets/metas/About';\r\nimport metaDonate from '@/router/assets/metas/Donate';\r\nimport meta404 from '@/router/assets/metas/404';\r\n\r\nconst routes: Array = [\r\n {\r\n path: '/',\r\n name: 'patterns-view',\r\n component: () => import('@/views/PatternsView.vue'),\r\n meta: metaPatterns,\r\n },\r\n {\r\n path: '/custom',\r\n name: 'custom-view',\r\n component: () => import('@/views/CustomView.vue'),\r\n meta: metaCustom,\r\n },\r\n {\r\n path: '/manual',\r\n name: 'manual-view',\r\n component: () => import('@/views/ManualView.vue'),\r\n meta: metaManual,\r\n },\r\n {\r\n path: '/diagnostic',\r\n name: 'diagnostic-view',\r\n component: () => import('@/views/DiagnosticView.vue'),\r\n meta: metaDiagnostic,\r\n },\r\n {\r\n path: '/faq',\r\n name: 'faq-view',\r\n component: () => import('@/views/FaqView.vue'),\r\n meta: metaFaq,\r\n },\r\n {\r\n path: '/about',\r\n name: 'about-view',\r\n component: () => import('@/views/AboutView.vue'),\r\n meta: metaAbout,\r\n },\r\n {\r\n path: '/donate',\r\n name: 'donate-view',\r\n component: () => import('@/views/DonateView.vue'),\r\n meta: metaDonate,\r\n },\r\n {\r\n path: '/404',\r\n name: '404',\r\n component: () => import('@/views/NotFoundView.vue'),\r\n meta: meta404,\r\n },\r\n {\r\n path: '/:catchAll(.*)*',\r\n redirect: '/404',\r\n },\r\n];\r\n\r\nexport default routes;\r\n","import IQueryRoute from '@/router/models/IQueryRoute';\r\n\r\nconst queries: Array = [\r\n {\r\n query: '/?custom',\r\n path: '/custom',\r\n },\r\n {\r\n query: '/?manual',\r\n path: '/manual',\r\n },\r\n {\r\n query: '/?diagnostic',\r\n path: '/diagnostic',\r\n },\r\n {\r\n query: '/?faq',\r\n path: '/faq',\r\n },\r\n {\r\n query: '/?about',\r\n path: '/about',\r\n },\r\n {\r\n query: '/?donate',\r\n path: '/donate',\r\n }\r\n];\r\n\r\nexport default queries;\r\n","import {\r\n createRouter, createWebHistory,\r\n NavigationGuardNext, RouteLocationNormalized\r\n} from 'vue-router';\r\nimport QueryRouter from '@/router/modules/QueryRouter';\r\nimport MetaTagUpdater from '@/router/modules/MetaTagUpdater';\r\nimport routes from '@/router/assets/routes';\r\nimport queries from '@/router/assets/queries';\r\n\r\nconst router = createRouter({\r\n history: createWebHistory(process.env.BASE_URL),\r\n routes,\r\n});\r\n\r\nrouter.beforeEach((\r\n to: RouteLocationNormalized,\r\n from: RouteLocationNormalized,\r\n next: NavigationGuardNext\r\n) => {\r\n QueryRouter.update(to, from, next, router, queries);\r\n MetaTagUpdater.update(to, from, next)\r\n});\r\n\r\nexport default router;\r\n","import { createApp } from 'vue';\r\nimport App from '@/App.vue';\r\nimport router from '@/router';\r\nimport store from '@/store';\r\n\r\ncreateApp(App)\r\n .use(store)\r\n .use(router)\r\n .mount('#app');\r\n","import TPatternUnit from '@/models/TPatternUnit';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IVibrator from '@/models/IVibrator';\r\n\r\nclass Vibrator implements IVibrator {\r\n\r\n unit: IGamepad;\r\n readonly id: number;\r\n readonly canVibrate: boolean;\r\n isVibrating: boolean;\r\n interval: number;\r\n\r\n constructor(unit: IGamepad) {\r\n this.unit = unit;\r\n this.id = Date.now();\r\n this.canVibrate = (this.unit.vibrationActuator) ? true : false;\r\n this.isVibrating = false;\r\n this.update = this.update.bind(this);\r\n this.interval = setInterval(this.update, 1);\r\n }\r\n\r\n update(): void {\r\n const gamepads = navigator.getGamepads();\r\n this.unit = gamepads[this.unit.index] as unknown as IGamepad;\r\n }\r\n\r\n async loop(pattern: TPatternUnit[]): Promise {\r\n this.isVibrating = true;\r\n const offsetTime = 10;\r\n while (this.isVibrating === true) {\r\n for (let i = 0; i < pattern.length; i++) {\r\n if (this.isVibrating === true) {\r\n this.vibrate(pattern[i]);\r\n await this.sleep(pattern[i].startDelay + pattern[i].duration - offsetTime);\r\n } else {\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n vibrate(pattern: TPatternUnit): void {\r\n this.unit.vibrationActuator.playEffect('dual-rumble', pattern);\r\n }\r\n\r\n reset(): void {\r\n this.isVibrating = false;\r\n this.unit.vibrationActuator.reset();\r\n }\r\n\r\n sleep(ms: number): Promise {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n }\r\n}\r\n\r\nexport default Vibrator;\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IGamepadsState from '@/store/models/IGamepadsState';\r\nimport Vibrator from '@/models/Vibrator';\r\nimport IGamepad from '@/models/IGamepad';\r\nimport IGamepadEvent from '@/models/IGamepadEvent';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst MGamepads: Module = {\r\n state: () => ({\r\n gamepads: [] as Vibrator[],\r\n }),\r\n getters: {\r\n gamepads: function (state: IGamepadsState): Vibrator[] {\r\n return state.gamepads as Vibrator[];\r\n },\r\n },\r\n mutations: {\r\n addGamepad: function (state: IGamepadsState, gamepad: Vibrator): void {\r\n state.gamepads.push(gamepad as Vibrator);\r\n },\r\n deleteGamepad: function (state: IGamepadsState, index: number): void {\r\n state.gamepads.splice(index, 1);\r\n },\r\n },\r\n actions: {\r\n addGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n const iEvent: IGamepadEvent = event as unknown as IGamepadEvent;\r\n if (context.getters.gamepads.length >= 1) {\r\n return;\r\n } else {\r\n context.commit('addGamepad', new Vibrator(iEvent.gamepad as IGamepad));\r\n }\r\n },\r\n deleteGamepad: function (\r\n context: ActionContext,\r\n event: GamepadEvent\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator, index: number) => {\r\n if (gamepad.unit.id === event.gamepad.id) {\r\n context.commit('deleteGamepad', index as number);\r\n }\r\n });\r\n },\r\n loop: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit[]\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.loop(pattern);\r\n });\r\n },\r\n vibrate: function (\r\n context: ActionContext,\r\n pattern: TPatternUnit\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.vibrate(pattern);\r\n });\r\n },\r\n reset: function (\r\n context: ActionContext\r\n ): void {\r\n context.getters.gamepads.forEach((gamepad: Vibrator) => {\r\n gamepad.reset();\r\n });\r\n },\r\n },\r\n};\r\n\r\nexport default MGamepads;\r\n","import { ActionContext, Module } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport IPatternState from '@/store/models/IPatternState';\r\nimport TPattern from '@/models/TPattern';\r\n\r\nconst MPatterns: Module = {\r\n state: () => ({\r\n patterns: [] as TPattern[],\r\n }),\r\n getters: {\r\n patterns: function (state: IPatternState): TPattern[] {\r\n return state.patterns as TPattern[];\r\n },\r\n },\r\n mutations: {\r\n setPatterns: function (state: IPatternState, patterns: TPattern[]): void {\r\n state.patterns = patterns as TPattern[];\r\n },\r\n },\r\n actions: {\r\n loadPatterns: async function (\r\n context: ActionContext\r\n ): Promise {\r\n const url = 'https://wavelovers.ru/assets/patterns.json';\r\n try {\r\n const response: Response = await fetch(url);\r\n if (response.ok) {\r\n const json: TPattern[] = await response.json();\r\n context.commit('setPatterns', json as TPattern[]);\r\n } else {\r\n // eslint-disable-next-line\r\n console.log('Connect to the Internet for download more patterns...');\r\n }\r\n } catch (error) {\r\n // eslint-disable-next-line\r\n console.log(error);\r\n }\r\n },\r\n },\r\n};\r\n\r\nexport default MPatterns;\r\n","import { createStore, Store } from 'vuex';\r\nimport IRootState from '@/store/models/IRootState';\r\nimport MGamepads from '@/store/modules/MGamepads';\r\nimport MPatterns from '@/store/modules/MPatterns';\r\nimport TPatternUnit from '@/models/TPatternUnit';\r\n\r\nconst store: Store = createStore({\r\n state: () => ({\r\n mode: 0 as number,\r\n isActive: false as boolean,\r\n }),\r\n getters: {\r\n mode: function (state: IRootState): number {\r\n return state.mode as number;\r\n },\r\n isActive: function (state: IRootState): boolean {\r\n return state.isActive as boolean;\r\n },\r\n },\r\n mutations: {\r\n setMode: function (state: IRootState, mode: number): void {\r\n state.mode = mode as number;\r\n },\r\n setIsActive: function (state: IRootState, isActive: boolean): void {\r\n state.isActive = isActive as boolean;\r\n },\r\n },\r\n actions: {\r\n setMode: function (context, index: number): void {\r\n context.commit('setMode', index as number);\r\n },\r\n setIsActive: function (context, isActive: boolean): void {\r\n context.commit('setIsActive', isActive as boolean);\r\n },\r\n change: function (context, index: number): void {\r\n if (context.getters.mode === index) {\r\n context.dispatch('setIsActive', !context.getters.isActive);\r\n } else {\r\n context.dispatch('setIsActive', true);\r\n context.dispatch('setMode', index);\r\n }\r\n if (context.getters.isActive === true) {\r\n context.dispatch('reset');\r\n context.dispatch('loop', context.getters.patterns[context.getters.mode].pattern);\r\n } else {\r\n context.dispatch('reset');\r\n }\r\n },\r\n startCustom: function (context, pattern: TPatternUnit[]): void {\r\n context.dispatch('setIsActive', false);\r\n context.dispatch('setMode', 0);\r\n context.dispatch('reset');\r\n context.dispatch('loop', pattern);\r\n },\r\n },\r\n modules: {\r\n MGamepads: MGamepads,\r\n MPatterns: MPatterns,\r\n },\r\n});\r\n\r\nexport default store;\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"js/\" + chunkId + \".\" + {\"37\":\"e3372f87\",\"114\":\"98880cb6\",\"286\":\"cdd8d127\",\"370\":\"2a33e7b8\",\"402\":\"5e25729c\",\"743\":\"4b374804\",\"784\":\"8d118bb9\",\"994\":\"7e011783\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"css/\" + chunkId + \".\" + {\"37\":\"bb6440f7\",\"114\":\"266e2dcc\",\"286\":\"d84ba812\",\"402\":\"c3fb6094\",\"743\":\"ef4a4981\",\"994\":\"278b2bb3\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"wavelovers:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","var createStylesheet = function(chunkId, fullhref, resolve, reject) {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = function(event) {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tlinkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tdocument.head.appendChild(linkTag);\n\treturn linkTag;\n};\nvar findStylesheet = function(href, fullhref) {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = function(chunkId) {\n\treturn new Promise(function(resolve, reject) {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.miniCss = function(chunkId, promises) {\n\tvar cssChunks = {\"37\":1,\"114\":1,\"286\":1,\"402\":1,\"743\":1,\"994\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function() {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, function(e) {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkwavelovers\"] = self[\"webpackChunkwavelovers\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(3692); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["_hoisted_1","class","_hoisted_2","render","_ctx","_cache","$props","$setup","$data","$options","_component_HeaderItem","_resolveComponent","_component_router_view","_component_FooterItem","_openBlock","_createElementBlock","_Fragment","_createVNode","_createElementVNode","_hoisted_3","translate","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_createTextVNode","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_component_router_link","to","default","_withCtx","_","defineComponent","name","__exports__","_createStaticVNode","components","HeaderItem","FooterItem","methods","addGamepad","event","store","deleteGamepad","addEventListeners","window","addEventListener","this","removeEventListeners","removeEventListener","mounted","unmounted","updateRoute","from","next","router","routes","forEach","route","query","fullPath","push","path","QueryRouter","update","appendTags","tagsArray","type","map","meta","tag","document","createElement","Object","keys","key","setAttribute","head","appendChild","updateMetatag","Array","querySelectorAll","el","parentNode","removeChild","hasTitle","matched","slice","reverse","find","r","title","hasMetas","metaTags","hasLinks","linkTags","MetaTagUpdater","content","rel","href","component","metaPatterns","metaCustom","metaManual","metaDiagnostic","metaFaq","metaAbout","metaDonate","meta404","redirect","queries","createRouter","history","createWebHistory","process","beforeEach","createApp","App","use","mount","Vibrator","constructor","unit","id","Date","now","canVibrate","vibrationActuator","isVibrating","bind","interval","setInterval","gamepads","navigator","getGamepads","index","pattern","offsetTime","i","length","vibrate","sleep","startDelay","duration","playEffect","reset","ms","Promise","resolve","setTimeout","MGamepads","state","getters","mutations","gamepad","splice","actions","context","iEvent","commit","loop","MPatterns","patterns","setPatterns","loadPatterns","async","url","response","fetch","ok","json","console","log","error","createStore","mode","isActive","setMode","setIsActive","change","dispatch","startCustom","modules","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","every","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","f","e","chunkId","all","reduce","promises","u","miniCssF","g","globalThis","Function","obj","prop","prototype","hasOwnProperty","call","inProgress","dataWebpackPrefix","l","done","script","needAttach","scripts","getElementsByTagName","s","getAttribute","charset","timeout","nc","src","onScriptComplete","prev","onerror","onload","clearTimeout","doneFns","target","Symbol","toStringTag","value","p","createStylesheet","fullhref","reject","linkTag","onLinkComplete","errorType","realHref","err","Error","code","request","findStylesheet","existingLinkTags","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","then","installedChunks","installedChunkData","promise","loadingEnded","realSrc","message","webpackJsonpCallback","parentChunkLoadingFunction","data","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2c9bc2f..4f2019c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wavelovers", - "version": "1.0.19", + "version": "1.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wavelovers", - "version": "1.0.19", + "version": "1.1.0", "license": "GNU GPL v3", "dependencies": { "core-js": "^3.8.3", diff --git a/package.json b/package.json index 63c15b4..3297302 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "wavelovers", "description": "Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.", "keywords": [ "wavelovers", "gamepad-vibrator", "gamepad-test-tool", "gamepad-vibration-test-tool" ], - "version": "1.0.19", + "version": "1.1.0", "license": "GNU GPL v3", "homepage": "https://wavelovers.ru/", "author": { @@ -46,4 +46,3 @@ "typescript": "~4.5.5" } } - diff --git a/src/router/assets/metas.ts b/src/router/assets/metas.ts new file mode 100644 index 0000000..7a65d91 --- /dev/null +++ b/src/router/assets/metas.ts @@ -0,0 +1,46 @@ +import IRouteMeta from '@/router/models/IRouteMeta'; +import metaPatterns from '@/router/assets/metas/Patterns'; +import metaCustom from '@/router/assets/metas/Custom'; +import metaManual from '@/router/assets/metas/Manual'; +import metaDiagnostic from '@/router/assets/metas/Diagnostic'; +import metaFaq from '@/router/assets/metas/Faq'; +import metaAbout from '@/router/assets/metas/About'; +import metaDonate from '@/router/assets/metas/Donate'; +import meta404 from '@/router/assets/metas/404'; + +const metas: Array = [ + { + route: '/', + meta: metaPatterns, + }, + { + route: '/custom', + meta: metaCustom, + }, + { + route: '/manual', + meta: metaManual, + }, + { + route: '/diagnostic', + meta: metaDiagnostic, + }, + { + route: '/faq', + meta: metaFaq, + }, + { + route: '/about', + meta: metaAbout, + }, + { + route: '/donate', + meta: metaDonate, + }, + { + route: '/404', + meta: meta404, + }, +]; + +export default metas; diff --git a/src/router/assets/metas/404.ts b/src/router/assets/metas/404.ts index 878a88f..d964f84 100644 --- a/src/router/assets/metas/404.ts +++ b/src/router/assets/metas/404.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers – Page not found', metaTags: [ { diff --git a/src/router/assets/metas/About.ts b/src/router/assets/metas/About.ts index b3136ed..18251f0 100644 --- a/src/router/assets/metas/About.ts +++ b/src/router/assets/metas/About.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers – About', metaTags: [ { diff --git a/src/router/assets/metas/Custom.ts b/src/router/assets/metas/Custom.ts index c95f258..2ba303d 100644 --- a/src/router/assets/metas/Custom.ts +++ b/src/router/assets/metas/Custom.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers – Custom', metaTags: [ { diff --git a/src/router/assets/metas/Diagnostic.ts b/src/router/assets/metas/Diagnostic.ts index 8eefd36..974ca8c 100644 --- a/src/router/assets/metas/Diagnostic.ts +++ b/src/router/assets/metas/Diagnostic.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers – Diagnostic', metaTags: [ { diff --git a/src/router/assets/metas/Donate.ts b/src/router/assets/metas/Donate.ts index efdafe3..95a6b4c 100644 --- a/src/router/assets/metas/Donate.ts +++ b/src/router/assets/metas/Donate.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers – Donate', metaTags: [ { diff --git a/src/router/assets/metas/Faq.ts b/src/router/assets/metas/Faq.ts index d48c89b..072ab76 100644 --- a/src/router/assets/metas/Faq.ts +++ b/src/router/assets/metas/Faq.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers – FAQ', metaTags: [ { diff --git a/src/router/assets/metas/Manual.ts b/src/router/assets/metas/Manual.ts index 605e59d..678fbd3 100644 --- a/src/router/assets/metas/Manual.ts +++ b/src/router/assets/metas/Manual.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers – Manual', metaTags: [ { diff --git a/src/router/assets/metas/Patterns.ts b/src/router/assets/metas/Patterns.ts index 5a58f30..08f859f 100644 --- a/src/router/assets/metas/Patterns.ts +++ b/src/router/assets/metas/Patterns.ts @@ -1,4 +1,6 @@ -const meta = { +import IMeta from '@/router/models/IMeta'; + +const meta: IMeta = { title: 'Wavelovers', metaTags: [ { diff --git a/src/router/assets/routes.ts b/src/router/assets/routes.ts index 6568bff..2d676b1 100644 --- a/src/router/assets/routes.ts +++ b/src/router/assets/routes.ts @@ -1,61 +1,45 @@ import { RouteRecordRaw } from 'vue-router'; -import metaPatterns from '@/router/assets/metas/Patterns'; -import metaCustom from '@/router/assets/metas/Custom'; -import metaManual from '@/router/assets/metas/Manual'; -import metaDiagnostic from '@/router/assets/metas/Diagnostic'; -import metaFaq from '@/router/assets/metas/Faq'; -import metaAbout from '@/router/assets/metas/About'; -import metaDonate from '@/router/assets/metas/Donate'; -import meta404 from '@/router/assets/metas/404'; const routes: Array = [ { path: '/', name: 'patterns-view', component: () => import('@/views/PatternsView.vue'), - meta: metaPatterns, }, { path: '/custom', name: 'custom-view', component: () => import('@/views/CustomView.vue'), - meta: metaCustom, }, { path: '/manual', name: 'manual-view', component: () => import('@/views/ManualView.vue'), - meta: metaManual, }, { path: '/diagnostic', name: 'diagnostic-view', component: () => import('@/views/DiagnosticView.vue'), - meta: metaDiagnostic, }, { path: '/faq', name: 'faq-view', component: () => import('@/views/FaqView.vue'), - meta: metaFaq, }, { path: '/about', name: 'about-view', component: () => import('@/views/AboutView.vue'), - meta: metaAbout, }, { path: '/donate', name: 'donate-view', component: () => import('@/views/DonateView.vue'), - meta: metaDonate, }, { path: '/404', name: '404', component: () => import('@/views/NotFoundView.vue'), - meta: meta404, }, { path: '/:catchAll(.*)*', diff --git a/src/router/index.ts b/src/router/index.ts index 278e7cb..86690d7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -6,6 +6,7 @@ import QueryRouter from '@/router/modules/QueryRouter'; import MetaTagUpdater from '@/router/modules/MetaTagUpdater'; import routes from '@/router/assets/routes'; import queries from '@/router/assets/queries'; +import metas from '@/router/assets/metas'; const router = createRouter({ history: createWebHistory(process.env.BASE_URL), @@ -18,7 +19,7 @@ router.beforeEach(( next: NavigationGuardNext ) => { QueryRouter.update(to, from, next, router, queries); - MetaTagUpdater.update(to, from, next) + MetaTagUpdater.update(to, from, next, metas) }); export default router; diff --git a/src/router/models/IMeta.ts b/src/router/models/IMeta.ts new file mode 100644 index 0000000..de873d8 --- /dev/null +++ b/src/router/models/IMeta.ts @@ -0,0 +1,9 @@ +import ITag from '@/router/models/ITag'; + +interface IMeta { + title: string; + metaTags: Array; + linkTags: Array; +} + +export default IMeta; diff --git a/src/router/models/IRouteMeta.ts b/src/router/models/IRouteMeta.ts new file mode 100644 index 0000000..38c10d8 --- /dev/null +++ b/src/router/models/IRouteMeta.ts @@ -0,0 +1,8 @@ +import IMeta from '@/router/models/IMeta'; + +interface IRouteMeta { + route: string; + meta: IMeta; +} + +export default IRouteMeta; diff --git a/src/router/models/ITag.ts b/src/router/models/ITag.ts new file mode 100644 index 0000000..c2ea480 --- /dev/null +++ b/src/router/models/ITag.ts @@ -0,0 +1,5 @@ +interface ITag { + [key: string]: string; +} + +export default ITag; diff --git a/src/router/modules/MetaTagUpdater.ts b/src/router/modules/MetaTagUpdater.ts index 1b36afb..412a5d8 100644 --- a/src/router/modules/MetaTagUpdater.ts +++ b/src/router/modules/MetaTagUpdater.ts @@ -1,6 +1,6 @@ -import { - NavigationGuardNext, RouteLocationNormalized, RouteRecordNormalized -} from "vue-router"; +import { NavigationGuardNext, RouteLocationNormalized } from "vue-router"; +import IRouteMeta from "@/router/models/IRouteMeta"; +import ITag from '@/router/models/ITag'; function appendTags(tagsArray: object[], type: string) { tagsArray.map( @@ -21,7 +21,8 @@ function appendTags(tagsArray: object[], type: string) { function updateMetatag( to: RouteLocationNormalized, from: RouteLocationNormalized, - next: NavigationGuardNext + next: NavigationGuardNext, + metas: Array ) { Array.from(document.querySelectorAll('[data-vue-router-controlled]')) .map(el => { @@ -30,27 +31,23 @@ function updateMetatag( } }); - const hasTitle: RouteRecordNormalized = - to.matched.slice().reverse() - .find(r => r.meta && r.meta.title) as RouteRecordNormalized; - const hasMetas: RouteRecordNormalized = - to.matched.slice().reverse() - .find(r => r.meta && r.meta.metaTags) as RouteRecordNormalized; - const hasLinks: RouteRecordNormalized = - to.matched.slice().reverse() - .find(r => r.meta && r.meta.linkTags) as RouteRecordNormalized; + let title: string = '' as string; + let metaTags: Array = [] as Array; + let linkTags: Array = [] as Array; - if (hasTitle) { - document.title = hasTitle.meta.title as string; - } - if (hasMetas) { - const metaTags: object[] = hasMetas.meta.metaTags as object[]; - appendTags(metaTags, 'meta'); - } - if (hasLinks) { - const linkTags: object[] = hasLinks.meta.linkTags as object[]; - appendTags(linkTags, 'link'); - } + metas.forEach((item) => { + if (item.route === to.fullPath) { + if (item.meta) { + title = item.meta.title; + metaTags = item.meta.metaTags; + linkTags = item.meta.linkTags; + } + } + }); + + if (title) document.title = title; + if (metaTags) appendTags(metaTags, 'meta'); + if (linkTags) appendTags(linkTags, 'link'); return next(); }