feat: show current game mode
This commit is contained in:
@ -1,22 +1,13 @@
|
||||
<script lang="ts">
|
||||
const { onClick } = $props();
|
||||
const { lastMode, onClick }: { lastMode: string; onClick: (arg0: string) => void } = $props();
|
||||
</script>
|
||||
|
||||
<div class="flex justify-center space-x-2">
|
||||
<button
|
||||
class="cursor-pointer rounded-full bg-cyan-500 px-4 py-2 text-sm text-white"
|
||||
onclick={() => onClick('reset')}>Reset</button
|
||||
>
|
||||
<button
|
||||
class="cursor-pointer rounded-full bg-cyan-500 px-4 py-2 text-sm text-white"
|
||||
onclick={() => onClick('easy')}>Easy</button
|
||||
>
|
||||
<button
|
||||
class="cursor-pointer rounded-full bg-cyan-500 px-4 py-2 text-sm text-white"
|
||||
onclick={() => onClick('medium')}>Medium</button
|
||||
>
|
||||
<button
|
||||
class="cursor-pointer rounded-full bg-cyan-500 px-4 py-2 text-sm text-white"
|
||||
onclick={() => onClick('hard')}>Hard</button
|
||||
>
|
||||
{#each ['reset', 'easy', 'medium', 'hard'] as mode (mode)}
|
||||
<button
|
||||
class="cursor-pointer rounded-full bg-cyan-500 px-4 py-2 text-sm text-white capitalize"
|
||||
class:bg-cyan-800={lastMode === mode}
|
||||
onclick={() => onClick(mode)}>{mode}</button
|
||||
>
|
||||
{/each}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user