@@ -5,20 +5,22 @@ const Score = ({ score, target, round, turnScore }) => {
55 const matches = useMediaQuery ( '(max-width:900px)' ) ;
66 return (
77 < Box sx = { { width : matches ? '40vw' : 500 , display : 'flex' , flexDirection : 'row' , alignItems : 'flex-start' , justifyContent : 'space-between' , py : 1 , px : 2 , borderRadius : '8px' , border : '1px solid slategrey' , backgroundColor : 'whitesmoke' , minHeight : 70 } } >
8- < Box >
8+ < Box sx = { { maxWidth : '50%' , height : '100%' , display : 'flex' , flexDirection : 'column' , alignItems : 'flex-start' } } >
99 < Typography variant = 'overline' sx = { { fontFamily : 'Orbitron' } } > Round { round } </ Typography >
10- < Box sx = { { display : 'flex' , alignItems : 'center' } } >
11- < Typography variant = 'h4' sx = { { color : score >= target ? '#11adab' : ( score < 0 ? 'rgb(158, 8, 28)' : '#5a6363' ) , fontFamily : 'Orbitron' } } > { score } </ Typography >
12- {
13- turnScore != null && (
14- < Typography variant = 'h5' sx = { { ml : 1 , color : turnScore + score >= target ? '#11adab' : ( turnScore < 0 ? 'rgb(158, 8, 28)' : '#5a6363' ) , fontFamily : 'Orbitron' } } > { turnScore >= 0 ? '+' : '' } { turnScore } </ Typography >
15- )
16- }
10+ < Box sx = { { display : 'flex' , justifyContent : 'flex-start' , alignItems : 'center' , flexWrap : 'wrap ' } } >
11+ < Typography variant = 'h4' sx = { { mr : 1 , fontSize : matches ? ` ${ Math . max ( Math . min ( 30 / ( score ?. toString ( ) . length ?? 1 ) * 2 + 5 , 25 ) , 14 ) } px` : undefined , color : score >= target ? '#11adab' : ( score < 0 ? 'rgb(158, 8, 28)' : '#5a6363' ) , fontFamily : 'Orbitron' } } > { score } </ Typography >
12+ { /* {
13+ turnScore != null && ( */ }
14+ < Typography variant = 'h5' sx = { { fontSize : matches ? ` ${ Math . max ( Math . min ( 30 / ( turnScore ?. toString ( ) . length ?? 1 ) * 2 , 16 ) , 12 ) } px` : undefined , color : turnScore + score >= target ? '#11adab' : ( turnScore < 0 ? 'rgb(158, 8, 28)' : '#5a6363' ) , fontFamily : 'Orbitron' } } > { turnScore >= 0 ? '+' : '' } { turnScore } 100 </ Typography >
15+ { /* )
16+ } */ }
1717 </ Box >
1818 </ Box >
19- < Box className = "target" sx = { { display : 'flex' , flexDirection : 'column' , alignItems : 'center ' } } >
19+ < Box className = "target" sx = { { height : '100%' , display : 'flex' , flexDirection : 'column' , alignItems : 'flex-end ' } } >
2020 < Typography variant = 'overline' sx = { { fontFamily : 'Orbitron' } } > Target</ Typography >
21- < Typography variant = 'h6' sx = { { fontFamily : 'Orbitron' , color : '#11adab' } } > { target } </ Typography >
21+ < Box sx = { { display : 'flex' , alignItems : 'flex-start' , height : '100%' } } >
22+ < Typography variant = 'h6' sx = { { fontSize : matches ? `${ Math . max ( Math . min ( 30 / ( target ?. toString ( ) . length ?? 1 ) * 2 + 3 , 20 ) , 12 ) } px` : undefined , fontFamily : 'Orbitron' , color : '#11adab' } } > { target } </ Typography >
23+ </ Box >
2224 </ Box >
2325 </ Box >
2426 ) ;
0 commit comments