Skip to content

Commit

Permalink
style: 💄 tweak fade (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskaransarkaria authored Jan 5, 2024
1 parent 400d8ce commit 39edeea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ body {
display: flex;
flex-direction: column;
}

@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
11 changes: 7 additions & 4 deletions src/lib/components/Hex/Hex.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,20 @@
{#key loaded}
{#if imgError}
<img
in:fade={{ duration: 700, delay: 200 }}
src="grey_square.png"
on:error={() => (imgError = true)}
src="/grey_square.png"
alt={`category ${category.Name}`}
data-testid="cdn-img"
class="hex-img"
/>
{:else}
<img
in:fade={{ duration: 700, delay: 200 }}
src={`${PUBLIC_BUCKET_URL}/${category.Description}${
isAvifSupported ? "-avif" : ""
}`}
on:error={() => (imgError = true)}
alt={`category ${category.Name}`}
data-testid="cdn-img"
class="hex-img"
/>
{/if}
<img
Expand Down Expand Up @@ -124,6 +123,10 @@
font-family: "Welcomehome5 Regular";
}
.hex-img {
animation: fadeIn 1.25s;
}
h3 {
position: absolute;
width: 95%;
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/SwipeImage/SwipeImage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
img {
max-width: 95%;
max-height: 95%;
animation: fadeIn 0.6s;
}
.single-img-container {
Expand Down
2 changes: 2 additions & 0 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
margin-right: 0;
background-position: center; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
animation: fadeIn 0.8s;
}
.mobile-container {
Expand Down Expand Up @@ -137,6 +138,7 @@
z-index: -1;
width: 100%;
height: auto;
animation: fadeIn 0.8s;
}
.mobile-classes-img,
Expand Down

0 comments on commit 39edeea

Please sign in to comment.