fix: kickoff time centered without 'Uhr', unified countdown badge, DevPanel close button
- Kickoff: centered "21:00" above flags (no 'Uhr' suffix) - Countdown: always rendered as badge (was unstyled span for <60min) - DevPanel: added close button (✕) in panel header for reliable closing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,23 @@
|
||||
padding: 12px 16px;
|
||||
background: rgba(254,174,50,0.08);
|
||||
border-bottom: 1px solid rgba(254,174,50,0.15);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.closeBtn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-muted);
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.closeBtn:hover {
|
||||
background: rgba(255,255,255,0.1);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.panelTitle {
|
||||
|
||||
@@ -131,6 +131,7 @@ export default function DevPanel({ currentUser, onUserChange, matches, onRefresh
|
||||
<div className={styles.panel}>
|
||||
<div className={styles.panelHeader}>
|
||||
<span className={styles.panelTitle}>🧪 Simulations-Modus</span>
|
||||
<button className={styles.closeBtn} onClick={() => setOpen(false)}>✕</button>
|
||||
</div>
|
||||
|
||||
{/* User Switcher */}
|
||||
|
||||
@@ -77,12 +77,17 @@
|
||||
border: 1px solid rgba(75,183,248,0.15);
|
||||
}
|
||||
|
||||
/* Kickoff badge in header row */
|
||||
.kickoffBadge {
|
||||
font-size: 12px;
|
||||
/* Kickoff time — centered above flags */
|
||||
.kickoffRow {
|
||||
text-align: center;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.kickoffTime {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--text-secondary);
|
||||
letter-spacing: 0.02em;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.topRowSpacer {
|
||||
|
||||
@@ -47,17 +47,7 @@ const STATUS_LABELS: Record<string, string> = {
|
||||
function formatKickoff(utcDate: string): string {
|
||||
return new Date(utcDate).toLocaleString('de-DE', {
|
||||
hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Berlin',
|
||||
}) + ' Uhr';
|
||||
}
|
||||
|
||||
function CountdownBadge({ minutes }: { minutes: number }) {
|
||||
if (minutes <= 0) return null;
|
||||
if (minutes < 60) return <span className={styles.badgeUrgent}>⚡ in {minutes} Min.</span>;
|
||||
const h = Math.floor(minutes / 60);
|
||||
const m = minutes % 60;
|
||||
if (h < 24) return <span className={styles.badge}>in {h}h{m > 0 ? ` ${m}m` : ''}</span>;
|
||||
const d = Math.floor(h / 24);
|
||||
return <span className={styles.badge}>in {d} Tag{d > 1 ? 'en' : ''}</span>;
|
||||
});
|
||||
}
|
||||
|
||||
function FlagBox({ crest, name }: { crest: string | null; name: string }) {
|
||||
@@ -94,7 +84,7 @@ export default function MatchCard({ match, onTip }: Props) {
|
||||
return (
|
||||
<div className={`card ${styles.card} ${styles[`card_${state}`]} ${isLive ? styles.live : ''} ${glowClass}`}>
|
||||
|
||||
{/* Top row: Group + Kickoff + Countdown */}
|
||||
{/* Top row: Group + Countdown */}
|
||||
<div className={styles.topRow}>
|
||||
{(isLive || isFinished) && (
|
||||
<span className={`${styles.status} ${isLive ? styles.statusLive : ''}`}>
|
||||
@@ -107,21 +97,29 @@ export default function MatchCard({ match, onTip }: Props) {
|
||||
{match.group.replace('GROUP_', 'Gruppe ')}
|
||||
</span>
|
||||
)}
|
||||
{!isFinished && !isLive && (
|
||||
<span className={styles.kickoffBadge}>{formatKickoff(match.utcDate)}</span>
|
||||
)}
|
||||
<span className={styles.topRowSpacer} />
|
||||
{(state === 'open' || state === 'tipped') && match.tippable && (
|
||||
match.minutesUntilKickoff < 60 ? (
|
||||
<span className={`${styles.countdown} ${remainingMins < 5 ? styles.countdownUrgent : ''}`}>
|
||||
Noch {remainingMins} Min!
|
||||
</span>
|
||||
) : (
|
||||
<CountdownBadge minutes={match.minutesUntilKickoff} />
|
||||
)
|
||||
<span className={`${styles.badge} ${remainingMins < 60 ? styles.badgeUrgent : ''} ${remainingMins < 5 ? styles.countdownUrgent : ''}`}>
|
||||
{match.minutesUntilKickoff < 60
|
||||
? `Noch ${remainingMins} Min!`
|
||||
: (() => {
|
||||
const h = Math.floor(match.minutesUntilKickoff / 60);
|
||||
if (h < 24) return `in ${h}h`;
|
||||
const d = Math.floor(h / 24);
|
||||
return `in ${d} Tag${d > 1 ? 'en' : ''}`;
|
||||
})()
|
||||
}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Kickoff time — centered above flags */}
|
||||
{!isFinished && !isLive && (
|
||||
<div className={styles.kickoffRow}>
|
||||
<span className={styles.kickoffTime}>{formatKickoff(match.utcDate)}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Teams + Score */}
|
||||
<div className={styles.matchRow}>
|
||||
{/* Home */}
|
||||
|
||||
Reference in New Issue
Block a user