fix(style): track row

This commit is contained in:
ArneBo 2025-02-23 03:08:19 +01:00
parent 08fae09a6d
commit 7e268a748d
3 changed files with 69 additions and 70 deletions

View File

@ -15,6 +15,7 @@ import PlayButton from '~/components/audio/PlayButton.vue'
import Button from '~/components/ui/Button.vue' import Button from '~/components/ui/Button.vue'
const store = useStore() const store = useStore()
interface Props extends PlayOptionsProps { interface Props extends PlayOptionsProps {
@ -66,15 +67,15 @@ const hover = ref(false)
<template> <template>
<div <div
:class="[{ active }, 'track-row row', $style.row]" :class="[{ active }, 'track-row row', $style.row]"
style="display: contents;"
@dblclick="activateTrack(track, index)" @dblclick="activateTrack(track, index)"
@mousemove="hover = true" @mousemove="hover = true"
@mouseout="hover = false" @mouseout="hover = false"
style="display: contents;"
> >
<!-- 1. column: Play button or track position --> <!-- 1. column: Play button or track position -->
<div <div
class="one wide column" class="actions one wide left floated column"
role="button" role="button"
@click.prevent.exact="activateTrack(track, index)" @click.prevent.exact="activateTrack(track, index)"
> >
@ -92,8 +93,8 @@ const hover = ref(false)
active && active &&
!hover !hover
" "
:icon="isPlaying && active && hover ? 'bi-play-fill' : 'bi-pause-fill'" ghost
:class="[{ paused: isPlaying && active && hover }, 'ui', 'play-button']" icon="bi-play-fill"
/> />
<Button <Button
v-else-if=" v-else-if="
@ -101,13 +102,13 @@ const hover = ref(false)
active && active &&
hover hover
" "
ghost
icon="bi-pause-fill" icon="bi-pause-fill"
class="ui play-button"
/> />
<Button <Button
v-else-if="hover" v-else-if="hover"
ghost
icon="bi-play-fill" icon="bi-play-fill"
class="ui play-button"
/> />
<span <span
v-else-if="showPosition" v-else-if="showPosition"
@ -117,10 +118,8 @@ const hover = ref(false)
</span> </span>
</div> </div>
<!-- 2. column: Cover art or nothing -->
<div <div
class="image column" class="image left floated column"
role="button" role="button"
@click.prevent.exact="activateTrack(track, index)" @click.prevent.exact="activateTrack(track, index)"
> >
@ -144,67 +143,62 @@ const hover = ref(false)
> >
</div> </div>
<!-- third column: title ! --> <div
<div tabindex="0"
tabindex="0" class="content ellipsis column left floated column"
class="content ellipsis column"
>
<a
@click="activateTrack(track, index)"
> >
{{ track.title }} <a
</a> @click="activateTrack(track, index)"
</div> >
{{ track.title }}
</a>
</div>
<!-- 4. column: album link --> <div
class="content ellipsis left floated column"
<div
class="content ellipsis column"
>
<router-link
v-if="showAlbum"
:to="{ name: 'library.albums.detail', params: { id: track.album?.id } }"
>
{{ track.album?.title }}
</router-link>
</div>
<!-- 5. column: artist link -->
<div
class="content ellipsis column"
>
<template
v-for="ac in track.artist_credit"
v-if="showArtist"
:key="ac.artist.id"
> >
<router-link <router-link
class="artist link" v-if="showAlbum"
:to="{ :to="{ name: 'library.albums.detail', params: { id: track.album?.id } }"
name: 'library.artists.detail',
params: { id: ac.artist?.id },
}"
> >
{{ ac.credit }} {{ track.album?.title }}
</router-link> </router-link>
<span>{{ ac.joinphrase }}</span> </div>
</template>
</div>
<!-- 6. column: favorite icon --> <div
<div class="content ellipsis left floated column"
class="meta column" >
> <template
<track-favorite-icon v-if="showArtist"
v-if="store.state.auth.authenticated" v-for="ac in track.artist_credit"
ghost :key="ac.artist.id"
:track="track" >
/> <router-link
</div> class="artist link"
:to="{
name: 'library.artists.detail',
params: { id: ac.artist?.id },
}"
>
{{ ac.credit }}
</router-link>
<span>{{ ac.joinphrase }}</span>
</template>
</div>
<div
class="meta right floated column"
>
<track-favorite-icon
v-if="store.state.auth.authenticated"
ghost
:track="track"
/>
</div>
<!-- 7. column: duration -->
<div <div
class="meta column" class="meta right floated column"
> >
<human-duration <human-duration
v-if="showDuration && track.uploads[0] && track.uploads[0].duration" v-if="showDuration && track.uploads[0] && track.uploads[0].duration"
@ -212,15 +206,16 @@ const hover = ref(false)
/> />
</div> </div>
<!-- 8. column: play button dropdown menu -->
<div <div
v-if="displayActions" v-if="displayActions"
class="meta column" class="meta right floated column"
> >
<PlayButton <PlayButton
:dropdown-only="true" :dropdown-only="true"
:is-playable="track.is_playable" :is-playable="track.is_playable"
:track="track" :track="track"
class="ui floating dropdown"
ghost
/> />
</div> </div>
</div> </div>

View File

@ -19,6 +19,10 @@
&:last-child { &:last-child {
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
} }
.meta.column > time {
position: relative;
top: 14px;
}
} }
.track-row, .track-row,
@ -68,9 +72,6 @@
.track_image { .track_image {
height: 40px; height: 40px;
} }
.image.left.floated.column {
}
} }
.track-row { .track-row {
@ -88,6 +89,10 @@
align-items: center; align-items: center;
display: flex; display: flex;
&:hover {
background: rgba(155, 155, 155, 0.1);
}
> div { > div {
margin-right: 0.25em; margin-right: 0.25em;
} }
@ -170,15 +175,14 @@
.track-position { .track-position {
cursor: pointer; cursor: pointer;
display: contents; display: inline;
min-height: 1em; min-height: 1em;
outline: none; outline: none;
border: none; border: none;
vertical-align: baseline; vertical-align: baseline;
font-family: var(--font-family); font-family: var(--font-family);
margin: 0 0.25em 0 0;
line-height: 1em; line-height: 1em;
padding: 0.5rem; padding: 12px;
user-select: none; user-select: none;
.mobile span { .mobile span {

View File

@ -244,7 +244,7 @@ const deletePlaylist = async () => {
</template> </template>
<template v-else-if="tracks.length > 0"> <template v-else-if="tracks.length > 0">
<track-table <track-table
:display-position="true" :show-position="true"
:tracks="tracks" :tracks="tracks"
:unique="false" :unique="false"
/> />