Improve CSS (Finishes #9 )
This commit is contained in:
parent
5c4c029f79
commit
ca83a1750f
8 changed files with 153 additions and 237 deletions
|
|
@ -2,25 +2,37 @@ Vue.component(
|
|||
`artist`,
|
||||
{
|
||||
props: [ `artist` ],
|
||||
computed: {},
|
||||
template: `<div class="artist">
|
||||
<div class="image profile_pic" v-if="artist.image">
|
||||
<img :src="artist.image.url" :alt="artist.name + 's profile picture'">
|
||||
</div>
|
||||
<div class="image profile_pic" v-else>
|
||||
<div class="missing-circle">
|
||||
data: function () {
|
||||
return {
|
||||
popularity_tooltip: `Popularity`,
|
||||
followers_tooltip: `Followers`,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
genres: function () {
|
||||
let genres = [];
|
||||
for (var genre of this.artist.genres) {
|
||||
genres.push(genre.toTitleCase());
|
||||
};
|
||||
return genres.join(`, `);
|
||||
}
|
||||
},
|
||||
template: `<div class="card">
|
||||
<div class="image">
|
||||
<img v-id="artist.image" :src="artist.image.url" :alt="artist.name + 's profile picture'" target="_blank" rel="noopener">
|
||||
<div class="missing-image" v-else>
|
||||
<music-note colour="#1DB954"></music-note>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span class="name">
|
||||
<span class="title">
|
||||
<a :href="artist.link" target="_blank" rel="noopener">{{artist.name}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<span class="genres">{{artist.genres.join(", ")}}</span>
|
||||
<span class="subtitle">{{genres}}</span>
|
||||
</div>
|
||||
<div class="popularity">{{artist.popularity}}</div>
|
||||
<div class="followers">{{artist.follower_count}}</div>
|
||||
<div class="bottom left corner popularity" v-tooltip="popularity_tooltip">{{artist.popularity}}</div>
|
||||
<div class="bottom right corner followers" v-tooltip="followers_tooltip">{{artist.follower_count}}</div>
|
||||
</div>`
|
||||
}
|
||||
}
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue