refactor: simplify cards

This commit is contained in:
Phan An 2022-07-22 16:25:30 +02:00
parent 200a73ee41
commit f9f21ce654
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
5 changed files with 7 additions and 19 deletions

View file

@ -11,9 +11,7 @@
@dragstart="dragStart"
@contextmenu.prevent="requestContextMenu"
>
<span class="thumbnail-wrapper" :style="{ backgroundImage: `url(${defaultCover})` }">
<AlbumThumbnail :entity="album"/>
</span>
<AlbumThumbnail :entity="album"/>
<footer>
<a :href="`#!/album/${album.id}`" class="name" data-testid="name">{{ album.name }}</a>
@ -58,7 +56,7 @@
<script lang="ts" setup>
import { faDownload, faRandom } from '@fortawesome/free-solid-svg-icons'
import { computed, toRef, toRefs } from 'vue'
import { defaultCover, eventBus, pluralize, secondsToHis, startDragging } from '@/utils'
import { eventBus, pluralize, secondsToHis, startDragging } from '@/utils'
import { albumStore, artistStore, commonStore, songStore } from '@/stores'
import { downloadService, playbackService } from '@/services'

View file

@ -11,9 +11,7 @@
@dragstart="dragStart"
@contextmenu.prevent="requestContextMenu"
>
<span class="thumbnail-wrapper">
<ArtistThumbnail :entity="artist"/>
</span>
<ArtistThumbnail :entity="artist"/>
<footer>
<div class="info">

View file

@ -101,8 +101,8 @@ article {
}
.cover {
flex: 0 0 48px;
height: 48px;
width: 48px;
aspect-ratio: 1/1;
background-size: cover;
position: relative;
border-radius: 4px;

View file

@ -122,6 +122,7 @@ const onDrop = async (event: DragEvent) => {
.cover {
position: relative;
width: 100%;
aspect-ratio: 1/1;
display: block;
background-repeat: no-repeat;
background-size: cover;

View file

@ -36,15 +36,6 @@
flex-direction: column;
gap: 1.5rem;
.thumbnail-wrapper {
overflow: hidden;
border-radius: 8px;
display: block;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
@media only screen and (max-width: 768px) {
max-width: 100%;
}
@ -65,7 +56,7 @@
padding: 10px;
border-radius: 5px;
.thumbnail-wrapper {
.cover {
width: 80px;
border-radius: 5px;
}