[web] Fix icon when track is not playable

Spotify tracks that are not playable have now a "not allowed" cursor when hovered.
Moreover, the Bulma CSS class is now used for clickable items instead of a custom one.
This commit is contained in:
Alain Nussbaumer 2023-06-10 19:22:29 +02:00
parent 6a2f85e04f
commit bbe29a7a63
26 changed files with 45 additions and 45 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,11 +13,11 @@
:artwork_url="album.item.artwork_url" :artwork_url="album.item.artwork_url"
:artist="album.item.artist" :artist="album.item.artist"
:album="album.item.name" :album="album.item.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-small-image" class="is-clickable fd-has-shadow fd-cover fd-cover-small-image"
@click="show_album_details_modal = true" @click="show_album_details_modal = true"
/> />
</div> </div>
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<div style="margin-top: 0.7rem"> <div style="margin-top: 0.7rem">
<h1 class="title is-6" v-text="album.item.name" /> <h1 class="title is-6" v-text="album.item.name" />
<h2 class="subtitle is-7 has-text-grey"> <h2 class="subtitle is-7 has-text-grey">

View File

@ -14,7 +14,7 @@
class="media" class="media"
@click="open_artist(artist.item)" @click="open_artist(artist.item)"
> >
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 class="title is-6" v-text="artist.item.name" /> <h1 class="title is-6" v-text="artist.item.name" />
</div> </div>
<div class="media-right"> <div class="media-right">

View File

@ -14,7 +14,7 @@
class="media" class="media"
@click="open_composer(composer.item)" @click="open_composer(composer.item)"
> >
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 class="title is-6" v-text="composer.item.name" /> <h1 class="title is-6" v-text="composer.item.name" />
</div> </div>
<div class="media-right"> <div class="media-right">

View File

@ -4,12 +4,12 @@
class="media" class="media"
@click="open_parent_directory()" @click="open_parent_directory()"
> >
<figure class="media-left fd-has-action"> <figure class="media-left is-clickable">
<span class="icon" <span class="icon"
><mdicon name="subdirectory-arrow-left" size="16" ><mdicon name="subdirectory-arrow-left" size="16"
/></span> /></span>
</figure> </figure>
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 class="title is-6">..</h1> <h1 class="title is-6">..</h1>
</div> </div>
<div class="media-right"> <div class="media-right">
@ -18,10 +18,10 @@
</div> </div>
<template v-for="directory in directories" :key="directory.path"> <template v-for="directory in directories" :key="directory.path">
<div class="media" @click="open_directory(directory)"> <div class="media" @click="open_directory(directory)">
<figure class="media-left fd-has-action"> <figure class="media-left is-clickable">
<span class="icon"><mdicon name="folder" size="16" /></span> <span class="icon"><mdicon name="folder" size="16" /></span>
</figure> </figure>
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 <h1
class="title is-6" class="title is-6"
v-text="directory.path.substring(directory.path.lastIndexOf('/') + 1)" v-text="directory.path.substring(directory.path.lastIndexOf('/') + 1)"

View File

@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div v-else-if="genre.isItem" class="media" @click="open_genre(genre.item)"> <div v-else-if="genre.isItem" class="media" @click="open_genre(genre.item)">
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 class="title is-6" v-text="genre.item.name" /> <h1 class="title is-6" v-text="genre.item.name" />
</div> </div>
<div class="media-right"> <div class="media-right">

View File

