Skip to content

Commit

Permalink
Tweak dialog animation & automatically open invite link on host
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahFu committed May 28, 2024
1 parent be5af91 commit f638184
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
let gameType: 'single' | 'host' | 'client' | undefined = joinId ? 'client' : undefined;
let id = joinId || '';
let inviteOpen = false;
const [themeSetting, themeValue] = theme()
Expand All @@ -26,6 +28,7 @@
function host() {
gameType = 'host'
id = genBaseId()
setTimeout(() => inviteOpen = true, 800)
}
function exit() {
Expand Down Expand Up @@ -61,7 +64,7 @@
{/if}
<Sidebar bind:theme={$themeSetting} on:exit={exit}>
{#if gameType === 'host'}
<InviteButton {id} link={createLink(id)} />
<InviteButton {id} link={createLink(id)} bind:open={inviteOpen} />
{/if}
</Sidebar>
</section>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Dialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</script>

{#if open}
<dialog bind:this={dialog} on:cancel|preventDefault transition:scale>
<dialog bind:this={dialog} on:cancel|preventDefault transition:scale={{start: 0.7}}>
<button on:click={exit}>
<CloseIcon class="close-icon" />
</button>
Expand Down

0 comments on commit f638184

Please sign in to comment.