feat(opord): add draining timer bar to the 2s unlock countdown
This commit is contained in:
parent
246a5796f8
commit
840bc27646
1 changed files with 11 additions and 3 deletions
|
|
@ -655,9 +655,17 @@ export function OpordGame({
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{unlockRemainingMs > 0 && lastAnswerWasCorrect === null && (
|
{unlockRemainingMs > 0 && lastAnswerWasCorrect === null && (
|
||||||
<p className="font-mono text-xs uppercase tracking-wider text-muted-foreground">
|
<div className="mx-auto w-full max-w-xs space-y-1">
|
||||||
|
<p className="text-center font-mono text-xs uppercase tracking-wider text-muted-foreground">
|
||||||
Answering opens in {Math.ceil(unlockRemainingMs / 1000)}s
|
Answering opens in {Math.ceil(unlockRemainingMs / 1000)}s
|
||||||
</p>
|
</p>
|
||||||
|
<div className="h-1 w-full overflow-hidden rounded-full bg-muted">
|
||||||
|
<div
|
||||||
|
className="h-full rounded-full bg-amber-400 transition-[width] duration-100 ease-linear"
|
||||||
|
style={{ width: `${(unlockRemainingMs / QUESTION_UNLOCK_DELAY_MS) * 100}%` }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<p className="text-center text-lg font-semibold">{question.prompt}</p>
|
<p className="text-center text-lg font-semibold">{question.prompt}</p>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue