1
1
<script >
2
- export let title, description, name, picture, winners, icon ;
2
+ export let title, description, name, picture, winners, icon;
3
3
function shortdesc (desc ){
4
4
return desc .length > 80 ? desc .slice (0 ,80 ) + ' ...' : desc;
5
5
}
6
6
console .log (picture)
7
7
</script >
8
8
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 " >
11
11
<h1 class ="font-bold text-2xl" >{title }: <span class ="font-semibold text-2xl text-blueberry-600" >{name }</span ></h1 >
12
-
13
12
</div >
14
13
15
- {#if picture !== ' na' }
14
+ {#if picture !== ' na' }
16
15
<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 "
18
17
style ="background-image: url( {picture });"
19
18
></div >
20
19
{/if }
21
20
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 " >
23
22
<svelte:component this ={icon } class =" text-blueberry-600 w-[100%] h-auto" />
24
23
</div >
25
24
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 >
29
28
</div >
30
-
31
29
</div >
30
+
32
31
<style >
33
32
/* Ensures that the winners and description are initially hidden */
34
33
.hidden {
35
34
display : none ;
36
35
}
37
-
38
36
</style >
0 commit comments