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",
|
||||||
|
|
|
@ -413,7 +413,6 @@
|
||||||
.artwork {
|
.artwork {
|
||||||
height: 42px;
|
height: 42px;
|
||||||
width: 42px;
|
width: 42px;
|
||||||
border-radius : var(--mediaItemRadius);
|
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
object-position: center;
|
object-position: center;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
@ -423,7 +422,11 @@
|
||||||
outline: none;
|
outline: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
border-radius: var(--mediaItemRadiusSmall);
|
||||||
|
|
||||||
|
.mediaitem-artwork {
|
||||||
|
border-radius: var(--mediaItemRadiusSmall);
|
||||||
|
}
|
||||||
.overlay-play {
|
.overlay-play {
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
@ -1474,7 +1477,6 @@ input[type=checkbox][switch]:checked:active::before {
|
||||||
/* End Switch Checkbox */
|
/* End Switch Checkbox */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.header-text {
|
.header-text {
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
}
|
}
|
||||||
|
@ -1599,7 +1601,10 @@ input[type=checkbox][switch]:checked:active::before {
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
top:0;left:0;right:0;bottom:0;
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
background: var(--selected);
|
background: var(--selected);
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -1636,7 +1641,10 @@ input[type=checkbox][switch]:checked:active::before {
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
top:0;left:0;right:0;bottom:0;
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
background: var(--selected);
|
background: var(--selected);
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -1654,9 +1662,11 @@ input[type=checkbox][switch]:checked:active::before {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.playback-button--small.active {
|
.playback-button--small.active {
|
||||||
background-color: rgb(200 200 200 / 25%);
|
background-color: rgb(200 200 200 / 25%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.playback-button:hover,
|
.playback-button:hover,
|
||||||
.playback-button--small:hover {
|
.playback-button--small:hover {
|
||||||
// background-color: var(--selected);
|
// background-color: var(--selected);
|
||||||
|
@ -1713,6 +1723,7 @@ input[type=checkbox][switch]:checked:active::before {
|
||||||
color: var(--textColor);
|
color: var(--textColor);
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,7 +167,7 @@
|
||||||
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 = {
|
||||||
|
@ -172,9 +189,46 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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: [
|
||||||
{
|
{
|
||||||
|
@ -186,6 +240,7 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
favoriteActions[inFavorites ? "removeFavorite" : "favorite"],
|
||||||
followActions[followAction],
|
followActions[followAction],
|
||||||
{
|
{
|
||||||
icon: "./assets/feather/share.svg",
|
icon: "./assets/feather/share.svg",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue