Implement scoresheet page with scoring logic and confirmation dialog
- Add src/game/scoring.ts with computeRunningTotals and isGameOver - Build ScoreSheet grid: player columns, per-round scores, running totals after round 2+ - Small red "New Game" button in header top-right with full-screen confirmation overlay - Extend PageFrame with headerAction and overlay props - Move press animation/shadow from .pressable class to global button selector Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
.tableWrapper {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
margin: 0 -1.5rem;
|
||||
padding: 0 1.5rem;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: 5rem repeat(var(--player-count), 1fr);
|
||||
width: max-content;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.headerCell {
|
||||
padding: 0.5rem 0.4rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.8rem;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
border-bottom: 1px solid var(--color-parchment-border);
|
||||
}
|
||||
|
||||
.labelCell {
|
||||
padding: 0.35rem 0.4rem;
|
||||
font-size: 0.75rem;
|
||||
color: #666;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.scoreCell {
|
||||
padding: 0.35rem 0.4rem;
|
||||
text-align: right;
|
||||
font-size: 0.95rem;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.totalCell {
|
||||
padding: 0.35rem 0.4rem;
|
||||
text-align: right;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.divider {
|
||||
border-top: 1px solid var(--color-parchment-border);
|
||||
}
|
||||
|
||||
/* Small red "New Game" button in header top-right */
|
||||
.newGameBtn {
|
||||
background: #d94f4f;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
min-height: unset;
|
||||
padding: 0.25rem 0.5rem;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
/* Confirmation overlay content */
|
||||
.confirmContent {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 1.5rem;
|
||||
padding: 2rem;
|
||||
background: var(--color-parchment);
|
||||
border: 2px solid black;
|
||||
border-radius: 1.5rem;
|
||||
width: calc(100% - 4rem);
|
||||
max-width: 20rem;
|
||||
}
|
||||
|
||||
.confirmText {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.confirmButtons {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
max-width: 16rem;
|
||||
}
|
||||
|
||||
.cancelBtn {
|
||||
flex: 1;
|
||||
background: white;
|
||||
border: 2px solid var(--color-parchment-border);
|
||||
border-radius: 0.75rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.endGameBtn {
|
||||
flex: 1;
|
||||
background: #d94f4f;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 0.75rem;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
Reference in New Issue
Block a user