diff --git a/front/assets/court/court.svg b/front/assets/court/court.svg index 476a96f..e01fd58 100644 --- a/front/assets/court/court.svg +++ b/front/assets/court/court.svg @@ -1,8 +1,8 @@ diff --git a/front/assets/court/half_court.svg b/front/assets/court/half_court.svg index 8c06d6d..8e7640e 100644 --- a/front/assets/court/half_court.svg +++ b/front/assets/court/half_court.svg @@ -1,4 +1,4 @@ - + diff --git a/front/style/basket_court.css b/front/style/basket_court.css index 859d00f..92a520c 100644 --- a/front/style/basket_court.css +++ b/front/style/basket_court.css @@ -9,7 +9,7 @@ } #court-svg { - margin: 35px; + margin: 35px 0 35px 0; height: 87%; user-select: none; -webkit-user-drag: none; diff --git a/front/style/new_tactic_panel.css b/front/style/new_tactic_panel.css index 5f151d9..ff6a07e 100644 --- a/front/style/new_tactic_panel.css +++ b/front/style/new_tactic_panel.css @@ -27,7 +27,7 @@ #panel-buttons { width: 75%; - height: 30%; + height: 20%; display: flex; justify-content: space-evenly; align-items: stretch; @@ -45,17 +45,15 @@ cursor: pointer; - transition: scale 1s; + transition: scale 0.5s ease-out; + width: auto; } .court-kind-button-bottom, .court-kind-button-top { - width: 100%; - height: 100%; border: solid; border-color: var(--border-color); } - .court-kind-button-bottom { display: flex; justify-content: center; @@ -63,14 +61,15 @@ 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: 75%; - overflow: hidden; + height: 30%; background-color: var(--main-color); border-radius: 20px 20px 0 0; border-width: 3px 3px 0 3px; @@ -82,21 +81,25 @@ .court-kind-button-top, .court-kind-button-image-div { + overflow: hidden; display: flex; + height: 100%; + width: 100%; justify-content: center; - align-items: stretch; - align-content: stretch; + 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 { - width: 100%; height: 100%; + padding: 0 10px 0 10px; background-color: var(--second-color); } diff --git a/front/views/Editor.tsx b/front/views/Editor.tsx index 3b6ad4f..14ebbf6 100644 --- a/front/views/Editor.tsx +++ b/front/views/Editor.tsx @@ -58,12 +58,9 @@ interface RackedPlayer { export default function Editor({ id, name, + courtType, content, -}: { - id: number - name: string - content: string -}) { +}: EditorProps) { const isInGuestMode = id == -1 const storage_content = localStorage.getItem(GUEST_MODE_CONTENT_STORAGE_KEY) @@ -97,7 +94,7 @@ export default function Editor({ (r) => r.ok, ) }} - /> + courtType={courtType}/> ) } diff --git a/front/views/NewTacticPanel.tsx b/front/views/NewTacticPanel.tsx index 9733c91..d3d5528 100644 --- a/front/views/NewTacticPanel.tsx +++ b/front/views/NewTacticPanel.tsx @@ -56,7 +56,7 @@ function CourtKindButton({
-

{name}

+

{name}

) diff --git a/src/App/Controller/EditorController.php b/src/App/Controller/EditorController.php index 64de063..855d8d9 100644 --- a/src/App/Controller/EditorController.php +++ b/src/App/Controller/EditorController.php @@ -38,11 +38,12 @@ class EditorController { /** * @return ViewHttpResponse the editor view for a test tactic. */ - private function openTestEditor(): ViewHttpResponse { + private function openTestEditor(CourtType $courtType): ViewHttpResponse { return ViewHttpResponse::react("views/Editor.tsx", [ "id" => -1, //-1 id means that the editor will not support saves - "content" => '{"players": []}', "name" => TacticModel::TACTIC_DEFAULT_NAME, + "content" => '{"players": []}', + "courtType" => $courtType->name() ]); } @@ -55,6 +56,13 @@ class EditorController { * @return ViewHttpResponse the editor view */ public function createNewOfKind(CourtType $type, SessionHandle $session): ViewHttpResponse { + + $action = $session->getAccount(); + + if ($action == null) { + return $this->openTestEditor($type); + } + $tactic = $this->model->makeNewDefault($session->getAccount()->getId(), $type); return $this->openEditorFor($tactic); }