|
27 | 27 | :model-value="isSelected" |
28 | 28 | /> |
29 | 29 | </v-overlay> |
30 | | - <MediaItemThumb :item="isAvailable ? item : undefined" /> |
31 | | - <!-- Now Playing Badge --> |
32 | | - <NowPlayingBadge |
33 | | - v-if="isPlaying" |
34 | | - icon-style="position: absolute; right: 5px; bottom: 5px" |
35 | | - :show-badge="false" |
36 | | - /> |
37 | | - <!-- play button --> |
38 | | - <v-btn |
39 | | - v-if=" |
40 | | - (isHovering || store.isTouchscreen) && isAvailable && item.is_playable |
41 | | - " |
42 | | - icon="mdi-play" |
43 | | - color="white" |
44 | | - fab |
45 | | - size="small" |
46 | | - style=" |
47 | | - position: absolute; |
48 | | - left: 50%; |
49 | | - top: 40%; |
50 | | - transform: translate(-50%, -50%); |
51 | | - opacity: 0.8; |
52 | | - " |
53 | | - @click.stop="onPlayClick" |
54 | | - /> |
| 30 | + <div class="thumb-container"> |
| 31 | + <MediaItemThumb :item="isAvailable ? item : undefined" /> |
| 32 | + <!-- Now Playing Badge --> |
| 33 | + <NowPlayingBadge |
| 34 | + v-if="isPlaying" |
| 35 | + icon-style="position: absolute; right: 5px; bottom: 5px" |
| 36 | + :show-badge="false" |
| 37 | + /> |
| 38 | + <!-- play button --> |
| 39 | + <div |
| 40 | + v-if=" |
| 41 | + (isHovering || store.isTouchscreen) && |
| 42 | + isAvailable && |
| 43 | + item.is_playable |
| 44 | + " |
| 45 | + class="play-button-overlay" |
| 46 | + > |
| 47 | + <v-btn |
| 48 | + icon="mdi-play" |
| 49 | + color="white" |
| 50 | + fab |
| 51 | + style="opacity: 0.6; font-size: 20px" |
| 52 | + @click.stop="onPlayClick" |
| 53 | + /> |
| 54 | + </div> |
| 55 | + </div> |
55 | 56 | <v-list-item |
56 | 57 | variant="text" |
57 | 58 | slim |
|
109 | 110 | </template> |
110 | 111 |
|
111 | 112 | <script setup lang="ts"> |
112 | | -import MediaItemThumb from "./MediaItemThumb.vue"; |
113 | | -import { |
114 | | - BrowseFolder, |
115 | | - ItemMapping, |
116 | | - type MediaItemType, |
117 | | - MediaType, |
118 | | -} from "@/plugins/api/interfaces"; |
| 113 | +import NowPlayingBadge from "@/components/NowPlayingBadge.vue"; |
119 | 114 | import { |
120 | 115 | getArtistsString, |
121 | 116 | getBrowseFolderName, |
122 | 117 | handleMediaItemClick, |
123 | 118 | handleMenuBtnClick, |
124 | 119 | handlePlayBtnClick, |
125 | 120 | } from "@/helpers/utils"; |
| 121 | +import { |
| 122 | + BrowseFolder, |
| 123 | + ItemMapping, |
| 124 | + type MediaItemType, |
| 125 | + MediaType, |
| 126 | +} from "@/plugins/api/interfaces"; |
126 | 127 | import { store } from "@/plugins/store"; |
127 | | -import NowPlayingBadge from "@/components/NowPlayingBadge.vue"; |
| 128 | +import MediaItemThumb from "./MediaItemThumb.vue"; |
128 | 129 |
|
129 | 130 | // properties |
130 | 131 | export interface Props { |
@@ -184,6 +185,28 @@ const onPlayClick = function (evt: PointerEvent) { |
184 | 185 | </script> |
185 | 186 |
|
186 | 187 | <style scoped> |
| 188 | +.thumb-container { |
| 189 | + position: relative; |
| 190 | + display: flex; |
| 191 | + align-items: center; |
| 192 | + justify-content: center; |
| 193 | +} |
| 194 | +
|
| 195 | +.play-button-overlay { |
| 196 | + position: absolute; |
| 197 | + top: 0; |
| 198 | + left: 0; |
| 199 | + right: 0; |
| 200 | + bottom: 0; |
| 201 | + display: flex; |
| 202 | + align-items: center; |
| 203 | + justify-content: center; |
| 204 | + pointer-events: none; |
| 205 | +
|
| 206 | + .v-btn { |
| 207 | + pointer-events: all; |
| 208 | + } |
| 209 | +} |
187 | 210 | .v-card { |
188 | 211 | background-color: rgb(var(--v-theme-panel)); |
189 | 212 | transition: opacity 0.4s ease-in-out; |
|
0 commit comments