set album color as img hover bg

This commit is contained in:
geoffrey45 2022-12-07 20:06:25 +03:00 committed by Mungai Njoroge
parent 92172fe1c0
commit 11951e396a

View File

@ -6,8 +6,14 @@
}" }"
class="album-card" class="album-card"
> >
<div class="with-img"> <div class="with-img rounded-sm no-scroll">
<img class="rounded-sm shadow-lg" :src="imguri + album.image" alt="" /> <div
class="gradient"
:style="{
background: `linear-gradient(to top, ${album.colors[0]} 20%, transparent)`,
}"
></div>
<img class="shadow-lg" :src="imguri + album.image" alt="" />
<PlayBtn <PlayBtn
:store="useAlbumStore" :store="useAlbumStore"
:source="playSources.album" :source="playSources.album"
@ -53,18 +59,34 @@ defineProps<{
gap: $small; gap: $small;
padding: $medium; padding: $medium;
border-radius: 1rem; border-radius: 1rem;
height: fit-content;
position: relative;
.with-img { .with-img {
position: relative; position: relative;
padding: 0;
img {
display: block;
}
.gradient {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
}
&:hover { &:hover {
.play-btn { .play-btn {
transform: translateY(0); transform: translateY(0);
opacity: 1; opacity: 1;
} }
img {
border-radius: 0 0 $medium $medium;
}
.gradient {
opacity: 1;
}
} }
} }