Skip to content

Commit

Permalink
fix: fix transition logic for svelte 4 (#220)
Browse files Browse the repository at this point in the history
update transition logic for svelte 4
  • Loading branch information
KTibow authored Jan 11, 2024
1 parent 66bb4b1 commit c90201f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/layout/Footer/FooterSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/>
</button>
{#if expanded}
<ul transition:slide|local={{ easing: quintOut, duration: 500 }}>
<ul transition:slide={{ easing: quintOut, duration: 500 }}>
<slot />
</ul>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
alt="Clear"
on:click={clear}
on:keypress={clear}
transition:fade|local={{ easing: quintOut, duration: 250 }}
transition:fade={{ easing: quintOut, duration: 250 }}
/>
{/if}
<input
Expand Down
6 changes: 2 additions & 4 deletions src/lib/components/Snackbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { expoOut } from 'svelte/easing';
export let open = false;
export let closeIcon = false;
export let dismissTime = 3000;
let timeout: ReturnType<typeof setTimeout>;
Expand All @@ -16,9 +15,8 @@
{#if open}
<div
class="snackbar"
class:closeIcon
in:slide|local={{ duration: 400, easing: expoOut }}
out:fade|local={{ duration: 300, easing: expoOut }}
in:slide={{ duration: 400, easing: expoOut }}
out:fade={{ duration: 300, easing: expoOut }}
>
<div class="text">
<slot name="text" />
Expand Down
6 changes: 1 addition & 5 deletions src/lib/components/Spinner.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<script>
import { fade } from 'svelte/transition';
</script>

<div class="spinner" transition:fade={{ duration: 250 }} />
<div class="spinner" />

<style>
@keyframes spinner {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/contributors/ContributorSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</div>

{#if expanded}
<div class="contrib-host" transition:slide|local={{ easing: quintOut, duration: 500 }}>
<div class="contrib-host" transition:slide={{ easing: quintOut, duration: 500 }}>
{#each contributors as { login, avatar_url, html_url }}
{#if !usersIwantToExplodeSoBadly.includes(login)}
<ContributorButton name={login} pfp={avatar_url} url={html_url} />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/donate/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
</svelte:fragment>
</Dialogue>

<Snackbar bind:open={addressSnackbar} closeIcon>
<Snackbar bind:open={addressSnackbar}>
<svelte:fragment slot="text">Address copied to clipboard</svelte:fragment>
</Snackbar>

Expand Down
4 changes: 2 additions & 2 deletions src/routes/donate/TeamMember.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
href={member.html_url}
rel="noreferrer"
target="_blank"
in:fly={{ y: 10, easing: quintOut, duration: 750, delay: 50 * i }}
in:fly|global={{ y: 10, easing: quintOut, duration: 750, delay: 50 * i }}
>
<img src={member.avatar_url} alt={`${member.login}'s profile picture.'`} />
<img src={member.avatar_url} alt="{member.login}'s profile picture." />

<div class="member-text">
<h4>{member.login}</h4>
Expand Down
6 changes: 3 additions & 3 deletions src/routes/patches/PatchItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
</ul>

{#if expanded && hasPatchOptions}
<span transition:fade|local={{ easing: quintOut, duration: 1000 }}>
<div class="options" transition:slide|local={{ easing: quintOut, duration: 500 }}>
<span transition:fade={{ easing: quintOut, duration: 1000 }}>
<div class="options" transition:slide={{ easing: quintOut, duration: 500 }}>
{#each patch.options as option}
<div class="option">
<h5 id="option-title">{option.title}</h5>
Expand Down Expand Up @@ -125,7 +125,7 @@
display: flex;
align-items: center;
}
.patch-info {
display: flex;
justify-content: center;
Expand Down

0 comments on commit c90201f

Please sign in to comment.