Skip to content

Commit

Permalink
course review: restart celebration dance on click
Browse files Browse the repository at this point in the history
  • Loading branch information
jakmeier committed Sep 24, 2024
1 parent 00ef0de commit 248ab44
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bouncy_frontend/src/lib/components/ui/Explanation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,22 @@
}
}
}
function restartAnimation() {
const n = $beat - firstDancedBeat;
if (n > dancedBeats) {
firstDancedBeat = $beat + 2;
}
}
onMount(() => {
firstDancedBeat = $beat + 2;
});
</script>
<div class="explanation" style="width: {width}px">
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="explanation" style="width: {width}px" on:click={restartAnimation}>
<SpeechBubble
{text}
position="bottom"
Expand Down

0 comments on commit 248ab44

Please sign in to comment.