Skip to content

Commit

Permalink
Add default image for album art while it loads
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Villarreal committed Dec 21, 2018
1 parent bdf9d8f commit a7fd431
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,20 @@ export default {
left: 0px;
background-color: #3898d6;
}
/** Set a default image for album art until it loads **/
.album-art-image .v-image__image {
z-index: unset;
}
.album-art-image .v-image__image:before {
content: ' ';
z-index: -1;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: contain;
background-image: url("http://localhost:5050/img/empty-album-art.b8a07499.png");
}
</style>
2 changes: 1 addition & 1 deletion client/src/components/NowPlayingBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<v-list two-line>
<v-list-tile avatar>
<v-list-tile-avatar tile size="60px">
<v-img :src="albumArtURL"></v-img>
<v-img class="album-art-image" :src="albumArtURL"></v-img>
</v-list-tile-avatar>
<v-list-tile-content class="pl-3">
<v-list-tile-title>{{ track }}</v-list-tile-title>
Expand Down
5 changes: 4 additions & 1 deletion client/src/views/NowPlaying.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</v-list>
</v-menu>
</div>
<v-img class="album-art" contain :src="albumArtURL"></v-img>
<v-img class="album-art album-art-image" :src="albumArtURL"></v-img>
<v-flex xs12>
<div class="text-xs-center">
<v-card-title primary-title class="d-block">
Expand Down Expand Up @@ -101,6 +101,9 @@ export default {
albumArtURL() {
return this.$store.getters.albumArtURLForGroup(this.activeZoneGroupId);
},
albumArtPlaceholderURL() {
return this.$store.state.defaultAlbumArtURL;
},
},
};
</script>
Expand Down
1 change: 1 addition & 0 deletions client/src/views/rooms/ZoneGroupDraggable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<v-layout mb-3 v-bind="albumSectionBreakpoint">
<div class="pt-3 pl-3 pr-0">
<v-img
class="album-art-image"
:src="albumArtURL(group.id)"
height="125px"
width="125px"
Expand Down

0 comments on commit a7fd431

Please sign in to comment.