added AM favorite artists
- matched new mediaitem radius for medium sized items - testing out v3 musickit
This commit is contained in:
parent
80fa4d1eed
commit
fb86bfa789
5 changed files with 989 additions and 919 deletions
|
@ -213,6 +213,8 @@
|
||||||
"podcast.episodes": "Episodes",
|
"podcast.episodes": "Episodes",
|
||||||
"podcast.playEpisode": "Play Episode",
|
"podcast.playEpisode": "Play Episode",
|
||||||
"podcast.website": "Podcast Website",
|
"podcast.website": "Podcast Website",
|
||||||
|
"action.favorite": "Favorite",
|
||||||
|
"action.removeFavorite": "Remove Favorite",
|
||||||
"action.hideLibrary": "Hide Library",
|
"action.hideLibrary": "Hide Library",
|
||||||
"action.showLibrary": "Show Library",
|
"action.showLibrary": "Show Library",
|
||||||
"action.cut": "Cut",
|
"action.cut": "Cut",
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -20,7 +20,9 @@
|
||||||
--mediaItemShadow-Shadow: 0 8px 40px rgb(0 0 0 / 0.55);
|
--mediaItemShadow-Shadow: 0 8px 40px rgb(0 0 0 / 0.55);
|
||||||
--mediaItemShadow-ShadowSubtle: 0 4px 14px rgb(0 0 0 / 10%);
|
--mediaItemShadow-ShadowSubtle: 0 4px 14px rgb(0 0 0 / 10%);
|
||||||
--ciderShadow-Generic: var(--mediaItemShadow), 0 8px 40px rgb(0 0 0 / 0.55);
|
--ciderShadow-Generic: var(--mediaItemShadow), 0 8px 40px rgb(0 0 0 / 0.55);
|
||||||
--mediaItemRadius: 6px;
|
--mediaItemRadius: 8px;
|
||||||
|
--mediaItemRadiusSmall: 6px;
|
||||||
|
--mediaItemRadiusMedium: 8px;
|
||||||
--mediaItemRadiusRound: 100%;
|
--mediaItemRadiusRound: 100%;
|
||||||
--panelRadius: 10px;
|
--panelRadius: 10px;
|
||||||
--contentInnerPadding: 16px;
|
--contentInnerPadding: 16px;
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
|
|
||||||
<script async src="https://js-cdn.music.apple.com/musickit/v2/amp/musickit.js"></script>
|
<script async src="https://js-cdn.music.apple.com/musickit/v3/amp/musickit.js"></script>
|
||||||
<script src="index.js?v=1"></script>
|
<script src="index.js?v=1"></script>
|
||||||
|
|
||||||
<script type="text/x-template" id="am-musiccovershelf">
|
<script type="text/x-template" id="am-musiccovershelf">
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<script type="text/x-template" id="cider-artist">
|
<script type="text/x-template" id="cider-artist">
|
||||||
<div class="content-inner artist-page" :class="[data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9) ? 'animated' : '']">
|
<div class="content-inner artist-page"
|
||||||
|
:class="[data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9) ? 'animated' : '']">
|
||||||
<div class="artist-header" :key="data.id" v-observe-visibility="{callback: isHeaderVisible}">
|
<div class="artist-header" :key="data.id" v-observe-visibility="{callback: isHeaderVisible}">
|
||||||
<animatedartwork-view
|
<animatedartwork-view
|
||||||
:priority="true"
|
:priority="true"
|
||||||
|
@ -9,7 +10,8 @@
|
||||||
<div class="header-content" style="pointer-events: all;">
|
<div class="header-content" style="pointer-events: all;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm" style="width: auto;">
|
<div class="col-sm" style="width: auto;">
|
||||||
<div class="artist-image" v-if="!(data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9))">
|
<div class="artist-image"
|
||||||
|
v-if="!(data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9))">
|
||||||
<mediaitem-artwork
|
<mediaitem-artwork
|
||||||
shadow="large"
|
shadow="large"
|
||||||
:url="data.attributes.artwork ? data.attributes.artwork.url : ''"
|
:url="data.attributes.artwork ? data.attributes.artwork.url : ''"
|
||||||
|
@ -30,15 +32,22 @@
|
||||||
<h1>{{ data.attributes.name }}</h1>
|
<h1>{{ data.attributes.name }}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="more-btn-round" @click="artistMenu" style="pointer-events: all;" :aria-label="app.getLz('term.more')">
|
<button class="more-btn-round favorite" @click="artistMenu" style="pointer-events: all;"
|
||||||
|
:aria-label="app.getLz('term.more')">
|
||||||
|
<div class="svg-icon"></div>
|
||||||
|
</button>
|
||||||
|
<button class="more-btn-round menu" @click="artistMenu" style="pointer-events: all;"
|
||||||
|
:aria-label="app.getLz('term.more')">
|
||||||
<div class="svg-icon"></div>
|
<div class="svg-icon"></div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="artworkContainer" v-if="!(data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9))">
|
<div class="artworkContainer"
|
||||||
|
v-if="!(data.attributes.editorialVideo && (data.attributes.editorialVideo.motionArtistWide16x9 || data.attributes.editorialVideo.motionArtistFullscreen16x9))">
|
||||||
<artwork-material :url="data.attributes.artwork.url" size="190" images="1"></artwork-material>
|
<artwork-material :url="data.attributes.artwork.url" size="190" images="1"></artwork-material>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="floating-header" :style="{opacity: (headerVisible ? 0 : 1),'pointer-events': (headerVisible ? 'none' : '')}">
|
<div class="floating-header"
|
||||||
|
:style="{opacity: (headerVisible ? 0 : 1),'pointer-events': (headerVisible ? 'none' : '')}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-auto flex-center">
|
<div class="col-auto flex-center">
|
||||||
<button class="artist-play" style="display:block;" @click="app.mk.setStationQueue({artist:'a-'+data.id}).then(()=>{
|
<button class="artist-play" style="display:block;" @click="app.mk.setStationQueue({artist:'a-'+data.id}).then(()=>{
|
||||||
|
@ -49,7 +58,7 @@
|
||||||
<h3>{{ data.attributes.name }}</h3>
|
<h3>{{ data.attributes.name }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto flex-center">
|
<div class="col-auto flex-center">
|
||||||
<button class="more-btn-round" @click="artistMenu" :aria-label="app.getLz('term.more')">
|
<button class="more-btn-round menu" @click="artistMenu" :aria-label="app.getLz('term.more')">
|
||||||
<div class="svg-icon"></div>
|
<div class="svg-icon"></div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,8 +79,12 @@
|
||||||
<div class="col" style="padding:0;">
|
<div class="col" style="padding:0;">
|
||||||
<h3>{{app.getLz('term.topSongs')}}</h3>
|
<h3>{{app.getLz('term.topSongs')}}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto flex-center" v-if="data.views['top-songs'].data.length >= 20" style="padding:0;">
|
<div class="col-auto flex-center" v-if="data.views['top-songs'].data.length >= 20"
|
||||||
<button class="cd-btn-seeall" @click="app.showArtistView(data.id, data.attributes.name + ' - Top Songs', 'top-songs')">{{app.getLz('term.seeAll')}}</button>
|
style="padding:0;">
|
||||||
|
<button class="cd-btn-seeall"
|
||||||
|
@click="app.showArtistView(data.id, data.attributes.name + ' - Top Songs', 'top-songs')">
|
||||||
|
{{app.getLz('term.seeAll')}}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -96,7 +109,10 @@
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto flex-center" v-if="data.views[view].data.length >= 10">
|
<div class="col-auto flex-center" v-if="data.views[view].data.length >= 10">
|
||||||
<button class="cd-btn-seeall" @click="app.showArtistView(data.id, data.attributes.name + ' - ' + data.views[view].attributes.title, view)">{{app.getLz('term.seeAll')}}</button>
|
<button class="cd-btn-seeall"
|
||||||
|
@click="app.showArtistView(data.id, data.attributes.name + ' - ' + data.views[view].attributes.title, view)">
|
||||||
|
{{app.getLz('term.seeAll')}}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="!((data.views[view].attributes.title ?
|
<template v-if="!((data.views[view].attributes.title ?
|
||||||
|
@ -112,7 +128,8 @@
|
||||||
</template>
|
</template>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col" v-if="data.attributes.artistBio">
|
<div class="col" v-if="data.attributes.artistBio">
|
||||||
<h3>{{ $root.stringTemplateParser($root.getLz('term.aboutArtist'), {"artistName": data.attributes.name}) }}</h3>
|
<h3>{{ $root.stringTemplateParser($root.getLz('term.aboutArtist'), {"artistName":
|
||||||
|
data.attributes.name}) }}</h3>
|
||||||
<p v-html="data.attributes.artistBio"></p>
|
<p v-html="data.attributes.artistBio"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
@ -150,21 +167,21 @@
|
||||||
isHeaderVisible(visible) {
|
isHeaderVisible(visible) {
|
||||||
this.headerVisible = visible
|
this.headerVisible = visible
|
||||||
},
|
},
|
||||||
artistMenu (event) {
|
async artistMenu(event) {
|
||||||
let self = this
|
let self = this
|
||||||
let followAction = "follow"
|
let followAction = "follow"
|
||||||
let followActions = {
|
let followActions = {
|
||||||
follow: {
|
follow: {
|
||||||
icon: "./assets/feather/plus-circle.svg",
|
icon: "./assets/feather/plus-circle.svg",
|
||||||
name: app.getLz('action.follow'),
|
name: app.getLz('action.follow'),
|
||||||
action: ()=>{
|
action: () => {
|
||||||
self.app.cfg.home.followedArtists.push(self.data.id)
|
self.app.cfg.home.followedArtists.push(self.data.id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
unfollow: {
|
unfollow: {
|
||||||
icon: "./assets/feather/x-circle.svg",
|
icon: "./assets/feather/x-circle.svg",
|
||||||
name: app.getLz('action.unfollow'),
|
name: app.getLz('action.unfollow'),
|
||||||
action: ()=>{
|
action: () => {
|
||||||
let index = self.app.cfg.home.followedArtists.indexOf(self.data.id)
|
let index = self.app.cfg.home.followedArtists.indexOf(self.data.id)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
self.app.cfg.home.followedArtists.splice(index, 1)
|
self.app.cfg.home.followedArtists.splice(index, 1)
|
||||||
|
@ -172,25 +189,63 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let favoriteActions = {
|
||||||
|
favorite: {
|
||||||
|
icon: "./assets/star.svg",
|
||||||
|
name: app.getLz('action.favorite'),
|
||||||
|
action: () => {
|
||||||
|
app.mk.api.v3.music(`/v1/me/favorites`, {
|
||||||
|
"art[url]": "f",
|
||||||
|
"ids[artists]": app.artistPage.data.id,
|
||||||
|
"l": app.mklang,
|
||||||
|
"platform": "web"
|
||||||
|
}, {
|
||||||
|
fetchOptions: {
|
||||||
|
method: "POST"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
removeFavorite: {
|
||||||
|
icon: "./assets/star.svg",
|
||||||
|
name: app.getLz('action.removeFavorite'),
|
||||||
|
action: () => {
|
||||||
|
app.mk.api.v3.music(`/v1/me/favorites`, {
|
||||||
|
"art[url]": "f",
|
||||||
|
"ids[artists]": app.artistPage.data.id,
|
||||||
|
"l": app.mklang,
|
||||||
|
"platform": "web"
|
||||||
|
}, {
|
||||||
|
fetchOptions: {
|
||||||
|
method: "DELETE"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this.app.cfg.home.followedArtists.includes(self.data.id)) {
|
if (this.app.cfg.home.followedArtists.includes(self.data.id)) {
|
||||||
followAction = "unfollow"
|
followAction = "unfollow"
|
||||||
}
|
}
|
||||||
|
const inFavorites = (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${app.artistPage.data.id}`, {
|
||||||
|
"fields[artists]": "inFavorites"
|
||||||
|
})).data.data[0].attributes?.inFavorites
|
||||||
app.showMenuPanel({
|
app.showMenuPanel({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
icon: "./assets/feather/play.svg",
|
icon: "./assets/feather/play.svg",
|
||||||
name: app.getLz('action.startRadio'),
|
name: app.getLz('action.startRadio'),
|
||||||
action: ()=>{
|
action: () => {
|
||||||
app.mk.setStationQueue({artist:self.data.id}).then(()=>{
|
app.mk.setStationQueue({artist: self.data.id}).then(() => {
|
||||||
app.mk.play()
|
app.mk.play()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
favoriteActions[inFavorites ? "removeFavorite" : "favorite"],
|
||||||
followActions[followAction],
|
followActions[followAction],
|
||||||
{
|
{
|
||||||
icon: "./assets/feather/share.svg",
|
icon: "./assets/feather/share.svg",
|
||||||
name: app.getLz('term.share'),
|
name: app.getLz('term.share'),
|
||||||
action: ()=>{
|
action: () => {
|
||||||
self.app.copyToClipboard(self.data.attributes.url)
|
self.app.copyToClipboard(self.data.attributes.url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue