Skip to content

Commit 3551be4

Browse files
committed
Tweaks to display
1 parent a20994b commit 3551be4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

jam-25/src/components/Score.jsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
);

jam-25/src/components/Tray.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Tray = ({ tiles }) => {
66
const matches = useMediaQuery('(max-width: 900px)');
77
const { setNodeRef } = useDroppable({ id: 'tray' });
88
return (
9-
<Box className="tray" ref={setNodeRef} sx={{ mt: matches ? 1 : 'unset', order: matches ? 3 : 2, background: 'whitesmoke', display: 'flex', flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'center', borderRadius: '8px', border: '1px solid slategrey', p: matches ? 1 : 2, width: matches ? '100vw' : 400, minHeight: matches ? 100 : 120, flexWrap: 'wrap' }}>
9+
<Box className="tray" ref={setNodeRef} sx={{ mb: matches ? 4 : 0, mt: matches ? 1 : 'unset', order: matches ? 3 : 2, background: 'whitesmoke', display: 'flex', flexDirection: 'row', alignItems: 'flex-start', justifyContent: 'center', borderRadius: '8px', border: '1px solid slategrey', p: matches ? 1 : 2, width: matches ? '100vw' : 400, minHeight: matches ? 100 : 120, flexWrap: 'wrap' }}>
1010
{tiles}
1111
</Box>
1212
);

jam-25/src/routes/App.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ const App = () => {
291291
newTurnScore += score(newWords, i + 1);
292292
}, (scoreCount.current++) * 500));
293293
});
294-
} else {
295-
296294
}
297295
const newTotalScore = totalScore + newTurnScore;
298296
const getNewTotalScore = () => totalScore + newTurnScore;
@@ -911,7 +909,7 @@ const App = () => {
911909
</DialogContent>
912910
</Dialog>
913911
<DndContext onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
914-
<Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', mt: matches ? '200px' : "250px", mb: matches ? '260px' : undefined }}>
912+
<Box sx={{ display: 'flex', flexDirection: 'column', alignItems: 'center', mt: matches ? '200px' : "250px", mb: matches ? '300px' : undefined }}>
915913
<BlankPicker open={!!blankPickerOpen} handleClick={handleBlank} />
916914
{
917915
jokers?.length > 0 && (

0 commit comments

Comments
 (0)