2015-12-19 16:36:44 +00:00
|
|
|
|
<template>
|
2016-06-25 16:05:24 +00:00
|
|
|
|
<article id="artistInfo" :class="mode">
|
|
|
|
|
<h1 class="name">
|
|
|
|
|
<span>{{ artist.name }}</span>
|
2016-02-08 13:14:51 +00:00
|
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
|
<a class="shuffle" @click.prevent="shuffleAll"><i class="fa fa-random"></i></a>
|
|
|
|
|
</h1>
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
|
<div v-if="artist.info">
|
|
|
|
|
<img v-if="artist.info.image" :src="artist.info.image"
|
|
|
|
|
title="They see me posin, they hatin"
|
|
|
|
|
class="cool-guys-posing cover">
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
|
<div class="bio" v-if="artist.info.bio.summary">
|
2016-10-31 04:34:08 +00:00
|
|
|
|
<div class="summary" v-show="showSummary" v-html="artist.info.bio.summary"/>
|
|
|
|
|
<div class="full" v-show="showFull" v-html="artist.info.bio.full"/>
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-10-31 04:34:08 +00:00
|
|
|
|
<button class="more" v-show="showSummary" @click.prevent="showingFullBio = true">
|
2016-06-25 16:05:24 +00:00
|
|
|
|
Full Bio
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<p class="none" v-else>This artist has no Last.fm biography – yet.</p>
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
|
<footer>Data © <a target="_blank" :href="artist.info.url">Last.fm</a></footer>
|
|
|
|
|
</div>
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
|
<p class="none" v-else>Nothing can be found. This artist is a mystery.</p>
|
|
|
|
|
</article>
|
2015-12-19 16:36:44 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2016-11-26 03:25:35 +00:00
|
|
|
|
import { playback } from '../../../services'
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
|
export default {
|
|
|
|
|
props: ['artist', 'mode'],
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-11-26 03:25:35 +00:00
|
|
|
|
data () {
|
2016-06-25 16:05:24 +00:00
|
|
|
|
return {
|
2016-11-26 03:25:35 +00:00
|
|
|
|
showingFullBio: false
|
|
|
|
|
}
|
2016-06-25 16:05:24 +00:00
|
|
|
|
},
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-09-23 09:55:20 +00:00
|
|
|
|
watch: {
|
2017-01-17 07:02:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* Whenever a new artist is loaded into this component, we reset the "full bio" state.
|
|
|
|
|
* @return {Boolean}
|
|
|
|
|
*/
|
2016-11-26 03:25:35 +00:00
|
|
|
|
artist () {
|
|
|
|
|
this.showingFullBio = false
|
|
|
|
|
}
|
2016-09-23 09:55:20 +00:00
|
|
|
|
},
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-10-31 04:34:08 +00:00
|
|
|
|
computed: {
|
2016-11-26 03:25:35 +00:00
|
|
|
|
showSummary () {
|
|
|
|
|
return this.mode !== 'full' && !this.showingFullBio
|
2016-10-31 04:34:08 +00:00
|
|
|
|
},
|
|
|
|
|
|
2016-11-26 03:25:35 +00:00
|
|
|
|
showFull () {
|
|
|
|
|
return this.mode === 'full' || this.showingFullBio
|
2016-10-31 04:34:08 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2016-09-23 09:55:20 +00:00
|
|
|
|
methods: {
|
2016-06-25 16:05:24 +00:00
|
|
|
|
/**
|
|
|
|
|
* Shuffle all songs performed by the current song's artist.
|
|
|
|
|
*/
|
2016-11-26 03:25:35 +00:00
|
|
|
|
shuffleAll () {
|
2016-12-01 11:32:11 +00:00
|
|
|
|
playback.playAllByArtist(this.artist, false)
|
2016-11-26 03:25:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-12-19 16:36:44 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="sass">
|
2016-06-25 16:05:24 +00:00
|
|
|
|
@import "../../../../sass/partials/_vars.scss";
|
|
|
|
|
@import "../../../../sass/partials/_mixins.scss";
|
2015-12-19 16:36:44 +00:00
|
|
|
|
|
2016-06-25 16:05:24 +00:00
|
|
|
|
#artistInfo {
|
|
|
|
|
@include artist-album-info();
|
|
|
|
|
}
|
2015-12-19 16:36:44 +00:00
|
|
|
|
</style>
|