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:
@@ -4,10 +4,17 @@
|
||||
}
|
||||
|
||||
.header {
|
||||
position: relative;
|
||||
padding: 1.25rem 1.5rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.headerAction {
|
||||
position: absolute;
|
||||
top: 0.75rem;
|
||||
right: 1rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
@@ -43,3 +50,13 @@
|
||||
.footer {
|
||||
padding: 1rem 1.5rem 1.5rem;
|
||||
}
|
||||
|
||||
.overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
@@ -4,19 +4,23 @@ interface Props {
|
||||
title: string
|
||||
children: React.ReactNode
|
||||
footer?: React.ReactNode
|
||||
headerAction?: React.ReactNode
|
||||
overlay?: React.ReactNode
|
||||
}
|
||||
|
||||
export default function PageFrame({ title, children, footer }: Props) {
|
||||
export default function PageFrame({ title, children, footer, headerAction, overlay }: Props) {
|
||||
return (
|
||||
<div className={styles.frame}>
|
||||
<header className={styles.header}>
|
||||
<h1 className={styles.title}>{title}</h1>
|
||||
<div className={styles.rule} role="separator" />
|
||||
{headerAction && <div className={styles.headerAction}>{headerAction}</div>}
|
||||
</header>
|
||||
<div className={styles.content}>
|
||||
{children}
|
||||
</div>
|
||||
{footer && <div className={styles.footer}>{footer}</div>}
|
||||
{overlay && <div className={styles.overlay}>{overlay}</div>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.button {
|
||||
composes: pressable from '../styles/shared.module.css';
|
||||
width: 100%;
|
||||
padding: 1rem;
|
||||
background: var(--color-blue);
|
||||
|
||||
Reference in New Issue
Block a user