Update shit

This commit is contained in:
Dominic Zimmer 2022-10-28 18:27:50 +02:00
parent e9a55080bd
commit 003f9eb41c
3 changed files with 12 additions and 14 deletions

View File

@ -151,4 +151,8 @@
grid-column: 7;
grid-row: 7;
}
*/
*/
.client {
background-color: black;
}

View File

@ -50,7 +50,7 @@ const Client = () => {
}, [])
return (
<div>
<div className="client">
<div style={{ display: "none", transform: "translate(-50%, 0)",position: "absolute", top: 10, left: "50%" }}>
State: <pre>{JSON.stringify(state)}</pre>
ButtonMap: <pre>{mapToBitvector(buttonMap).map(s => s.toString()).join(" ")}</pre>

View File

@ -39,18 +39,12 @@ const TVMode = () => {
<span className="timer">{Math.round(state.timeUntilNextMode ?? 0)}s </span>
</div>
<div className="voting">
{voteList.flatMap(([b, numVotes], index) => numVotes === 0
? [
<div className="vote" key={index}>
<span>{b}</span><span></span>
</div>
]
: [
<div className="vote" key={index}>
<span>{b}</span><span> {Math.round(numVotes / totalCount * 100) + "%"} </span>
</div>
]
)}
{voteList.flatMap(([b, numVotes], index) => {
const percentage = numVotes === 0 ? "" : Math.round(numVotes / totalCount * 100) + "%";
return <div className="vote" key={index}>
<span>{b}</span><span>{percentage}</span>
</div>;
})}
</div>
<div>
Current state: <pre>