Skip to content

Commit 56bbe3d

Browse files
committed
updated winner transitions
1 parent e60cc23 commit 56bbe3d

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
11
<script>
2-
export let title, description, name, picture, winners, icon ;
2+
export let title, description, name, picture, winners, icon;
33
function shortdesc(desc){
44
return desc.length > 80 ? desc.slice(0,80) + '...' : desc;
55
}
66
console.log(picture)
77
</script>
88

9-
<div class="relative p-6 bg-blueberry-200 text-blackberry-800 rounded-2xl min-h-min h-[40vh] overflow-hidden flex flex-col justify-center items-center group transition-all duration-300">
10-
<div>
9+
<div class="relative p-6 bg-blueberry-200 text-blackberry-800 rounded-2xl min-h-[40vh] overflow-hidden flex flex-col justify-between group transition-all duration-1000 ease-in-out hover:min-h-[60vh]">
10+
<div class="z-10">
1111
<h1 class="font-bold text-2xl">{title}: <span class="font-semibold text-2xl text-blueberry-600">{name}</span></h1>
12-
1312
</div>
1413

15-
{#if picture !== 'na'}
14+
{#if picture !== 'na'}
1615
<div
17-
class="absolute inset-0 bg-center bg-cover opacity-10"
16+
class="absolute inset-0 bg-center bg-cover opacity-10 transition-opacity duration-1000 ease-in-out group-hover:opacity-5"
1817
style="background-image: url({picture});"
1918
></div>
2019
{/if}
2120

22-
<div class="z-10 w-[50%] h-[50%] flex justify-center items-center my-5 group-hover:hidden">
21+
<div class="z-10 w-[50%] h-[50%] flex justify-center items-center my-5 transition-all duration-1000 ease-in-out group-hover:h-[30%] group-hover:opacity-50">
2322
<svelte:component this={icon} class="text-blueberry-600 w-[100%] h-auto" />
2423
</div>
2524

26-
<div class="transition-all duration-300 hidden group-hover:block">
27-
<p class="mt-2"><strong>Winners:</strong> {winners}</p>
28-
<p class="mt-2"><strong>Description:</strong> {description}</p>
25+
<div class="z-20 bg-blueberry-200 transition-all duration-1000 ease-in-out max-h-0 group-hover:max-h-[1000px] overflow-hidden">
26+
<p class="mt-2 transform translate-y-full transition-transform duration-1000 ease-in-out group-hover:translate-y-0"><strong>Winners:</strong> {winners}</p>
27+
<p class="mt-2 transform translate-y-full transition-transform duration-1000 ease-in-out group-hover:translate-y-0"><strong>Description:</strong> {description}</p>
2928
</div>
30-
3129
</div>
30+
3231
<style>
3332
/* Ensures that the winners and description are initially hidden */
3433
.hidden {
3534
display: none;
3635
}
37-
3836
</style>

0 commit comments

Comments
 (0)