Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

105 fixiamo merda a caso #106

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Scoprimi/public/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
/* Occupano metà della larghezza, meno il margine */
height: 50%;
/* Imposta l'altezza al 50% del contenitore */
margin-bottom: 1rem;
padding: 0.5rem 0rem 0.5rem 0rem;
/* Margine inferiore per lo spazio tra le righe */
object-fit: cover;
/* Ritaglia l'immagine per riempire il contenitore */
border-radius: 10px;
border-radius: 25px;
/* Arrotonda i bordi delle immagini */
}

Expand Down
1 change: 1 addition & 0 deletions Scoprimi/public/css/new-game.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ input:checked+.slider:before {
.switch-container {
display: flex;
align-items: center;
justify-content: space-between;
/* Allinea lo switch e il testo verticalmente al centro */
margin-bottom: 15px;
/* Spazio inferiore tra gli switch */
Expand Down
28 changes: 15 additions & 13 deletions Scoprimi/src/components/finalresults/FinalResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,22 @@ const FinalResults: React.FC = () => {
</table>
</div>


<button
className="my-btn mt-3 my-bg-puss"
onClick={() => navigate('/')}
>
Torna alla homepage
</button>
<button
className='my-btn mt-3 my-bg-puss'
onClick={TODOREMATCH}
>
Gioca ancora
</button>
<div className='lobby-button-group mt-3'>
<button
className="my-btn mt-3 my-bg-elegant-backgorund"
onClick={() => navigate('/')}
>
<i className="fa-solid fa-house"></i>
</button>
<button
className='my-btn mt-3 my-bg-puss'
onClick={TODOREMATCH}
>
Gioca ancora
</button>
</div>
</div>

</>
);

Expand Down
12 changes: 10 additions & 2 deletions Scoprimi/src/components/game/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
const [mostVotedPerson, setMostVotedPerson] = useState<string>('');
const [playerImages, setPlayerImages] = useState<{ [key: string]: string }>({});
const [voteRecap, setVoteRecap] = useState<{ [key: string]: string }>({});
const [allSameSelection, setAllSameSelection] = useState<boolean>(false);

const [clicked, setClicked] = useState<boolean>(false);
const [isTimerActive, setIsTimerActive] = useState<boolean>(false);
Expand All @@ -48,7 +49,7 @@
const [isPhoto, setIsPhoto] = useState<boolean>(false);
const [selectedPlayer, setSelectedPlayer] = useState<string>('');

const [pages, setPages] = useState<any>();

Check warning on line 52 in Scoprimi/src/components/game/Game.tsx

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20.x)

Unexpected any. Specify a different type

const [isWho, setIsWho] = useState<boolean>(false);

Expand Down Expand Up @@ -123,6 +124,8 @@
playerImages: { [key: string]: string },
mostVotedPerson: string,
}) => {
const allEqual = (arr) => new Set(arr).size === 1;
setAllSameSelection(allEqual(Object.values(data.voteRecap)));
setVoteRecap(data.voteRecap);
setPlayerImages(data.playerImages);
setMostVotedPerson(data.mostVotedPerson);
Expand Down Expand Up @@ -240,7 +243,7 @@
<div className='label-container'>
<p>Inserisci una risposta</p>
</div>
<Timer duration={25} onTimeUp={handleTimeUpCostomWho} isActive={isTimerActive} />
<Timer duration={45} onTimeUp={handleTimeUpCostomWho} isActive={isTimerActive} />
</div>
<CustomAnswer handleSubmit={handleSubmit} />
</div>
Expand Down Expand Up @@ -285,8 +288,13 @@
<div className="result-message text-center">
<h4 style={{ textAlign: 'left' }}>{selectedPlayer ? question.replace('$', selectedPlayer) : question}</h4>
<p className="result-subtitle" style={{ textAlign: 'left' }}>
{mostVotedPerson === '' ? 'Pareggio!' : 'Scelta più votata:'}
{allSameSelection
? 'Tutti hanno votato:'
: mostVotedPerson === ''
? 'Pareggio!'
: `Scelta più votata: ${mostVotedPerson}`}
</p>

{isWho ? <h4>{mostVotedPerson}</h4> : ( // Da fixare, fa un pò cagare
isPhoto ?
<img
Expand Down
9 changes: 5 additions & 4 deletions Scoprimi/src/components/newGame/NewGameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ const NewGameModal: React.FC<NewGameModalProps> = ({ isOpen, onClose, playerName
/>
<button className="btn-change-value my-bg-quartary" onClick={increment}>+</button>
</div>
<p>Categoria domande:</p>
{/* <p>Categoria domande:</p> */}
{/* Render dinamico delle categorie con mappatura */}
<div className='mt-5'></div>
{categories.map((category, index) => (
<div className="switch-container" key={index}>
<span className="switch-label">{categoryLabels[category] || category}</span>
<label className="switch">
<input
type="checkbox"
Expand All @@ -150,15 +152,14 @@ const NewGameModal: React.FC<NewGameModalProps> = ({ isOpen, onClose, playerName
/>
<span className="slider round"></span>
</label>
<span className="switch-label">{categoryLabels[category] || category}</span>
</div>
))}
<div className='counter pt-3'>
<button onClick={handleCreateGame} className="my-btn my-bg-quartary">Crea</button>
<button onClick={handleCreateGame} style={{ paddingRight: '15vw', paddingLeft: '15vw' }} className="my-btn my-bg-quartary">Crea</button>
</div>
</div>
</div>
</div>
</div >
</>
);
};
Expand Down
4 changes: 2 additions & 2 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## v0.7.0

- [ ] Tutti hanno votato alice
- [x] Tutti hanno votato alice
- [ ] Switch a destra (impostazioni partita)
- [ ] Lunghezza pagina login (no scroll)
- [ ] Modalita con foto (va oltre le altre - meno padding)
- [x] Modalita con foto (va oltre le altre - meno padding)
- [ ] non riusare le domande (check)


Expand Down