Skip to content

Commit ccdc00a

Browse files
authored
Update play icon for tracks and for home page (#1149)
1 parent bf4a22b commit ccdc00a

File tree

3 files changed

+65
-37
lines changed

3 files changed

+65
-37
lines changed

src/components/ListviewItem.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,15 @@
3131
v-if="!showCheckboxes && item.is_playable"
3232
:class="{ hidden: !showPlayBtn }"
3333
icon="mdi-play"
34-
color="primary"
35-
fab
34+
variant="text"
3635
size="small"
37-
style="position: absolute; left: 12px; bottom: 12px"
36+
style="
37+
position: absolute;
38+
left: 14px;
39+
bottom: 12px;
40+
color: white;
41+
font-size: 18px;
42+
"
3843
@click.stop="onPlayClick"
3944
@mouseenter="showPlayBtn = true"
4045
@mouseleave="showPlayBtn = false"

src/components/PanelviewItemCompact.vue

Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,32 @@
2727
:model-value="isSelected"
2828
/>
2929
</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>
5556
<v-list-item
5657
variant="text"
5758
slim
@@ -109,22 +110,22 @@
109110
</template>
110111

111112
<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";
119114
import {
120115
getArtistsString,
121116
getBrowseFolderName,
122117
handleMediaItemClick,
123118
handleMenuBtnClick,
124119
handlePlayBtnClick,
125120
} from "@/helpers/utils";
121+
import {
122+
BrowseFolder,
123+
ItemMapping,
124+
type MediaItemType,
125+
MediaType,
126+
} from "@/plugins/api/interfaces";
126127
import { store } from "@/plugins/store";
127-
import NowPlayingBadge from "@/components/NowPlayingBadge.vue";
128+
import MediaItemThumb from "./MediaItemThumb.vue";
128129
129130
// properties
130131
export interface Props {
@@ -184,6 +185,28 @@ const onPlayClick = function (evt: PointerEvent) {
184185
</script>
185186

186187
<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+
}
187210
.v-card {
188211
background-color: rgb(var(--v-theme-panel));
189212
transition: opacity 0.4s ease-in-out;

src/layouts/default/Footer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
`"
1313
></div>
1414
<BottomNavigation
15-
:height="bottomNavHeight"
1615
v-if="getBreakpointValue({ breakpoint: 'tablet' })"
16+
:height="bottomNavHeight"
1717
/>
1818
<v-footer
1919
app

0 commit comments

Comments
 (0)