can share tactic to team (test)
continuous-integration/drone/push Build is failing
Details
@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
require "../../config.php";
|
||||
require "../../vendor/autoload.php";
|
||||
require "../../sql/database.php";
|
||||
require "../../src/index-utils.php";
|
||||
|
||||
use IQBall\Api\API;
|
||||
use IQBall\Api\Controller\APIAuthController;
|
||||
use IQBall\Api\Controller\APITacticController;
|
||||
use IQBall\App\Session\PhpSessionHandle;
|
||||
use IQBall\Core\Action;
|
||||
use IQBall\Core\Connection;
|
||||
use IQBall\Core\Data\Account;
|
||||
use IQBall\Core\Gateway\AccountGateway;
|
||||
use IQBall\Core\Gateway\TacticInfoGateway;
|
||||
use IQBall\Core\Model\AuthModel;
|
||||
use IQBall\Core\Model\TacticModel;
|
||||
|
||||
function getTacticController(): APITacticController {
|
||||
return new APITacticController(new TacticModel(new TacticInfoGateway(new Connection(get_database()))));
|
||||
}
|
||||
|
||||
function getAuthController(): APIAuthController {
|
||||
return new APIAuthController(new AuthModel(new AccountGateway(new Connection(get_database()))));
|
||||
}
|
||||
|
||||
function getRoutes(): AltoRouter {
|
||||
$router = new AltoRouter();
|
||||
$router->setBasePath(get_public_path(__DIR__));
|
||||
|
||||
$router->map("POST", "/auth", Action::noAuth(fn() => getAuthController()->authorize()));
|
||||
$router->map("POST", "/tactic/[i:id]/edit/name", Action::auth(fn(int $id, Account $acc) => getTacticController()->updateName($id, $acc)));
|
||||
$router->map("POST", "/tactic/[i:id]/save", Action::auth(fn(int $id, Account $acc) => getTacticController()->saveContent($id, $acc)));
|
||||
|
||||
return $router;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the way of being authorised through the API
|
||||
* By checking if an Authorisation header is set, and by expecting its value to be a valid token of an account.
|
||||
* If the header is not set, fallback to the App's PHP session system, and try to extract the account from it.
|
||||
* @return Account|null
|
||||
* @throws Exception
|
||||
*/
|
||||
function tryGetAuthorization(): ?Account {
|
||||
$headers = getallheaders();
|
||||
|
||||
// If no authorization header is set, try fallback to php session.
|
||||
if (!isset($headers['Authorization'])) {
|
||||
$session = PhpSessionHandle::init();
|
||||
return $session->getAccount();
|
||||
}
|
||||
|
||||
$token = $headers['Authorization'];
|
||||
$gateway = new AccountGateway(new Connection(get_database()));
|
||||
return $gateway->getAccountFromToken($token);
|
||||
}
|
||||
|
||||
Api::render(API::handleMatch(getRoutes()->match(), fn() => tryGetAuthorization()));
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 732 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 9.4 KiB |
@ -1 +0,0 @@
|
||||
const o="/api",t="";export{o as API,t as BASE};
|
@ -1 +0,0 @@
|
||||
import{API as e}from"./Constants.ts-0288c91b.js";function p(t,n,o="POST"){return fetch(`${e}/${t}`,{method:o,headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})}export{p as fetchAPI};
|
@ -1 +0,0 @@
|
||||
import{j as o,R as c}from"../jsx-runtime-2e2d9038.js";import{r as n}from"../index-ca121481.js";var t={},r=n;t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot;function i(e,a){t.createRoot(document.getElementById("root")).render(o.jsx(c.StrictMode,{children:o.jsx(e,{...a})}))}export{i as renderView};
|
@ -1 +0,0 @@
|
||||
import{j as e,r as f}from"../../jsx-runtime-2e2d9038.js";import{D as u}from"../../cjs-ff7eb0e1.js";import"../../index-ca121481.js";function k({id:i,objects:r,onChange:t,canDetach:n,onElementDetached:x,render:a}){return e.jsx("div",{id:i,style:{display:"flex"},children:r.map(o=>e.jsx(l,{item:o,render:a,onTryDetach:(s,d)=>{if(!n(s))return;const c=r.findIndex(p=>p.key===d.key);t(r.toSpliced(c,1)),x(s,d)}},o.key))})}function l({item:i,onTryDetach:r,render:t}){const n=f.useRef(null);return e.jsx(u,{position:{x:0,y:0},nodeRef:n,onStop:()=>r(n.current,i),children:e.jsx("div",{ref:n,children:t(i)})})}export{k as Rack};
|
@ -1,2 +0,0 @@
|
||||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".title-input{background:transparent;border-top:none;border-right:none;border-left:none;text-align:center;border-bottom-width:2px;border-bottom-color:transparent}.title-input:focus{outline:none;border-bottom-color:#8a2be2}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
||||
import{r as u,j as o}from"../../jsx-runtime-2e2d9038.js";function p({style:r,default_value:s,on_validated:a}){const[e,l]=u.useState(s),n=u.useRef(null);return o.jsx("input",{className:"title-input",ref:n,style:r,type:"text",value:e,onChange:t=>l(t.target.value),onBlur:t=>a(e),onKeyUp:t=>{t.key=="Enter"&&n.current?.blur()}})}export{p as default};
|
@ -1,2 +0,0 @@
|
||||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".arrow-action{height:50%}.arrow-action-icon{user-select:none;-moz-user-select:none;max-width:17px;max-height:17px}.arrow-head-pick{position:absolute;cursor:grab;top:0;left:0;min-width:17px;min-height:17px}.arrow-head-pick:active{cursor:crosshair}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
||||
import{r as s,j as o}from"../../../jsx-runtime-2e2d9038.js";import{D as i}from"../../../cjs-ff7eb0e1.js";import"../../../index-ca121481.js";const c="/IQBall/public/arrow-73d7c199.svg";function g({onHeadDropped:t,onHeadPicked:e,onHeadMoved:a}){const r=s.useRef(null);return o.jsxs("div",{className:"arrow-action",children:[o.jsx("img",{className:"arrow-action-icon",src:c,alt:"add arrow"}),o.jsx(i,{nodeRef:r,onStart:()=>{const n=r.current.getBoundingClientRect();e(n)},onStop:()=>{const n=r.current.getBoundingClientRect();t(n)},onDrag:()=>{const n=r.current.getBoundingClientRect();a(n)},position:{x:0,y:0},children:o.jsx("div",{ref:r,className:"arrow-head-pick"})})]})}function x(){return o.jsx("div",{style:{backgroundColor:"black",height:"5px",width:"25px"}})}function p(){return o.jsx("svg",{viewBox:"0 0 50 50",width:20,height:20,children:o.jsx("polygon",{points:"50 0, 0 0, 25 40",fill:"#000"})})}export{p as MoveToHead,x as ScreenHead,g as default};
|
@ -1 +0,0 @@
|
||||
import{r as t,j as e}from"../../../jsx-runtime-2e2d9038.js";import{BallPiece as n}from"../editor/BallPiece.tsx-1b2eb023.js";import{D as s}from"../../../cjs-ff7eb0e1.js";import"../../../index-ca121481.js";function f({onDrop:o}){const r=t.useRef(null);return e.jsx(s,{onStop:()=>o(r.current),nodeRef:r,children:e.jsx("div",{ref:r,children:e.jsx(n,{})})})}export{f as default};
|
@ -1 +0,0 @@
|
||||
function i(...n){const t=n.map(c=>c.x),a=n.map(c=>c.y),r=Math.min(...t),u=Math.min(...a),y=Math.max(...t)-r,h=Math.max(...a)-u;return{x:r,y:u,width:y,height:h}}function m(n,t,a){return{x:n.x+t/2,y:n.y+a/2,width:t,height:a}}function s(n,t){return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}export{i as boundsOf,s as contains,m as surrounds};
|
@ -1 +0,0 @@
|
||||
const x={x:0,y:0};function y(n,t){return{x:n.x-t.x,y:n.y-t.y}}function r(n){return{x:n.x+n.width/2,y:n.y+n.height/2}}function o(n,t){return{x:n.x+t.x,y:n.y+t.y}}function h(n,t){return{x:n.x-t.x,y:n.y-t.y}}function e(n,t){return{x:n.x*t,y:n.y*t}}function u(n,t){return Math.sqrt((n.x-t.x)**2+(n.y-t.y)**2)}function f(n){return u(x,n)}function c(n,t){const i=y(n,t);return Math.atan2(i.x,i.y)}function s(n,t){return{x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}}function d(n,t){return{x:n.x*t.width,y:n.y*t.height}}function M(n,t){return{x:n.x/2+t.x/2,y:n.y/2+t.y/2}}function l(n,t){return{x:Math.cos(t)*n.x-Math.sin(t)*n.y,y:Math.sin(t)*n.x+Math.cos(t)*n.y}}export{x as NULL_POS,o as add,c as angle,u as distance,M as middle,r as middlePos,h as minus,e as mul,f as norm,d as posWithinBase,s as ratioWithinBase,y as relativeTo,l as rotate};
|
@ -1,4 +0,0 @@
|
||||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".ball *{fill:#c5520d}.ball-div,.ball{pointer-events:all;width:20px;height:20px;cursor:pointer}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
||||
import{r as e,j as a}from"../../../jsx-runtime-2e2d9038.js";const l=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1280.000000pt",height:"1276.000000pt",viewBox:"0 0 1280.000000 1276.000000",preserveAspectRatio:"xMidYMid meet",...t},e.createElement("metadata",null,`
|
||||
Created by potrace 1.15, written by Peter Selinger 2001-2017
|
||||
`),e.createElement("g",{transform:"translate(0.000000,1276.000000) scale(0.100000,-0.100000)",fill:"#000000",stroke:"none"},e.createElement("path",{d:"M6085 12754 c-1124 -66 -2124 -378 -3055 -952 -113 -70 -150 -98 -115 -88 50 14 350 37 555 43 925 24 1755 -198 2573 -691 95 -56 321 -202 502 -322 511 -340 600 -373 753 -280 281 170 481 457 559 800 24 105 24 393 -1 506 -59 277 -202 557 -417 813 -45 54 -91 102 -103 106 -19 8 -160 25 -411 51 -99 11 -724 21 -840 14z"}),e.createElement("path",{d:"M7630 12635 c0 -2 28 -48 63 -102 210 -324 335 -626 378 -913 16 -112 14 -310 -6 -424 -56 -328 -245 -651 -591 -1014 -79 -83 -105 -117 -98 -127 11 -17 953 -895 959 -895 3 0 136 105 297 233 1085 863 1485 1140 2065 1431 94 47 173 91 175 98 7 20 -232 240 -467 429 -766 616 -1654 1043 -2622 1259 -135 31 -153 33 -153 25z"}),e.createElement("path",{d:"M3055 11615 c-127 -13 -262 -36 -359 -61 -69 -18 -157 -81 -397 -280 -984 -823 -1695 -1909 -2049 -3135 -84 -291 -140 -550 -185 -854 -19 -130 -29 -231 -23 -225 3 3 16 34 28 70 36 103 124 267 195 363 386 518 1151 901 2475 1238 291 74 553 134 910 209 107 23 236 50 285 60 50 11 158 33 240 50 83 17 191 39 240 50 50 10 133 28 185 39 1079 228 1599 392 1915 604 96 64 205 181 244 262 28 57 35 82 35 135 1 62 -2 70 -44 135 -142 218 -526 495 -1019 737 -920 449 -1941 680 -2676 603z"}),e.createElement("path",{d:"M10940 10674 c-63 -41 -176 -114 -250 -162 -299 -193 -798 -547 -1215 -861 -423 -318 -899 -711 -893 -736 2 -6 189 -246 417 -532 l414 -520 171 82 c528 255 975 375 1398 375 574 0 1060 -239 1464 -720 85 -101 219 -286 264 -365 18 -31 34 -54 36 -52 11 11 -69 456 -120 671 -235 976 -692 1875 -1347 2646 -54 63 -126 145 -161 182 l-63 66 -115 -74z"}),e.createElement("path",{d:"M7125 9833 c-70 -62 -231 -181 -327 -242 -491 -308 -1120 -531 -2106 -746 -90 -20 -452 -94 -804 -165 -1128 -228 -1491 -317 -1978 -485 -936 -323 -1527 -761 -1860 -1378 l-42 -78 -5 -252 c-31 -1503 472 -2974 1415 -4137 47 -58 87 -107 88 -108 8 -11 50 35 210 233 1067 1318 2042 2408 3174 3549 953 960 1908 1846 2933 2721 135 116 246 215 247 220 0 10 -890 905 -900 905 -3 -1 -23 -17 -45 -37z"}),e.createElement("path",{d:"M8255 8618 c-886 -668 -1534 -1216 -2370 -2004 -1028 -969 -2125 -2136 -3299 -3509 -132 -154 -265 -309 -296 -345 -142 -164 -592 -703 -596 -715 -7 -16 300 -326 466 -471 678 -593 1425 -1020 2260 -1294 231 -75 490 -143 730 -190 207 -40 413 -72 560 -85 62 -6 69 -4 155 38 192 94 346 209 515 383 351 363 601 854 839 1649 58 192 158 587 211 835 40 185 114 541 190 920 98 486 168 825 200 965 5 22 16 69 24 105 8 36 36 151 61 255 40 164 59 235 115 435 52 187 169 532 242 715 232 582 562 1062 911 1325 25 19 45 38 44 42 -2 8 -838 1039 -840 1037 -1 0 -56 -41 -122 -91z"}),e.createElement("path",{d:"M10570 8093 c-358 -54 -579 -149 -741 -319 -84 -89 -93 -106 -86 -168 10 -100 65 -199 397 -721 368 -578 508 -818 691 -1185 379 -760 567 -1413 611 -2132 24 -392 -30 -863 -142 -1243 -16 -54 -28 -100 -27 -102 8 -8 297 369 419 547 722 1055 1109 2313 1108 3600 0 294 -15 490 -40 547 -30 68 -127 228 -194 318 -240 326 -590 581 -999 729 -271 98 -498 137 -791 135 -100 -1 -192 -3 -206 -6z"}),e.createElement("path",{d:"M9265 7317 c-292 -97 -541 -403 -744 -914 -174 -439 -312 -964 -521 -1975 -16 -82 -44 -214 -60 -295 -17 -82 -39 -188 -50 -238 -11 -49 -33 -157 -50 -240 -389 -1893 -798 -2915 -1390 -3478 -57 -54 -123 -112 -147 -130 l-45 -32 203 -3 c568 -9 1247 95 1844 283 928 292 1741 765 2451 1423 179 166 216 207 253 281 96 190 163 413 202 676 20 128 23 192 23 430 0 344 -22 560 -95 927 -191 959 -696 2109 -1249 2843 -175 231 -351 410 -428 433 -64 19 -153 23 -197 9z"})));function c(){return a.jsx(l,{className:"ball"})}export{c as BallPiece};
|
@ -1 +0,0 @@
|
||||
import{r as a,j as l}from"../../../jsx-runtime-2e2d9038.js";import{CourtBall as F}from"./CourtBall.tsx-df87788c.js";import L from"./CourtPlayer.tsx-3da10617.js";import{ActionKind as s}from"../../tactic/Action.ts-d727cf33.js";import M from"../actions/ArrowAction.tsx-b082b6c9.js";import{ratioWithinBase as r,middlePos as m}from"../arrows/Pos.ts-9fe07952.js";import N from"../actions/BallAction.tsx-c8825b1d.js";import{contains as T}from"../arrows/Box.ts-eca59774.js";import{CourtAction as V}from"../../views/editor/CourtAction.tsx-15785ac7.js";import"../../../cjs-ff7eb0e1.js";import"../../../index-ca121481.js";import"./BallPiece.tsx-1b2eb023.js";import"./PlayerPiece.tsx-964e2db3.js";import"../arrows/BendableArrow.tsx-f8a85d9b.js";function tt({players:B,actions:C,objects:R,renderAction:x,setActions:p,onPlayerRemove:h,onPlayerChange:v,onBallMoved:E,onBallRemove:P,courtImage:A,courtRef:d}){function y(t,o){const n=document.getElementById(t.id),e=d.current.getBoundingClientRect(),c=r(m(n.getBoundingClientRect()),e);for(const i of B){if(i.id==t.id)continue;const g=document.getElementById(i.id).getBoundingClientRect();if(!(g.top>o.bottom||g.right<o.left||g.bottom<o.top||g.left>o.right)){const O=document.getElementById(i.id).getBoundingClientRect(),S=r(m(O),e),w={fromPlayerId:n.id,toPlayerId:i.id,type:t.hasBall?s.SHOOT:s.SCREEN,moveFrom:c,segments:[{next:S}]};p(k=>[...k,w]);return}}const u={fromPlayerId:n.id,type:t.hasBall?s.DRIBBLE:s.MOVE,moveFrom:r(m(n.getBoundingClientRect()),e),segments:[{next:r(m(o),e)}]};p(i=>[...i,u])}const[I,f]=a.useState(null),b=a.useCallback(t=>{const o=r(m(document.getElementById(t.id).getBoundingClientRect()),d.current.getBoundingClientRect());p(n=>n.map(e=>{if(e.fromPlayerId==t.id)return{...e,moveFrom:o};if(e.toPlayerId==t.id){const c=e.segments.toSpliced(e.segments.length-1,1,{...e.segments[e.segments.length-1],next:o});return{...e,segments:c}}return e}))},[]),[j,D]=a.useState([]);return a.useLayoutEffect(()=>D(C),[C]),l.jsxs("div",{className:"court-container",ref:d,style:{position:"relative"},children:[A,B.map(t=>l.jsx(L,{player:t,onDrag:()=>b(t),onChange:v,onRemove:()=>h(t),courtRef:d,availableActions:o=>[l.jsx(M,{onHeadMoved:n=>{const e=d.current.getBoundingClientRect(),c=m(n),u=B.find(i=>i!=t&&T(document.getElementById(i.id).getBoundingClientRect(),c));f(i=>({...i,segments:[{next:r(c,e)}],type:t.hasBall?u?s.SHOOT:s.DRIBBLE:u?s.SCREEN:s.MOVE}))},onHeadPicked:n=>{document.activeElement.blur();const e=d.current.getBoundingClientRect();f({type:t.hasBall?s.DRIBBLE:s.MOVE,fromPlayerId:t.id,toPlayerId:void 0,moveFrom:r(m(o.getBoundingClientRect()),e),segments:[{next:r(m(n),e)}]})},onHeadDropped:n=>{y(t,n),f(null)}},1),t.hasBall&&l.jsx(N,{onDrop:n=>E(n.getBoundingClientRect())},2)]},t.id)),j.map((t,o)=>x(t,o)),R.map(t=>{if(t.type=="ball")return l.jsx(F,{onMoved:E,ball:t,onRemove:P},"ball");throw new Error("unknown court object",t.type)}),I&&l.jsx(V,{courtRef:d,action:I,onActionDeleted:()=>{},onActionChanges:()=>{}})]})}export{tt as BasketCourt};
|
@ -1 +0,0 @@
|
||||
import{r as a,j as e}from"../../../jsx-runtime-2e2d9038.js";import{D as c}from"../../../cjs-ff7eb0e1.js";import{BallPiece as p}from"./BallPiece.tsx-1b2eb023.js";import"../../../index-ca121481.js";function d({onMoved:r,ball:o,onRemove:i}){const t=a.useRef(null),n=o.rightRatio,s=o.bottomRatio;return e.jsx(c,{onStop:()=>r(t.current.getBoundingClientRect()),nodeRef:t,children:e.jsx("div",{className:"ball-div",ref:t,tabIndex:0,onKeyUp:l=>{l.key=="Delete"&&i()},style:{position:"absolute",left:`${n*100}%`,top:`${s*100}%`},children:e.jsx(p,{})})})}export{d as CourtBall};
|
@ -1 +0,0 @@
|
||||
import{r as h,j as e}from"../../../jsx-runtime-2e2d9038.js";import{PlayerPiece as p}from"./PlayerPiece.tsx-964e2db3.js";import{D as R}from"../../../cjs-ff7eb0e1.js";import{NULL_POS as B,ratioWithinBase as g}from"../arrows/Pos.ts-9fe07952.js";import"../../../index-ca121481.js";function y({player:t,onDrag:n,onChange:s,onRemove:a,courtRef:r,availableActions:c}){const l=t.hasBall,d=t.rightRatio,m=t.bottomRatio,o=h.useRef(null);return e.jsx(R,{handle:".player-piece",nodeRef:o,onDrag:n,position:B,onStop:()=>{const i=o.current.getBoundingClientRect(),u=r.current.getBoundingClientRect(),{x,y:f}=g(i,u);s({id:t.id,rightRatio:x,bottomRatio:f,team:t.team,role:t.role,hasBall:t.hasBall})},children:e.jsx("div",{id:t.id,ref:o,className:"player",style:{position:"absolute",left:`${d*100}%`,top:`${m*100}%`},children:e.jsxs("div",{tabIndex:0,className:"player-content",onKeyUp:i=>{i.key=="Delete"&&a()},children:[e.jsx("div",{className:"player-actions",children:c(o.current)}),e.jsx(p,{team:t.team,text:t.role,hasBall:l})]})})})}export{y as default};
|
@ -1,2 +0,0 @@
|
||||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".player{pointer-events:none}.player-content{display:flex;flex-direction:column;align-content:center;align-items:center;outline:none}.player-piece{font-family:monospace;pointer-events:all;background-color:var(--selected-team-primarycolor);color:var(--selected-team-secondarycolor);border-radius:100px;width:20px;height:20px;display:flex;align-items:center;justify-content:center;user-select:none}.player-piece-has-ball{border-width:2px;border-style:solid;border-color:var(--player-piece-ball-border-color)}.player-actions{display:flex;position:absolute;flex-direction:row;justify-content:space-evenly;align-content:space-between;align-items:center;visibility:hidden;transform:translateY(-25px);height:20px;width:150%;gap:25%}.player:focus-within .player-actions{visibility:visible;pointer-events:all}.player:focus-within .player-piece{color:var(--selection-color)}.player:focus-within{z-index:1000}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
||||
import{j as r}from"../../../jsx-runtime-2e2d9038.js";function s({team:i,text:l,hasBall:a}){let e=`player-piece ${i}`;return a&&(e+=" player-piece-has-ball"),r.jsx("div",{className:e,children:r.jsx("p",{children:l})})}export{s as PlayerPiece};
|
@ -1 +0,0 @@
|
||||
import{j as a}from"../../../jsx-runtime-2e2d9038.js";class s{}s.Guest={className:"save-state-guest",message:"you are not connected, your changes will not be saved."};s.Ok={className:"save-state-ok",message:"saved"};s.Saving={className:"save-state-saving",message:"saving..."};s.Err={className:"save-state-error",message:"could not save tactic."};function c({state:e}){return a.jsx("div",{className:"save-state",children:a.jsx("div",{className:e.className,children:e.message})})}export{s as SaveStates,c as default};
|
@ -1 +0,0 @@
|
||||
var O=(E=>(E.SCREEN="SCREEN",E.DRIBBLE="DRIBBLE",E.MOVE="MOVE",E.SHOOT="SHOOT",E))(O||{});export{O as ActionKind};
|
@ -1 +0,0 @@
|
||||
|
@ -1 +0,0 @@
|
||||
|
@ -1 +0,0 @@
|
||||
var n=(e=>(e.Allies="allies",e.Opponents="opponents",e))(n||{});export{n as Team};
|
@ -1,2 +0,0 @@
|
||||
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Roboto:wght@300;400&display=swap";:root{--main-color: #ffffff;--second-color: #e8e8e8;--background-color: #d2cdd3;--selected-team-primarycolor: #ffffff;--selected-team-secondarycolor: #000000;--player-allies-color: #64e4f5;--player-opponents-color: #f59264;--buttons-shadow-color: #a8a8a8;--selection-color: #3f7fc4;--border-color: #ffffff;--editor-court-selection-background: #5f8fee;--editor-court-selection-buttons: #acc4f3;--player-piece-ball-border-color: #000000;--text-main-font: "Roboto", sans-serif}#panel-root{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;align-content:center}#panel-top{font-family:var(--text-main-font)}#panel-choices{width:100%;height:100%;display:flex;justify-content:center;align-items:center;align-content:center;background-color:var(--editor-court-selection-background)}#panel-buttons{width:75%;height:20%;display:flex;justify-content:space-evenly;align-items:stretch;align-content:center}.court-kind-button{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;align-content:center;cursor:pointer;transition:scale .5s ease-out;width:auto}.court-kind-button-bottom,.court-kind-button-top{border:solid;border-color:var(--border-color)}.court-kind-button-bottom{display:flex;justify-content:center;align-items:center;align-content:center;height:25%;width:100%;background-color:var(--editor-court-selection-buttons);border-radius:0 0 20px 20px;border-width:3px}.court-kind-button-top{height:30%;background-color:var(--main-color);border-radius:20px 20px 0 0;border-width:3px 3px 0 3px}.court-kind-button:hover{scale:1.1}.court-kind-button-top,.court-kind-button-image-div{overflow:hidden;display:flex;height:100%;width:100%;justify-content:center;align-items:center;align-content:center}.court-kind-button-image{height:100%;width:150px;user-select:none;-webkit-user-drag:none}.court-kind-button-image-div{height:100%;padding:0 10px;background-color:var(--second-color)}.court-kind-button-name,.court-kind-button-details{user-select:none;font-family:var(--text-main-font)}.court-kind-button-details{position:absolute;z-index:-1;top:0;transition:top 1s}.court-kind-button:hover .court-kind-button-details{top:-20px}')),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
||||
import{j as t}from"../../jsx-runtime-2e2d9038.js";import{C as l}from"../../full_court-1739e2e0.js";import{BASE as s}from"../Constants.ts-0288c91b.js";const o="/IQBall/public/half_court-eb16117a.svg";function m(){return t.jsxs("div",{id:"panel-root",children:[t.jsx("div",{id:"panel-top",children:t.jsx("p",{children:"Select a basket court"})}),t.jsx("div",{id:"panel-choices",children:t.jsxs("div",{id:"panel-buttons",children:[t.jsx(e,{name:"Plain",details:"Select a plain basketball court",image:l,redirect:"/tactic/new/plain"}),t.jsx(e,{name:"Half",details:"Select half a basketball court",image:o,redirect:"/tactic/new/half"})]})})]})}function e({name:i,image:a,details:n,redirect:c}){return t.jsxs("div",{className:"court-kind-button",onClick:()=>location.href=s+c,children:[t.jsx("div",{className:"court-kind-button-details",children:n}),t.jsx("div",{className:"court-kind-button-top",children:t.jsx("div",{className:"court-kind-button-image-div",children:t.jsx("img",{src:a,alt:i,className:"court-kind-button-image"})})}),t.jsx("div",{className:"court-kind-button-bottom",children:t.jsx("p",{className:"court-kind-button-name",children:i})})]})}export{m as default};
|
@ -1,2 +0,0 @@
|
||||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("#main{height:100vh;width:100%;display:flex;flex-direction:column}#topbar{display:flex;background-color:var(--main-color);justify-content:center;align-items:center}h1{text-align:center;margin-top:0}#court-container{flex:1;display:flex;justify-content:center;background-color:var(--main-color)}#court{max-width:80%;max-height:80%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
||||
import{r as s,j as t}from"../../jsx-runtime-2e2d9038.js";import{C as e}from"../../full_court-1739e2e0.js";function c({id:o,name:r}){const[i,a]=s.useState({});return t.jsxs("div",{id:"main",children:[t.jsx("div",{id:"topbar",children:t.jsx("h1",{children:r})}),t.jsx("div",{id:"court-container",children:t.jsx("img",{id:"court",src:e,style:i,alt:"Basketball Court"})})]})}export{c as default};
|
@ -1 +0,0 @@
|
||||
import{j as s}from"../../../jsx-runtime-2e2d9038.js";import{ActionKind as r}from"../../tactic/Action.ts-d727cf33.js";import i from"../../components/arrows/BendableArrow.tsx-f8a85d9b.js";import{ScreenHead as n,MoveToHead as y}from"../../components/actions/ArrowAction.tsx-b082b6c9.js";import"../../components/arrows/Pos.ts-9fe07952.js";import"../../../cjs-ff7eb0e1.js";import"../../../index-ca121481.js";function l({action:e,onActionChanges:a,onActionDeleted:m,courtRef:p}){let t;switch(e.type){case r.DRIBBLE:case r.MOVE:case r.SHOOT:t=()=>s.jsx(y,{});break;case r.SCREEN:t=()=>s.jsx(n,{});break}let o;switch(e.type){case r.SHOOT:o="10 5";break}return s.jsx(i,{forceStraight:e.type==r.SHOOT,area:p,startPos:e.moveFrom,segments:e.segments,onSegmentsChanges:d=>{a({...e,segments:d})},wavy:e.type==r.DRIBBLE,endRadius:e.toPlayerId?26:17,startRadius:0,onDeleteRequested:m,style:{head:t,dashArray:o}})}export{l as CourtAction};
|
@ -1 +0,0 @@
|
||||
const l="/IQBall/public/full_court-939d8e82.svg";export{l as C};
|
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 6.0 KiB |
@ -1,129 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
require "../vendor/autoload.php";
|
||||
require "../config.php";
|
||||
require "../sql/database.php";
|
||||
require "../src/App/react-display.php";
|
||||
require "../src/index-utils.php";
|
||||
|
||||
use IQBall\App\App;
|
||||
use IQBall\App\Controller\AuthController;
|
||||
use IQBall\App\Controller\EditorController;
|
||||
use IQBall\App\Controller\TeamController;
|
||||
use IQBall\App\Controller\UserController;
|
||||
use IQBall\App\Controller\VisualizerController;
|
||||
use IQBall\App\Session\MutableSessionHandle;
|
||||
use IQBall\App\Session\PhpSessionHandle;
|
||||
use IQBall\App\Session\SessionHandle;
|
||||
use IQBall\App\ViewHttpResponse;
|
||||
use IQBall\Core\Action;
|
||||
use IQBall\Core\Connection;
|
||||
use IQBall\Core\Data\CourtType;
|
||||
use IQBall\Core\Gateway\AccountGateway;
|
||||
use IQBall\Core\Gateway\MemberGateway;
|
||||
use IQBall\Core\Gateway\TacticInfoGateway;
|
||||
use IQBall\Core\Gateway\TeamGateway;
|
||||
use IQBall\Core\Http\HttpCodes;
|
||||
use IQBall\Core\Http\HttpResponse;
|
||||
use IQBall\Core\Model\AuthModel;
|
||||
use IQBall\Core\Model\TacticModel;
|
||||
use IQBall\Core\Model\TeamModel;
|
||||
use IQBall\Core\Validation\ValidationFail;
|
||||
use Twig\Environment;
|
||||
use Twig\Loader\FilesystemLoader;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
function getConnection(): Connection {
|
||||
return new Connection(get_database());
|
||||
}
|
||||
|
||||
function getUserController(): UserController {
|
||||
return new UserController(new TacticModel(new TacticInfoGateway(getConnection())));
|
||||
}
|
||||
|
||||
function getVisualizerController(): VisualizerController {
|
||||
return new VisualizerController(new TacticModel(new TacticInfoGateway(getConnection())));
|
||||
}
|
||||
|
||||
function getEditorController(): EditorController {
|
||||
return new EditorController(new TacticModel(new TacticInfoGateway(getConnection())));
|
||||
}
|
||||
|
||||
function getTeamController(): TeamController {
|
||||
$con = getConnection();
|
||||
return new TeamController(new TeamModel(new TeamGateway($con), new MemberGateway($con), new AccountGateway($con)));
|
||||
}
|
||||
|
||||
function getAuthController(): AuthController {
|
||||
return new AuthController(new AuthModel(new AccountGateway(getConnection())));
|
||||
}
|
||||
|
||||
function getTwig(): Environment {
|
||||
global $basePath;
|
||||
$fl = new FilesystemLoader("../src/App/Views");
|
||||
$twig = new Environment($fl);
|
||||
|
||||
$twig->addFunction(new TwigFunction('path', fn(string $str) => "$basePath$str"));
|
||||
|
||||
return $twig;
|
||||
}
|
||||
|
||||
function getRoutes(): AltoRouter {
|
||||
global $basePath;
|
||||
|
||||
$ar = new AltoRouter();
|
||||
$ar->setBasePath($basePath);
|
||||
|
||||
//authentication
|
||||
$ar->map("GET", "/login", Action::noAuth(fn() => getAuthController()->displayLogin()));
|
||||
$ar->map("GET", "/register", Action::noAuth(fn() => getAuthController()->displayRegister()));
|
||||
$ar->map("POST", "/login", Action::noAuth(fn(SessionHandle $s) => getAuthController()->login($_POST, $s)));
|
||||
$ar->map("POST", "/register", Action::noAuth(fn(SessionHandle $s) => getAuthController()->register($_POST, $s)));
|
||||
|
||||
//user-related
|
||||
$ar->map("GET", "/", Action::auth(fn(SessionHandle $s) => getUserController()->home($s)));
|
||||
$ar->map("GET", "/home", Action::auth(fn(SessionHandle $s) => getUserController()->home($s)));
|
||||
$ar->map("GET", "/settings", Action::auth(fn(SessionHandle $s) => getUserController()->settings($s)));
|
||||
$ar->map("GET", "/disconnect", Action::auth(fn(MutableSessionHandle $s) => getUserController()->disconnect($s)));
|
||||
|
||||
|
||||
//tactic-related
|
||||
$ar->map("GET", "/tactic/[i:id]/view", Action::auth(fn(int $id, SessionHandle $s) => getVisualizerController()->openVisualizer($id, $s)));
|
||||
$ar->map("GET", "/tactic/[i:id]/edit", Action::auth(fn(int $id, SessionHandle $s) => getEditorController()->openEditor($id, $s)));
|
||||
// don't require an authentication to run this action.
|
||||
// If the user is not connected, the tactic will never save.
|
||||
$ar->map("GET", "/tactic/new", Action::noAuth(fn() => getEditorController()->createNew()));
|
||||
$ar->map("GET", "/tactic/new/plain", Action::noAuth(fn(SessionHandle $s) => getEditorController()->createNewOfKind(CourtType::plain(), $s)));
|
||||
$ar->map("GET", "/tactic/new/half", Action::noAuth(fn(SessionHandle $s) => getEditorController()->createNewOfKind(CourtType::half(), $s)));
|
||||
|
||||
//team-related
|
||||
$ar->map("GET", "/team/new", Action::auth(fn(SessionHandle $s) => getTeamController()->displayCreateTeam($s)));
|
||||
$ar->map("POST", "/team/new", Action::auth(fn(SessionHandle $s) => getTeamController()->submitTeam($_POST, $s)));
|
||||
$ar->map("GET", "/team/search", Action::auth(fn(SessionHandle $s) => getTeamController()->displayListTeamByName($s)));
|
||||
$ar->map("POST", "/team/search", Action::auth(fn(SessionHandle $s) => getTeamController()->listTeamByName($_POST, $s)));
|
||||
$ar->map("GET", "/team/[i:id]", Action::auth(fn(int $id, SessionHandle $s) => getTeamController()->displayTeam($id, $s)));
|
||||
$ar->map("GET", "/team/members/add", Action::auth(fn(SessionHandle $s) => getTeamController()->displayAddMember($s)));
|
||||
$ar->map("POST", "/team/members/add", Action::auth(fn(SessionHandle $s) => getTeamController()->addMember($_POST, $s)));
|
||||
$ar->map("GET", "/team/members/remove", Action::auth(fn(SessionHandle $s) => getTeamController()->displayDeleteMember($s)));
|
||||
$ar->map("POST", "/team/members/remove", Action::auth(fn(SessionHandle $s) => getTeamController()->deleteMember($_POST, $s)));
|
||||
|
||||
return $ar;
|
||||
}
|
||||
|
||||
function runMatch($match, MutableSessionHandle $session): HttpResponse {
|
||||
global $basePath;
|
||||
if (!$match) {
|
||||
return ViewHttpResponse::twig("error.html.twig", [
|
||||
'failures' => [ValidationFail::notFound("Could not find page {$_SERVER['REQUEST_URI']}.")],
|
||||
], HttpCodes::NOT_FOUND);
|
||||
}
|
||||
|
||||
return App::runAction($basePath . '/login', $match['target'], $match['params'], $session);
|
||||
}
|
||||
|
||||
|
||||
//this is a global variable
|
||||
$basePath = get_public_path(__DIR__);
|
||||
|
||||
App::render(runMatch(getRoutes()->match(), PhpSessionHandle::init()), fn() => getTwig());
|
@ -1,278 +0,0 @@
|
||||
{
|
||||
"Constants.ts": {
|
||||
"file": "front/Constants.ts-0288c91b.js",
|
||||
"isEntry": true,
|
||||
"src": "Constants.ts"
|
||||
},
|
||||
"Fetcher.ts": {
|
||||
"file": "front/Fetcher.ts-06285d09.js",
|
||||
"imports": [
|
||||
"Constants.ts"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "Fetcher.ts"
|
||||
},
|
||||
"ViewRenderer.tsx": {
|
||||
"file": "front/ViewRenderer.tsx-10ef55f2.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "ViewRenderer.tsx"
|
||||
},
|
||||
"_cjs-ff7eb0e1.js": {
|
||||
"file": "cjs-ff7eb0e1.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"_index-ca121481.js"
|
||||
]
|
||||
},
|
||||
"_full_court-1739e2e0.js": {
|
||||
"assets": [
|
||||
"full_court-939d8e82.svg"
|
||||
],
|
||||
"file": "full_court-1739e2e0.js"
|
||||
},
|
||||
"_index-ca121481.js": {
|
||||
"file": "index-ca121481.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js"
|
||||
]
|
||||
},
|
||||
"_jsx-runtime-2e2d9038.js": {
|
||||
"file": "jsx-runtime-2e2d9038.js"
|
||||
},
|
||||
"assets/court/full_court.svg": {
|
||||
"file": "full_court-939d8e82.svg",
|
||||
"src": "assets/court/full_court.svg"
|
||||
},
|
||||
"assets/court/half_court.svg": {
|
||||
"file": "half_court-eb16117a.svg",
|
||||
"src": "assets/court/half_court.svg"
|
||||
},
|
||||
"assets/icon/arrow.svg": {
|
||||
"file": "arrow-73d7c199.svg",
|
||||
"src": "assets/icon/arrow.svg"
|
||||
},
|
||||
"components/Rack.tsx": {
|
||||
"file": "front/components/Rack.tsx-02c40791.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/Rack.tsx"
|
||||
},
|
||||
"components/TitleInput.tsx": {
|
||||
"file": "front/components/TitleInput.tsx-b871e858.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/TitleInput.tsx"
|
||||
},
|
||||
"components/actions/ArrowAction.tsx": {
|
||||
"assets": [
|
||||
"arrow-73d7c199.svg"
|
||||
],
|
||||
"file": "front/components/actions/ArrowAction.tsx-b082b6c9.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/actions/ArrowAction.tsx"
|
||||
},
|
||||
"components/actions/BallAction.tsx": {
|
||||
"file": "front/components/actions/BallAction.tsx-c8825b1d.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"components/editor/BallPiece.tsx",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/actions/BallAction.tsx"
|
||||
},
|
||||
"components/arrows/BendableArrow.tsx": {
|
||||
"file": "front/components/arrows/BendableArrow.tsx-f8a85d9b.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"components/arrows/Pos.ts",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/arrows/BendableArrow.tsx"
|
||||
},
|
||||
"components/arrows/Box.ts": {
|
||||
"file": "front/components/arrows/Box.ts-eca59774.js",
|
||||
"isEntry": true,
|
||||
"src": "components/arrows/Box.ts"
|
||||
},
|
||||
"components/arrows/Pos.ts": {
|
||||
"file": "front/components/arrows/Pos.ts-9fe07952.js",
|
||||
"isEntry": true,
|
||||
"src": "components/arrows/Pos.ts"
|
||||
},
|
||||
"components/editor/BallPiece.tsx": {
|
||||
"file": "front/components/editor/BallPiece.tsx-1b2eb023.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/editor/BallPiece.tsx"
|
||||
},
|
||||
"components/editor/BasketCourt.tsx": {
|
||||
"file": "front/components/editor/BasketCourt.tsx-f01fc52b.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"components/editor/CourtBall.tsx",
|
||||
"components/editor/CourtPlayer.tsx",
|
||||
"tactic/Action.ts",
|
||||
"components/actions/ArrowAction.tsx",
|
||||
"components/arrows/Pos.ts",
|
||||
"components/actions/BallAction.tsx",
|
||||
"components/arrows/Box.ts",
|
||||
"views/editor/CourtAction.tsx",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"_index-ca121481.js",
|
||||
"components/editor/BallPiece.tsx",
|
||||
"components/editor/PlayerPiece.tsx",
|
||||
"components/arrows/BendableArrow.tsx"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/editor/BasketCourt.tsx"
|
||||
},
|
||||
"components/editor/CourtBall.tsx": {
|
||||
"file": "front/components/editor/CourtBall.tsx-df87788c.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"components/editor/BallPiece.tsx",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/editor/CourtBall.tsx"
|
||||
},
|
||||
"components/editor/CourtPlayer.tsx": {
|
||||
"file": "front/components/editor/CourtPlayer.tsx-3da10617.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"components/editor/PlayerPiece.tsx",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"components/arrows/Pos.ts",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/editor/CourtPlayer.tsx"
|
||||
},
|
||||
"components/editor/PlayerPiece.tsx": {
|
||||
"file": "front/components/editor/PlayerPiece.tsx-964e2db3.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/editor/PlayerPiece.tsx"
|
||||
},
|
||||
"components/editor/SavingState.tsx": {
|
||||
"file": "front/components/editor/SavingState.tsx-72e513fc.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "components/editor/SavingState.tsx"
|
||||
},
|
||||
"tactic/Action.ts": {
|
||||
"file": "front/tactic/Action.ts-d727cf33.js",
|
||||
"isEntry": true,
|
||||
"src": "tactic/Action.ts"
|
||||
},
|
||||
"tactic/CourtObjects.ts": {
|
||||
"file": "front/tactic/CourtObjects.ts-4ed993c7.js",
|
||||
"isEntry": true,
|
||||
"src": "tactic/CourtObjects.ts"
|
||||
},
|
||||
"tactic/Player.ts": {
|
||||
"file": "front/tactic/Player.ts-4ed993c7.js",
|
||||
"isEntry": true,
|
||||
"src": "tactic/Player.ts"
|
||||
},
|
||||
"tactic/Tactic.ts": {
|
||||
"file": "front/tactic/Tactic.ts-4ed993c7.js",
|
||||
"isEntry": true,
|
||||
"src": "tactic/Tactic.ts"
|
||||
},
|
||||
"tactic/Team.ts": {
|
||||
"file": "front/tactic/Team.ts-1737253d.js",
|
||||
"isEntry": true,
|
||||
"src": "tactic/Team.ts"
|
||||
},
|
||||
"views/Editor.tsx": {
|
||||
"file": "front/views/Editor.tsx-951e52fa.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"components/TitleInput.tsx",
|
||||
"components/editor/BallPiece.tsx",
|
||||
"components/Rack.tsx",
|
||||
"components/editor/PlayerPiece.tsx",
|
||||
"Fetcher.ts",
|
||||
"tactic/Team.ts",
|
||||
"components/editor/SavingState.tsx",
|
||||
"views/editor/CourtAction.tsx",
|
||||
"components/editor/BasketCourt.tsx",
|
||||
"components/arrows/Pos.ts",
|
||||
"tactic/Action.ts",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"_index-ca121481.js",
|
||||
"Constants.ts",
|
||||
"components/arrows/BendableArrow.tsx",
|
||||
"components/actions/ArrowAction.tsx",
|
||||
"components/editor/CourtBall.tsx",
|
||||
"components/editor/CourtPlayer.tsx",
|
||||
"components/actions/BallAction.tsx",
|
||||
"components/arrows/Box.ts"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "views/Editor.tsx"
|
||||
},
|
||||
"views/NewTacticPanel.tsx": {
|
||||
"assets": [
|
||||
"half_court-eb16117a.svg"
|
||||
],
|
||||
"file": "front/views/NewTacticPanel.tsx-64bf0fca.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"_full_court-1739e2e0.js",
|
||||
"Constants.ts"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "views/NewTacticPanel.tsx"
|
||||
},
|
||||
"views/Visualizer.tsx": {
|
||||
"file": "front/views/Visualizer.tsx-a2e9b703.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"_full_court-1739e2e0.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "views/Visualizer.tsx"
|
||||
},
|
||||
"views/editor/CourtAction.tsx": {
|
||||
"file": "front/views/editor/CourtAction.tsx-15785ac7.js",
|
||||
"imports": [
|
||||
"_jsx-runtime-2e2d9038.js",
|
||||
"tactic/Action.ts",
|
||||
"components/arrows/BendableArrow.tsx",
|
||||
"components/actions/ArrowAction.tsx",
|
||||
"components/arrows/Pos.ts",
|
||||
"_cjs-ff7eb0e1.js",
|
||||
"_index-ca121481.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "views/editor/CourtAction.tsx"
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
.arrow-action {
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.arrow-action-icon {
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
max-width: 17px;
|
||||
max-height: 17px;
|
||||
}
|
||||
|
||||
.arrow-head-pick {
|
||||
position: absolute;
|
||||
cursor: grab;
|
||||
top: 0;
|
||||
left: 0;
|
||||
min-width: 17px;
|
||||
min-height: 17px;
|
||||
}
|
||||
|
||||
.arrow-head-pick:active {
|
||||
cursor: crosshair;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
.remove-action {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.remove-action * {
|
||||
stroke: red;
|
||||
fill: white;
|
||||
}
|
||||
|
||||
.remove-action:hover * {
|
||||
fill: #f1dbdb;
|
||||
stroke: #ff331a;
|
||||
cursor: pointer;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
.ball * {
|
||||
fill: #c5520d;
|
||||
}
|
||||
|
||||
.ball-div,
|
||||
.ball {
|
||||
pointer-events: all;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
.arrow-point {
|
||||
cursor: pointer;
|
||||
|
||||
border-radius: 100px;
|
||||
background-color: black;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.arrow-point:hover {
|
||||
background-color: var(--selection-color);
|
||||
}
|
||||
|
||||
.arrow-path {
|
||||
pointer-events: stroke;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.arrow-path:hover,
|
||||
.arrow-path:active {
|
||||
stroke: var(--selection-color);
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
:root {
|
||||
--main-color: #ffffff;
|
||||
--second-color: #ccde54;
|
||||
|
||||
--background-color: #d2cdd3;
|
||||
|
||||
--selected-team-primarycolor: #ffffff;
|
||||
--selected-team-secondarycolor: #000000;
|
||||
|
||||
--selection-color: #3f7fc4;
|
||||
|
||||
--arrows-color: #676767;
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
@import "theme/default.css";
|
||||
|
||||
#main-div {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: var(--background-color);
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#topbar-left {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#topbar-right {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
#topbar-div {
|
||||
display: flex;
|
||||
background-color: var(--main-color);
|
||||
margin-bottom: 3px;
|
||||
|
||||
justify-content: space-between;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
#racks {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.title-input {
|
||||
width: 25ch;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
#edit-div {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#allies-rack,
|
||||
#opponent-rack {
|
||||
width: 125px;
|
||||
min-width: 125px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
#allies-rack {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
#opponent-rack {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
#opponent-rack .player-piece {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#allies-rack .player-piece {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.player-piece.opponents {
|
||||
background-color: var(--player-opponents-color);
|
||||
}
|
||||
|
||||
.player-piece.allies {
|
||||
background-color: var(--player-allies-color);
|
||||
}
|
||||
|
||||
#court-div {
|
||||
background-color: var(--background-color);
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
#court-image-div {
|
||||
position: relative;
|
||||
background-color: white;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.court-container {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
height: 75%;
|
||||
}
|
||||
|
||||
#court-image {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
|
||||
#court-image * {
|
||||
stroke: var(--selected-team-secondarycolor);
|
||||
}
|
||||
|
||||
.react-draggable {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.save-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 20%;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.save-state-error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.save-state-ok {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.save-state-saving,
|
||||
.save-state-guest {
|
||||
color: gray;
|
||||
}
|
@ -1,122 +0,0 @@
|
||||
#panel-root {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
#panel-top {
|
||||
font-family: var(--text-main-font);
|
||||
}
|
||||
|
||||
#panel-choices {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
|
||||
background-color: var(--editor-court-selection-background);
|
||||
}
|
||||
|
||||
#panel-buttons {
|
||||
width: 75%;
|
||||
height: 20%;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: stretch;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.court-kind-button {
|
||||
position: relative;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
transition: scale 0.5s ease-out;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.court-kind-button-bottom,
|
||||
.court-kind-button-top {
|
||||
border: solid;
|
||||
border-color: var(--border-color);
|
||||
}
|
||||
.court-kind-button-bottom {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
|
||||
background-color: var(--editor-court-selection-buttons);
|
||||
border-radius: 0 0 20px 20px;
|
||||
border-width: 3px;
|
||||
}
|
||||
|
||||
.court-kind-button-top {
|
||||
height: 30%;
|
||||
background-color: var(--main-color);
|
||||
border-radius: 20px 20px 0 0;
|
||||
border-width: 3px 3px 0 3px;
|
||||
}
|
||||
|
||||
.court-kind-button:hover {
|
||||
scale: 1.1;
|
||||
}
|
||||
|
||||
.court-kind-button-top,
|
||||
.court-kind-button-image-div {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.court-kind-button-image {
|
||||
height: 100%;
|
||||
width: 150px;
|
||||
user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
|
||||
.court-kind-button-image-div {
|
||||
height: 100%;
|
||||
|
||||
padding: 0 10px 0 10px;
|
||||
background-color: var(--second-color);
|
||||
}
|
||||
|
||||
.court-kind-button-name,
|
||||
.court-kind-button-details {
|
||||
user-select: none;
|
||||
font-family: var(--text-main-font);
|
||||
}
|
||||
|
||||
.court-kind-button-details {
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
top: 0;
|
||||
transition: top 1s;
|
||||
}
|
||||
|
||||
.court-kind-button:hover .court-kind-button-details {
|
||||
top: -20px;
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
.player {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.player-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.player-piece {
|
||||
font-family: monospace;
|
||||
pointer-events: all;
|
||||
|
||||
background-color: var(--selected-team-primarycolor);
|
||||
color: var(--selected-team-secondarycolor);
|
||||
|
||||
border-radius: 100px;
|
||||
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.player-piece-has-ball {
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: var(--player-piece-ball-border-color);
|
||||
}
|
||||
|
||||
.player-actions {
|
||||
display: flex;
|
||||
|
||||
position: absolute;
|
||||
flex-direction: row;
|
||||
justify-content: space-evenly;
|
||||
align-content: space-between;
|
||||
align-items: center;
|
||||
visibility: hidden;
|
||||
|
||||
transform: translateY(-25px);
|
||||
|
||||
height: 20px;
|
||||
width: 150%;
|
||||
|
||||
gap: 25%;
|
||||
}
|
||||
|
||||
.player:focus-within .player-actions {
|
||||
visibility: visible;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
.player:focus-within .player-piece {
|
||||
color: var(--selection-color);
|
||||
}
|
||||
|
||||
.player:focus-within {
|
||||
z-index: 1000;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400&display=swap");
|
||||
:root {
|
||||
--main-color: #ffffff;
|
||||
--second-color: #e8e8e8;
|
||||
|
||||
--background-color: #d2cdd3;
|
||||
|
||||
--selected-team-primarycolor: #ffffff;
|
||||
--selected-team-secondarycolor: #000000;
|
||||
--player-allies-color: #64e4f5;
|
||||
--player-opponents-color: #f59264;
|
||||
|
||||
--buttons-shadow-color: #a8a8a8;
|
||||
|
||||
--selection-color: #3f7fc4;
|
||||
|
||||
--border-color: #ffffff;
|
||||
|
||||
--editor-court-selection-background: #5f8fee;
|
||||
--editor-court-selection-buttons: #acc4f3;
|
||||
|
||||
--player-piece-ball-border-color: #000000;
|
||||
--text-main-font: "Roboto", sans-serif;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
.title-input {
|
||||
background: transparent;
|
||||
border-top: none;
|
||||
border-right: none;
|
||||
border-left: none;
|
||||
text-align: center;
|
||||
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
.title-input:focus {
|
||||
outline: none;
|
||||
|
||||
border-bottom-color: blueviolet;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
#main {
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#topbar {
|
||||
display: flex;
|
||||
background-color: var(--main-color);
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#court-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background-color: var(--main-color);
|
||||
}
|
||||
|
||||
#court {
|
||||
max-width: 80%;
|
||||
max-height: 80%;
|
||||
}
|