mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-03-14 18:00:50 +00:00
1 line
No EOL
2.3 KiB
JavaScript
1 line
No EOL
2.3 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,12862,e=>{e.v({Joystick:"TouchJoystick-module__tcddlW__Joystick",Left:"TouchJoystick-module__tcddlW__Left TouchJoystick-module__tcddlW__Joystick",Right:"TouchJoystick-module__tcddlW__Right TouchJoystick-module__tcddlW__Joystick"})},18339,e=>{"use strict";var t=e.i(43476),o=e.i(71645),c=e.i(79123),l=e.i(66093),n=e.i(12862);function r(e){let t=e.querySelector(".back");t&&(t.style.background="rgba(3, 79, 76, 0.6)",t.style.border="1px solid rgba(0, 219, 223, 0.5)",t.style.boxShadow="inset 0 0 10px rgba(0, 0, 0, 0.7)");let o=e.querySelector(".front");o&&(o.style.background="radial-gradient(circle at 50% 50%, rgba(23, 247, 198, 0.9) 0%, rgba(9, 184, 170, 0.95) 100%)",o.style.border="2px solid rgba(255, 255, 255, 0.4)",o.style.boxShadow="0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 2px rgba(0, 0, 0, 0.3)")}function a(){let{touchMode:a}=(0,c.useControls)(),[i,s]=(0,o.useState)(null),[u,d]=(0,o.useState)(null),{moveState:f,lookState:m,setMoveState:y,setLookState:b}=(0,l.useJoystick)();(0,o.useEffect)(()=>{if(!i)return;let t=null,o=!1;return e.A(84968).then(e=>{o||(t=e.default.create({zone:i,mode:"static",position:{left:"70px",bottom:"70px"},size:120,restOpacity:.9}),r(i),t.on("move",(e,t)=>{y({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on("end",()=>{y({force:0})}))}),()=>{o=!0,t?.destroy()}},[f,i,y]),(0,o.useEffect)(()=>{if(!u)return;let t=null,o=!1;return e.A(84968).then(e=>{o||(t=e.default.create({zone:u,mode:"static",position:{right:"70px",bottom:"70px"},size:120,restOpacity:.9}),r(u),t.on("move",(e,t)=>{b({angle:t.angle.radian,force:Math.min(1,t.force)})}),t.on("end",()=>{b({force:0})}))}),()=>{o=!0,t?.destroy()}},[m,u,b]);let g=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:s,className:"dualStick"===a?n.default.Left:n.default.Joystick,onContextMenu:e=>e.preventDefault(),onTouchStart:g},a),"dualStick"===a?(0,t.jsx)("div",{ref:d,className:n.default.Right,onContextMenu:e=>e.preventDefault(),onTouchStart:g}):null]})}e.s(["TouchJoystick",()=>a])},84968,e=>{e.v(t=>Promise.all(["static/chunks/6e9a6efec350bf8d.js"].map(t=>e.l(t))).then(()=>t(90208)))}]); |