diff --git a/cryptide_project/src/Pages/InGame.tsx b/cryptide_project/src/Pages/InGame.tsx index da57d35..33010ce 100644 --- a/cryptide_project/src/Pages/InGame.tsx +++ b/cryptide_project/src/Pages/InGame.tsx @@ -72,6 +72,7 @@ const InGame = ({locale, changeLocale}) => { isDaily=false } + let isEasy: boolean = true const isEasytmp = params.get('easy'); if (isEasytmp == "false"){ diff --git a/cryptide_project/src/Pages/Lobby.css b/cryptide_project/src/Pages/Lobby.css index 60dfcf0..5fbe13c 100644 --- a/cryptide_project/src/Pages/Lobby.css +++ b/cryptide_project/src/Pages/Lobby.css @@ -59,4 +59,39 @@ .centerButton { display: flex; justify-content: center; +} + +.lobbyR{ + display: flex; + flex-direction: column; + align-items: center; +} + +.lobbyR *{ + margin: 20px 10px; +} + +.valuebutton{ + border-radius: 90px; + width: 50px; + height: 50px; + background-color: #fff; +} + +.nbNodeDiv{ + display: flex; + flex-direction: column; + justify-content: center; + + border: solid 2px whitesmoke; + border-radius: 15px; + + background-color: white; + + width: 70%; +} + +.nbNodeDiv div { + display: flex; + justify-content: center; } \ No newline at end of file diff --git a/cryptide_project/src/Pages/Lobby.tsx b/cryptide_project/src/Pages/Lobby.tsx index e77b8cd..0d27296 100644 --- a/cryptide_project/src/Pages/Lobby.tsx +++ b/cryptide_project/src/Pages/Lobby.tsx @@ -42,13 +42,16 @@ import { socket } from "../SocketConfig"; import { random } from 'lodash'; import SessionService from '../services/SessionService'; +import { useRef } from 'react'; +import Button from 'react-bootstrap/Button'; +import Overlay from 'react-bootstrap/Overlay'; + + let gameStarted = false function Lobby() { const theme=useTheme(); const navigate = useNavigate(); - - const [enteredNumber, setEnteredNumber] = useState(20); //@ts-ignore const handleNumberChange = (event) => { @@ -68,7 +71,14 @@ function Lobby() { socket.emit("lobby joined", room, new EasyBot("botId" + Math.floor(Math.random() * 1000), "Bot" + Math.floor(Math.random() * 100), "").toJson()) } - + //* nb Node + const [enteredNumber, setEnteredNumber] = useState(20); + + //@ts-ignore + const handleNumberChange = (event) => { + const newNumber = Math.max(20, Math.min(60, parseInt(event.target.value, 10))); + setEnteredNumber(newNumber); + }; useEffect(() => { if (first){ @@ -165,6 +175,21 @@ function Lobby() { socket.emit('network created', JSON.stringify(networkPerson, null, 2), JSON.stringify(choosenPerson), JSON.stringify(choosenIndices), room, start); } + const copyGameLink = () => { + setShow(!show) + + const gameLink = "http://localhost:3000/lobby?room="+ room; + navigator.clipboard.writeText(gameLink) + .then(() => { + console.log('Lien copié avec succès !'); + }) + .catch((err) => { + console.error('Erreur lors de la copie du lien :', err); + }); + }; + + const [show, setShow] = useState(false); + const target = useRef(null); return (
Attendez que tous vos amis rejoignent avant de lancer la partie.
+ {/* Bouton pour copier le lien */} + +