+

+ {players.map((player) => {
+ return (
+
onPlayerRemove(player)}
+ parentRef={divRef}
+ />
+ )
})}
)
diff --git a/front/style/basket_court.css b/front/style/basket_court.css
index c001cc0..353d519 100644
--- a/front/style/basket_court.css
+++ b/front/style/basket_court.css
@@ -1,11 +1,17 @@
#court-container {
display: flex;
+ align-content: center;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+
+ padding: 20px 40px 20px 40px;
background-color: var(--main-color);
}
#court-svg {
- margin: 5%;
+ height: 100%;
user-select: none;
-webkit-user-drag: none;
}
diff --git a/front/style/colors.css b/front/style/colors.css
deleted file mode 100644
index 3c17a25..0000000
--- a/front/style/colors.css
+++ /dev/null
@@ -1,11 +0,0 @@
-:root {
- --main-color: #ffffff;
- --second-color: #ccde54;
-
- --background-color: #d2cdd3;
-
- --selected-team-primarycolor: #ffffff;
- --selected-team-secondarycolor: #000000;
-
- --selection-color: #3f7fc4;
-}
diff --git a/front/style/editor.css b/front/style/editor.css
index eefa561..45ce43d 100644
--- a/front/style/editor.css
+++ b/front/style/editor.css
@@ -1,4 +1,4 @@
-@import "colors.css";
+@import "theme/default.css";
#main-div {
display: flex;
@@ -63,7 +63,8 @@
}
#court-div-bounds {
- width: 60%;
+ padding: 20px 20px 20px 20px;
+ height: 75%;
}
.react-draggable {
diff --git a/front/style/new_tactic_panel.css b/front/style/new_tactic_panel.css
new file mode 100644
index 0000000..e5640b6
--- /dev/null
+++ b/front/style/new_tactic_panel.css
@@ -0,0 +1,117 @@
+
+#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: 30%;
+ 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 1s;
+}
+
+.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;
+ align-items: center;
+ align-content: center;
+
+ height: 25%;
+ background-color: var(--editor-court-selection-buttons);
+ border-radius: 0 0 20px 20px;
+ border-width: 3px;
+}
+
+.court-kind-button-top {
+ height: 75%;
+ overflow: hidden;
+ 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 {
+ display: flex;
+ justify-content: center;
+ align-items: stretch;
+ align-content: stretch;
+}
+
+.court-kind-button-image {
+ height: 100%;
+ 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);
+}
+
+.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;
+}
\ No newline at end of file
diff --git a/front/style/theme/default.css b/front/style/theme/default.css
new file mode 100644
index 0000000..0baa9b9
--- /dev/null
+++ b/front/style/theme/default.css
@@ -0,0 +1,21 @@
+@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;
+
+ --buttons-shadow-color: #a8a8a8;
+
+ --selection-color: #3f7fc4;
+
+ --border-color: #FFFFFF;
+
+ --editor-court-selection-background: #5f8fee;
+ --editor-court-selection-buttons: #acc4f3;
+
+ --text-main-font: 'Roboto', sans-serif;
+}
diff --git a/front/views/Editor.tsx b/front/views/Editor.tsx
index 380b024..4c4c725 100644
--- a/front/views/Editor.tsx
+++ b/front/views/Editor.tsx
@@ -1,20 +1,30 @@
+import {
+ CSSProperties,
+ Dispatch,
+ SetStateAction,
+ useCallback,
+ useRef,
+ useState,
+} from "react"
+import "../style/editor.css"
+import TitleInput from "../components/TitleInput"
+import { BasketCourt } from "../components/editor/BasketCourt"
-import { CSSProperties, Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from "react"
-import "../style/editor.css";
-import TitleInput from "../components/TitleInput";
-import {BasketCourt} from "../components/editor/BasketCourt";
-
+import plainCourt from "../assets/court/court.svg"
+import halfCourt from "../assets/court/half_court.svg"
import { Rack } from "../components/Rack"
import { PlayerPiece } from "../components/editor/PlayerPiece"
-
import { Player } from "../tactic/Player"
import { Tactic, TacticContent } from "../tactic/Tactic"
import { fetchAPI } from "../Fetcher"
import { Team } from "../tactic/Team"
import { calculateRatio } from "../Utils"
-import SavingState, { SaveState, SaveStates } from "../components/editor/SavingState"
+import SavingState, {
+ SaveState,
+ SaveStates,
+} from "../components/editor/SavingState"
const ERROR_STYLE: CSSProperties = {
borderColor: "red",
@@ -27,6 +37,14 @@ export interface EditorViewProps {
tactic: Tactic
onContentChange: (tactic: TacticContent) => Promise