Skip to content

Commit 2ae1d48

Browse files
committed
fix: ultra smooth
1 parent b76e1ce commit 2ae1d48

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

src/lib/components/general/FicsitCard.svelte

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,20 @@
7777
<div class="logo max-h-full min-h-full min-w-full max-w-full bg-neutral-500" />
7878
{:else}
7979
<img
80-
class="logo absolute max-h-full min-h-full min-w-full max-w-full"
81-
class:invisible={!imageLoaded}
80+
class="logo fade-in-image absolute max-h-full min-h-full min-w-full max-w-full"
81+
class:hidden={!imageLoaded}
8282
src={renderedLogo}
8383
alt="{renderedName} Logo"
8484
on:load={() => (imageLoaded = true)} />
8585
{#if !imageLoaded && thumbHashData}
8686
<img
87-
class="logo absolute max-h-full min-h-full min-w-full max-w-full bg-neutral-500"
88-
class:invisible={!thumbnailLoaded}
87+
class="logo fade-in-thumbhash absolute max-h-full min-h-full min-w-full max-w-full bg-neutral-500"
88+
class:hidden={!thumbnailLoaded}
8989
src={thumbHashData}
9090
alt="{renderedName} Logo"
9191
width="100%"
9292
on:load={() => (thumbnailLoaded = true)}
93+
in:fade={{ duration: 1000 }}
9394
out:fade={{ duration: 200, delay: 100 }} />
9495
{/if}
9596
{/if}
@@ -157,30 +158,19 @@
157158
}
158159
}
159160
160-
.elementToFadeInAndOut {
161-
width: 200px;
162-
height: 200px;
163-
background: red;
164-
-webkit-animation: fadeinout 4s linear forwards;
165-
animation: fadeinout 4s linear forwards;
161+
.fade-in-image {
162+
animation: fadeIn 200ms;
166163
}
167164
168-
@-webkit-keyframes fadeinout {
169-
0%,
170-
100% {
171-
opacity: 0;
172-
}
173-
50% {
174-
opacity: 1;
175-
}
165+
.fade-in-thumbhash {
166+
animation: fadeIn 1s;
176167
}
177168
178-
@keyframes fadeinout {
179-
0%,
180-
100% {
169+
@keyframes fadeIn {
170+
0% {
181171
opacity: 0;
182172
}
183-
50% {
173+
100% {
184174
opacity: 1;
185175
}
186176
}

0 commit comments

Comments
 (0)