mirror of
https://gitlab.com/octospacc/Web-Archives-Misc
synced 2025-01-15 09:15:49 +01:00
2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{17:function(t,n,i){"use strict";function e(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return a(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,e=new Array(n);i<n;i++)e[i]=t[i];return e}i.r(n),n.default={data:function(){for(var t=this.$route.context,n=[],i=[],a=e(navigator.getGamepads()).filter(Boolean),l=0,s=a.length;l<s;l++){var o=a[l];o.id===t.name&&(i=o.buttons,n=o.axes)}return{name:t.name,controls:t.controls,buttons:i,axes:n}},on:{pageInit:function(){for(var t=document.querySelectorAll("input.gamepad-input"),n=0,i=t.length;n<i;n++){var e=t[n];e.addEventListener("focus",this.onGamepadInputFocus),e.addEventListener("blur",this.onGamepadInputBlur)}}},methods:{setKey:function(){var t=this,n=JSON.parse(localStorage.getItem("controls")),i={a:0,b:0,x:0,y:0,up:0,down:0,left:0,right:0,start:0,select:0,l:0,r:0};Object.keys(this.controls).map((function(n){i[n]=t.controls[n]}));var e={name:this.name,controls:i},a=n.findIndex((function(n){return n.name===t.name}));-1<a?n[a]=e:n.push(e),localStorage.setItem("controls",JSON.stringify(n))},formatGamepadValue:function(t){return"number"==typeof t?"Button ".concat(t):"Axis ".concat(t.axis).concat(1===t.dir?"+":"-")},onGamepadInputFocus:function(t){this.focusedEl=t.target,this.listenForControllerInput(),this.setKey()},onGamepadInputBlur:function(){this.focusedEl=void 0,window.cancelAnimationFrame(this.rafHandle),this.setKey()},listenForControllerInput:function(){var t,n=this,i=e(navigator.getGamepads()).find((function(t){return t.id===n.name}));if(!i||!this.focusedEl)return window.cancelAnimationFrame(this.rafHandle);var a=i.buttons.findIndex((function(t){return t.pressed}));-1<a&&(t=a);var l=i.axes.findIndex((function(t){return.5<t||t<-.5}));-1<l&&(t={axis:l,dir:0<i.axes[l]?1:-1}),void 0!==t&&(this.focusedEl.value=this.formatGamepadValue(t),this.controls[this.focusedEl.name]=t),this.rafHandle=window.requestAnimationFrame(this.listenForControllerInput)}},id:"ee5e624a99",render:function(){return'\n\t<div class="page">\n\t\t<div class="navbar">\n\t\t\t<div class="navbar-inner sliding">\n\t\t\t\t<div class="left">\n\t\t\t\t\t<a href="#" class="link back"><i class="icon icon-back"></i> <span class="ios-only">Back</span></a>\n\t\t\t\t</div>\n\t\t\t\t<div class="title">\n\t\t\t\t\t'.concat(this.name.replace(/\((.*)\)/,"").trim(""),'\n\t\t\t\t</div>\n\t\t\t\t<div class="title-large">\n\t\t\t\t\t<div class="title-large-text">\n\t\t\t\t\t\t').concat(this.name.replace(/\((.*)\)/,"").trim(""),'\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="page-content">\n\t\t\t<form id="controls_form" name="controls_form">\n\t\t\t\t<div class="block-title block-title-medium">D-Pad</div>\n\t\t\t\t<div class="list no-hairlines-md">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tUp\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="up" id="up_input" value="').concat(this.formatGamepadValue(this.controls.up),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tDown\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="down" id="down_input" value="').concat(this.formatGamepadValue(this.controls.down),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tLeft\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="left" id="left_input" value="').concat(this.formatGamepadValue(this.controls.left),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tRight\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="right" id="right_input" value="').concat(this.formatGamepadValue(this.controls.right),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class="block-title block-title-medium">\n\t\t\t\t\tStart/Select\n\t\t\t\t</div>\n\t\t\t\t<div class="list no-hairlines-md">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tStart\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="start" id="start_input" value="').concat(this.formatGamepadValue(this.controls.start),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tSelect\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="select" id="select_input" value="').concat(this.formatGamepadValue(this.controls.select),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class="block-title block-title-medium">\n\t\t\t\t\tFace Buttons\n\t\t\t\t</div>\n\t\t\t\t<div class="list no-hairlines-md">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tA\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="a" id="a_input" value="').concat(this.formatGamepadValue(this.controls.a),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tB\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="b" id="b_input" value="').concat(this.formatGamepadValue(this.controls.b),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tX\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="x" id="x_input" value="').concat(this.formatGamepadValue(this.controls.x),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tY\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="y" id="y_input" value="').concat(this.formatGamepadValue(this.controls.y),'"placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<div class="block-title block-title-medium">\n\t\t\t\t\tShoulder Buttons\n\t\t\t\t</div>\n\t\t\t\t<div class="list no-hairlines-md">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tL\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="l" id="l_input" value="').concat(this.formatGamepadValue(this.controls.l),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<div class="item-content item-input">\n\t\t\t\t\t\t\t\t<div class="item-inner">\n\t\t\t\t\t\t\t\t\t<div class="item-title item-label">\n\t\t\t\t\t\t\t\t\t\tR\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="item-input-wrap">\n\t\t\t\t\t\t\t\t\t\t<input class="gamepad-input" maxlength="0" type="text" name="r" id="r_input" value="').concat(this.formatGamepadValue(this.controls.r),'" placeholder="Press a button on your controller" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t</div>\n')},styleScoped:!1}}}]);
|
|
//# sourceMappingURL=4.app.js.map
|