2015-12-19 16:36:44 +00:00
|
|
|
<template>
|
2016-02-08 13:14:51 +00:00
|
|
|
<article v-if="album.id" id="albumInfo">
|
2015-12-19 16:36:44 +00:00
|
|
|
<h1>
|
2016-02-08 13:14:51 +00:00
|
|
|
<span>{{ album.name }}</span>
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
|
|
<a class="shuffle" @click.prevent="shuffleAll"><i class="fa fa-random"></i></a>
|
|
|
|
</h1>
|
|
|
|
|
2016-02-08 13:14:51 +00:00
|
|
|
<div v-if="album.info">
|
|
|
|
<img v-if="album.info.image" :src="album.info.image"
|
2015-12-19 16:36:44 +00:00
|
|
|
title=""
|
|
|
|
class="cover">
|
|
|
|
|
2016-02-08 13:14:51 +00:00
|
|
|
<div class="wiki" v-if="album.info.wiki && album.info.wiki.summary">
|
|
|
|
<div class="summary" v-show="!showingFullWiki">{{{ album.info.wiki.summary }}}</div>
|
|
|
|
<div class="full" v-show="showingFullWiki">{{{ album.info.wiki.full }}}</div>
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
|
|
<button class="more" v-show="!showingFullWiki" @click.prevent="showingFullWiki = !showingFullWiki">
|
|
|
|
Full Wiki
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2016-02-08 13:14:51 +00:00
|
|
|
<section class="track-listing" v-if="album.info.tracks.length">
|
2015-12-19 16:36:44 +00:00
|
|
|
<h1>Track Listing</h1>
|
|
|
|
<ul class="tracks">
|
2016-02-08 13:14:51 +00:00
|
|
|
<li v-for="track in album.info.tracks">
|
2015-12-19 16:36:44 +00:00
|
|
|
<span class="no">{{ $index + 1 }}</span>
|
|
|
|
<span class="title">{{ track.title }}</span>
|
|
|
|
<span class="length">{{ track.fmtLength }}</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
|
2016-02-08 13:14:51 +00:00
|
|
|
<footer>Data © <a target="_blank" href="{{{ album.info.url }}}">Last.fm</a></footer>
|
2015-12-19 16:36:44 +00:00
|
|
|
</div>
|
|
|
|
|
2016-01-16 18:11:24 +00:00
|
|
|
<p class="none" v-else>No album information found. At all.</p>
|
2015-12-19 16:36:44 +00:00
|
|
|
</article>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import playback from '../../../services/playback';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
replace: false,
|
2016-02-08 13:14:51 +00:00
|
|
|
props: ['album'],
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showingFullWiki: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2016-01-07 09:03:38 +00:00
|
|
|
/**
|
2016-02-08 13:14:51 +00:00
|
|
|
* Reset the component's current state.
|
2016-01-07 09:03:38 +00:00
|
|
|
*/
|
2015-12-19 16:36:44 +00:00
|
|
|
resetState() {
|
|
|
|
this.showingFullWiki = false;
|
|
|
|
},
|
|
|
|
|
2016-01-07 09:03:38 +00:00
|
|
|
/**
|
|
|
|
* Shuffle all songs in the current album.
|
|
|
|
*/
|
2015-12-19 16:36:44 +00:00
|
|
|
shuffleAll() {
|
2016-02-08 13:14:51 +00:00
|
|
|
playback.playAllInAlbum(this.album);
|
2015-12-19 16:36:44 +00:00
|
|
|
},
|
|
|
|
},
|
2016-02-08 13:14:51 +00:00
|
|
|
};
|
2015-12-19 16:36:44 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="sass">
|
2016-03-13 17:00:32 +00:00
|
|
|
@import "../../../../sass/partials/_vars.scss";
|
|
|
|
@import "../../../../sass/partials/_mixins.scss";
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
|
|
#albumInfo {
|
|
|
|
img.cover {
|
|
|
|
width: 100%;
|
|
|
|
height: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.wiki {
|
|
|
|
margin-top: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.track-listing {
|
|
|
|
margin-top: 16px;
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
font-size: 20px;
|
|
|
|
margin-bottom: 0;
|
|
|
|
display: block;
|
|
|
|
}
|
2016-02-08 13:14:51 +00:00
|
|
|
|
2015-12-19 16:36:44 +00:00
|
|
|
li {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
padding: 8px;
|
|
|
|
|
|
|
|
&:nth-child(even) {
|
|
|
|
background: rgba(255, 255, 255, 0.05);
|
|
|
|
}
|
|
|
|
|
|
|
|
.no {
|
|
|
|
flex: 0 0 24px;
|
|
|
|
opacity: .5;
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
2016-02-08 13:14:51 +00:00
|
|
|
flex: 1;
|
2015-12-19 16:36:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.length {
|
|
|
|
flex: 0 0 48px;
|
|
|
|
text-align: right;
|
|
|
|
opacity: .5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|