Add Word Wrangler demos

This commit is contained in:
Mark Backman
2025-04-24 14:29:19 -04:00
parent 09ff836ef6
commit c80d09f66c
54 changed files with 12209 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { GAME_CONFIG, GAME_STATES } from "@/constants/gameConstants";
import { formatTime } from "@/utils/formatTime";
import { IconStopwatch } from "@tabler/icons-react";
import styles from "./WordWrangler.module.css";
interface TimerProps {
timeLeft: number;
gameState: string;
}
export function Timer({ timeLeft, gameState }: TimerProps) {
const lowTimer =
gameState === GAME_STATES.ACTIVE &&
timeLeft <= GAME_CONFIG.LOW_TIME_WARNING;
return (
<div className={`${styles.timer} ${lowTimer ? styles.lowTime : ""}`}>
<div className={styles.timerBadge}>
<IconStopwatch size={24} />
<span>{formatTime(timeLeft)}</span>
</div>
<div className={styles.timerBar}>
<div
className={styles.timerBarFill}
style={{ width: `${(timeLeft / GAME_CONFIG.GAME_DURATION) * 100}%` }}
/>
</div>
</div>
);
}