@ -5,7 +5,7 @@
><mdicon name="drag-horizontal" size="16" ><mdicon name="drag-horizontal" size="16"
/></span> /></span>
</div> </div>
<div class="media-content fd-has-action is-clipped" @click="play"> <div class="media-content is-clickable is-clipped" @click="play">
<h1 <h1
class="title is-6" class="title is-6"
:class="{ :class="{

View File

@ -6,12 +6,12 @@
:playlist="playlist" :playlist="playlist"
@click="open_playlist(playlist.item)" @click="open_playlist(playlist.item)"
> >
<figure class="media-left fd-has-action"> <figure class="media-left is-clickable">
<span class="icon" <span class="icon"
><mdicon :name="icon_name(playlist.item)" size="16" ><mdicon :name="icon_name(playlist.item)" size="16"
/></span> /></span>
</figure> </figure>
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 class="title is-6" v-text="playlist.item.name" /> <h1 class="title is-6" v-text="playlist.item.name" />
</div> </div>
<div class="media-right"> <div class="media-right">

View File

@ -13,10 +13,10 @@
:class="{ 'with-progress': show_progress }" :class="{ 'with-progress': show_progress }"
@click="play_track(index, track.item)" @click="play_track(index, track.item)"
> >
<figure v-if="show_icon" class="media-left fd-has-action"> <figure v-if="show_icon" class="media-left is-clickable">
<span class="icon"><mdicon name="file-outline" size="16" /></span> <span class="icon"><mdicon name="file-outline" size="16" /></span>
</figure> </figure>
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 <h1
class="title is-6" class="title is-6"
:class="{ :class="{

View File

@ -146,7 +146,7 @@
class="button is-white is-small" class="button is-white is-small"
:class="{ 'is-loading': loading }" :class="{ 'is-loading': loading }"
><span ><span
class="icon fd-has-action" class="icon is-clickable"
:class="{ :class="{
'has-text-grey-light': !playing && !loading, 'has-text-grey-light': !playing && !loading,
'is-loading': loading 'is-loading': loading
@ -269,7 +269,7 @@
:class="{ 'is-loading': loading }" :class="{ 'is-loading': loading }"
> >
<span <span
class="icon fd-has-action" class="icon is-clickable"
:class="{ :class="{
'has-text-grey-light': !playing && !loading, 'has-text-grey-light': !playing && !loading,
'is-loading': loading 'is-loading': loading

View File

@ -5,7 +5,7 @@
<div class="level-item" style="flex-grow: 0"> <div class="level-item" style="flex-grow: 0">
<a class="button is-white is-small"> <a class="button is-white is-small">
<span <span
class="icon fd-has-action" class="icon is-clickable"
:class="{ 'has-text-grey-light': !output.selected }" :class="{ 'has-text-grey-light': !output.selected }"
@click="set_enabled" @click="set_enabled"
><mdicon :name="type_class" size="18" :title="output.type" ><mdicon :name="type_class" size="18" :title="output.type"

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="media"> <div class="media">
<div v-if="$slots['artwork']" class="media-left fd-has-action"> <div v-if="$slots['artwork']" class="media-left is-clickable">
<slot name="artwork" /> <slot name="artwork" />
</div> </div>
<div class="media-content fd-has-action is-clipped"> <div class="media-content is-clickable is-clipped">
<h1 class="title is-6" v-text="album.name" /> <h1 class="title is-6" v-text="album.name" />
<h2 class="subtitle is-7 has-text-grey"> <h2 class="subtitle is-7 has-text-grey">
<b v-text="album.artists[0].name" /> <b v-text="album.artists[0].name" />

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="media"> <div class="media">
<div class="media-content fd-has-action is-clipped" @click="open_artist"> <div class="media-content is-clickable is-clipped" @click="open_artist">
<h1 class="title is-6" v-text="artist.name" /> <h1 class="title is-6" v-text="artist.name" />
</div> </div>
<div class="media-right"> <div class="media-right">

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="media"> <div class="media">
<div class="media-content fd-has-action is-clipped" @click="open_playlist"> <div class="media-content is-clickable is-clipped" @click="open_playlist">
<h1 class="title is-6" v-text="playlist.name" /> <h1 class="title is-6" v-text="playlist.name" />
<h2 class="subtitle is-7" v-text="playlist.owner.display_name" /> <h2 class="subtitle is-7" v-text="playlist.owner.display_name" />
</div> </div>

View File

@ -3,7 +3,8 @@
<div <div
class="media-content is-clipped" class="media-content is-clipped"
:class="{ :class="{
'is-clickable': track.is_playable 'is-clickable': track.is_playable,
'fd-is-not-allowed': !track.is_playable
}" }"
@click="play" @click="play"
> >

View File

@ -66,8 +66,8 @@ a.navbar-item {
margin-left: auto; margin-left: auto;
} }
.fd-has-action { .fd-is-not-allowed {
cursor: pointer; cursor: not-allowed;
} }
.fd-is-movable { .fd-is-movable {

View File

@ -23,7 +23,7 @@
:artwork_url="album.artwork_url" :artwork_url="album.artwork_url"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-medium-image" class="is-clickable fd-has-shadow fd-cover fd-cover-medium-image"
@click="show_album_details_modal = true" @click="show_album_details_modal = true"
/> />
</template> </template>

View File

@ -23,7 +23,7 @@
:artwork_url="album.artwork_url" :artwork_url="album.artwork_url"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-medium-image" class="is-clickable fd-has-shadow fd-cover fd-cover-medium-image"
@click="show_album_details_modal = true" @click="show_album_details_modal = true"
/> />
</template> </template>

View File

@ -5,7 +5,7 @@
:artwork_url="now_playing.artwork_url" :artwork_url="now_playing.artwork_url"
:artist="now_playing.artist" :artist="now_playing.artist"
:album="now_playing.album" :album="now_playing.album"
class="fd-has-action fd-has-shadow fd-is-expanded fd-cover fd-cover-big-image" class="is-clickable fd-has-shadow fd-is-expanded fd-cover fd-cover-big-image"
@click="open_dialog(now_playing)" @click="open_dialog(now_playing)"
/> />
<div class="fd-has-padding-left-right"> <div class="fd-has-padding-left-right">

View File

@ -27,7 +27,7 @@
:artwork_url="artwork_url" :artwork_url="artwork_url"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-medium-image" class="is-clickable fd-has-shadow fd-cover fd-cover-medium-image"
@click="show_album_details_modal = true" @click="show_album_details_modal = true"
/> />
</template> </template>

View File

@ -33,7 +33,7 @@
:artwork_url="artwork_url(album)" :artwork_url="artwork_url(album)"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-small-image" class="is-clickable fd-has-shadow fd-cover fd-cover-small-image"
:maxwidth="64" :maxwidth="64"
:maxheight="64" :maxheight="64"
/> />

View File

@ -18,7 +18,7 @@
:artwork_url="artwork_url(album)" :artwork_url="artwork_url(album)"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-small-image" class="is-clickable fd-has-shadow fd-cover fd-cover-small-image"
:maxwidth="64" :maxwidth="64"
:maxheight="64" :maxheight="64"
/> />

View File

@ -17,7 +17,7 @@
:artwork_url="artwork_url(album)" :artwork_url="artwork_url(album)"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-small-image" class="is-clickable fd-has-shadow fd-cover fd-cover-small-image"
:maxwidth="64" :maxwidth="64"
:maxheight="64" :maxheight="64"
/> />

View File

@ -66,7 +66,6 @@ import store from '@/store'
import webapi from '@/webapi' import webapi from '@/webapi'
import SpotifyWebApi from 'spotify-web-api-js' import SpotifyWebApi from 'spotify-web-api-js'
import { VueEternalLoading } from '@ts-pro/vue-eternal-loading' import { VueEternalLoading } from '@ts-pro/vue-eternal-loading'
import { mdiAxe } from '@mdi/js'
const PAGE_SIZE = 50 const PAGE_SIZE = 50

View File

@ -160,7 +160,7 @@
:artwork_url="artwork_url(album)" :artwork_url="artwork_url(album)"
:artist="album.artist" :artist="album.artist"
:album="album.name" :album="album.name"
class="fd-has-action fd-has-shadow fd-cover fd-cover-small-image" class="is-clickable fd-has-shadow fd-cover fd-cover-small-image"
:maxwidth="64" :maxwidth="64"
:maxheight="64" :maxheight="64"
/> />