@@ -14,19 +14,19 @@ type OthelloLog = { action: 'play' | 'skip'; time: string; turn: 'W' | 'B'; ctx:
1414type Board = ( null | 'W' | 'B' ) [ ] [ ] ;
1515type GameState = { board : Board ; sinceLast : number | null ; at : Date ; score : { W : number ; B : number } } ;
1616
17- const roundStyles = { height : 24 , width : 24 , display : 'inline-block' , borderRadius : 100 , marginLeft : 3 , marginTop : 3 } ;
18-
1917const Cell : CellRenderer < 'W' | 'B' | null > = ( { cell } ) => (
20- < td style = { { height : 30 , width : 30 , background : ' green' , borderCollapse : ' collapse' , border : '1px solid black' } } >
21- { cell ? < span style = { { ... roundStyles , background : cell === 'W' ? 'white' : 'black' } } /> : null }
18+ < td className = "h-8 w-8 bg- green-600 border- collapse border border-primary leading-0" >
19+ { cell ? < span className = { ` ${ cell === 'W' ? 'bg- white' : 'bg- black' } h-7 w-7 inline-block rounded-full m-0.5` } /> : null }
2220 </ td >
2321) ;
2422const Board = memo ( ( { state } : { state : GameState } ) => (
2523 < >
2624 < Table < 'W' | 'B' | null > board = { state . board } rowLabel = "1-9" colLabel = "A-Z" Cell = { Cell } />
27- { state . sinceLast
28- ? `Played after ${ state . sinceLast / 1000 } s.`
29- : `Game started on ${ state . at . toDateString ( ) } at ${ state . at . toLocaleTimeString ( ) } .` }
25+ < span className = "text-secondary" >
26+ { state . sinceLast
27+ ? `Played after ${ state . sinceLast / 1000 } s.`
28+ : `Game started on ${ state . at . toDateString ( ) } at ${ state . at . toLocaleTimeString ( ) } .` }
29+ </ span >
3030 </ >
3131) ) ;
3232
@@ -83,17 +83,17 @@ const BoardWrapper = memo(({ states, game }: { states: GameState[]; game: GameMo
8383 ) ;
8484
8585 return (
86- < div style = { { display : ' flex' , flexDirection : 'column' , maxWidth : 800 , alignItems : ' center' } } >
86+ < div className = "flex flex-col items- center max-w-3xl m-10" >
8787 < h1 >
88- { game . players . B . name } (Black) vs { game . players . W . name } (White) < small style = { { color : 'dimgray' } } > in { game . room } </ small >
88+ { game . players . B . name } (Black) vs { game . players . W . name } (White) < small className = "text-secondary" > in { game . room } </ small >
8989 </ h1 >
90- < h2 > { subHeading } </ h2 >
90+ < h2 className = "text-secondary" > { subHeading } </ h2 >
9191 < br />
92- < h2 style = { currentTurn === 0 ? { color : 'dimgray' } : { } } > { currentTurn === 0 ? 'Game start' : `Turn #${ currentTurn } ` } </ h2 >
92+ < h2 className = { currentTurn === 0 ? 'text-secondary' : '' } > { currentTurn === 0 ? 'Game start' : `Turn #${ currentTurn } ` } </ h2 >
9393 { controls }
9494 < Board state = { state } />
9595 { controls }
96- < b style = { { margin : 10 } } >
96+ < b className = "m-3" >
9797 Score: { state . score . B } (Black) - { state . score . W } (White)
9898 </ b >
9999 </ div >
0 commit comments