diff --git a/.DS_Store b/.DS_Store index 69bfa23..e771c62 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/index.html b/app/index.html index 980e89c..c227dc4 100644 --- a/app/index.html +++ b/app/index.html @@ -4,7 +4,7 @@ - Football analysys + CoachStats
diff --git a/app/src/App.jsx b/app/src/App.jsx index 83a2d72..98188f8 100644 --- a/app/src/App.jsx +++ b/app/src/App.jsx @@ -8,7 +8,7 @@ const App = () => { return ( -
+
diff --git a/app/src/assets/logo.svg b/app/src/assets/logo.svg index b60f55d..252458e 100644 --- a/app/src/assets/logo.svg +++ b/app/src/assets/logo.svg @@ -1,124 +1,899 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/components/Hero.jsx b/app/src/components/Hero.jsx index 384d23b..5b4869b 100644 --- a/app/src/components/Hero.jsx +++ b/app/src/components/Hero.jsx @@ -7,11 +7,18 @@ import { logo, menu, close } from "../assets"; const Hero = () => { + + const [isOpen, setIsOpen] = useState(false); + const [gameMinute, setGameMinute] = useState(''); + + const toggleDropdown = () => setIsOpen(!isOpen); + const handleMinuteChange = (e) => setGameMinute(e.target.value); + //zmienne globalne //zmienna mówiąca który przycisk jest aktywny, jest ona wykorzystywana - //przez listener nanoszący zawodników na boisko. 0 - strzelec , 1 - obranca , 2 - napasnik. zmienna przez aktywacje przycskówk bb1,bb2 i bb3 + //przez listener nanoszący zawodników na boisko. 1 - strzelec , 2 - bramkarz , 3 - obronca, 4 - napasnik. zmienna przez aktywacje przycskówk bb1, bb2, bb3 i bb4 let active_bbt = "bbt1"; let number_of_defenders = 0; @@ -25,34 +32,93 @@ const Hero = () => { function changePlayer(a){ - document.getElementById("bbt1").style.background = "white"; - document.getElementById("bbt2").style.background = "white"; - document.getElementById("bbt3").style.background = "white"; - document.getElementById(a).style.background = "grey"; + document.getElementById("bbt1").style.background = "#99FFCC"; + document.getElementById("bbt2").style.background = "#99FFCC"; + document.getElementById("bbt3").style.background = "#99FFCC"; + document.getElementById("bbt4").style.background = "#99FFCC"; + document.getElementById(a).style.background = "#00CC66"; active_bbt = a } function changeLeg(a){ - document.getElementById("bbt4").style.background = "white"; - document.getElementById("bbt5").style.background = "white"; - document.getElementById("bbt6").style.background = "white"; - document.getElementById(a).style.background = "grey"; + document.getElementById("bbt5").style.background = "#99FFCC"; + document.getElementById("bbt6").style.background = "#99FFCC"; + document.getElementById("bbt7").style.background = "#99FFCC"; + document.getElementById("bbt8").style.background = "#99FFCC"; + document.getElementById(a).style.background = "#00CC66"; Leg_bbt = a } + + + // function changeTechnique(a){ + + // document.getElementById("bbt4").style.background = "#99FFCC"; + + // technique_bbt = a + // } + + // function is_one_on_one(a){ + + // document.getElementById("bbt4").style.background = "#99FFCC"; + + // technique_bbt = a + // } + + // function is_aerial_won(a){ + + // document.getElementById("bbt4").style.background = "#99FFCC"; + + // technique_bbt = a + // } + + // function is_first_time(a){ + + // document.getElementById("bbt4").style.background = "#99FFCC"; + + // technique_bbt = a + // } + + // function is_redirect(a){ + + // document.getElementById("bbt4").style.background = "#99FFCC"; + + // technique_bbt = a + // } + + // function is_kick_off(a){ + + // document.getElementById("bbt4").style.background = "#99FFCC"; + + // technique_bbt = a + // } + + // function is_follows_dribble(a){ + + // document.getElementById("bbt4").style.background = "#99FFCC"; + + // technique_bbt = a + // } + + // Reset Boiska function resetField() { var footballField = document.getElementById('footballField'); var footballs = document.querySelectorAll('.football'); + var goalkeepers = document.querySelectorAll('.goalkeeper'); var strikers = document.querySelectorAll('.striker') var defenders = document.querySelectorAll('.defender') + footballs.forEach(function (ball) { footballField.removeChild(ball); }); + goalkeepers.forEach(function (ball) { + footballField.removeChild(ball); + }); strikers.forEach(function(ball){ footballField.removeChild(ball) }) @@ -78,7 +144,7 @@ const Hero = () => { } ) eX = data.response - document.getElementById("ex").innerHTML = "Ex:"+ eX + document.getElementById("ex").innerHTML = "Współczynnik xG: "+ eX } else { alert('Piłka nie jest obecnie na boisku.'); } @@ -104,23 +170,35 @@ const Hero = () => { ball.style.left = x + 'px'; ball.style.top = y + 'px'; footballField.appendChild(ball); - } else { alert('Możesz dodać tylko jedną piłkę!'); } - // Przypadek kiedy zaznaczamy obronce + // Przypadek kiedy zaznaczamy bramkarza + } else if (active_bbt == "bbt2") { + let existingGoalkeeper = document.querySelector('.goalkeeper'); + + if (!existingGoalkeeper) { + var ball = document.createElement('div'); + ball.className = 'goalkeeper'; + ball.style.left = x + 'px'; + ball.style.top = y + 'px'; + footballField.appendChild(ball); + } else { + alert('Możesz dodać tylko jednego bramkarza!'); + } } - else if(active_bbt == "bbt2"){ - if(number_of_defenders <= 6){ + // Przypadek kiedy zaznaczamy obronce + else if(active_bbt == "bbt3"){ + if(number_of_defenders <= 10){ var ball = document.createElement('div'); ball.className = 'defender'; ball.style.left = x + 'px'; ball.style.top = y + 'px'; footballField.appendChild(ball); number_of_defenders = number_of_defenders + 1} else {alert("zbyt duza liczba obronców")} - }else{ + }else if(active_bbt == "bbt4"){ // Przypadek kiedy zaznaczamy napastnika - if(number_of_strikers <= 6){ + if(number_of_strikers <= 10){ var ball = document.createElement('div'); ball.className = 'striker'; ball.style.left = x + 'px'; @@ -145,27 +223,113 @@ const Hero = () => { document.getElementById("bbt3").addEventListener("click",function(){ changePlayer("bbt3") },false) - document.getElementById("bbt4").addEventListener("click",function(){ - changeLeg("bbt4") - },false) - document.getElementById("bbt5").addEventListener("click",function(){ - changeLeg("bbt5") - },false) - document.getElementById("bbt6").addEventListener("click",function(){ - changeLeg("bbt6") + changePlayer("bbt4") },false) + // document.getElementById("bbt5").addEventListener("click",function(){ + // changeLeg("bbt5") + // },false) + // document.getElementById("bbt6").addEventListener("click",function(){ + // changeLeg("bbt6") + // },false) + // document.getElementById("bbt7").addEventListener("click",function(){ + // changeLeg("bbt7") + // },false) + // document.getElementById("bbt8").addEventListener("click",function(){ + // changeLeg("bbt8") + // },false) },[]); /*zwracany komponent zawierajacy boisko*/ return ( -
- -
-
+ +
+{/* Listy zwijane */} + +
+ {/* new version */} +
+ + {isOpen && ( + + )} +
+ + {/* old version */} + {/*
+ + + + +
*/} + +
+ + {isOpen && ( + + )} +
+ + +
+ + {isOpen && ( + + )} +
+ +
+ + {isOpen && ( + + )} +
+ +
+ + +
+
+ +
+ @@ -189,24 +353,39 @@ const Hero = () => {
- +
); }; diff --git a/app/src/components/Navbar.jsx b/app/src/components/Navbar.jsx index 526da09..591157b 100644 --- a/app/src/components/Navbar.jsx +++ b/app/src/components/Navbar.jsx @@ -29,8 +29,8 @@ const Navbar = () => {