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-column: 7;
grid-row: 7; grid-row: 7;
} }
*/ */
.client {
background-color: black;
}

View File

@ -50,7 +50,7 @@ const Client = () => {
}, []) }, [])
return ( return (
<div> <div className="client">
<div style={{ display: "none", transform: "translate(-50%, 0)",position: "absolute", top: 10, left: "50%" }}> <div style={{ display: "none", transform: "translate(-50%, 0)",position: "absolute", top: 10, left: "50%" }}>
State: <pre>{JSON.stringify(state)}</pre> State: <pre>{JSON.stringify(state)}</pre>
ButtonMap: <pre>{mapToBitvector(buttonMap).map(s => s.toString()).join(" ")}</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> <span className="timer">{Math.round(state.timeUntilNextMode ?? 0)}s </span>
</div> </div>
<div className="voting"> <div className="voting">
{voteList.flatMap(([b, numVotes], index) => numVotes === 0 {voteList.flatMap(([b, numVotes], index) => {
? [ const percentage = numVotes === 0 ? "" : Math.round(numVotes / totalCount * 100) + "%";
<div className="vote" key={index}> return <div className="vote" key={index}>
<span>{b}</span><span></span> <span>{b}</span><span>{percentage}</span>
</div> </div>;
] })}
: [
<div className="vote" key={index}>
<span>{b}</span><span> {Math.round(numVotes / totalCount * 100) + "%"} </span>
</div>
]
)}
</div> </div>
<div> <div>
Current state: <pre> Current state: <pre>