changes to mediaitem elements

This commit is contained in:
booploops 2021-12-21 17:26:06 -08:00
parent 773b397bbc
commit 287f8a490b
8 changed files with 78 additions and 23 deletions

View file

@ -2,8 +2,10 @@
:root { :root {
--appleEase: cubic-bezier(0.42, 0, 0.58, 1); --appleEase: cubic-bezier(0.42, 0, 0.58, 1);
--mediaItemShadow-Shadow: inset 0px 0px 0px 1px rgb(200 200 200 / 16%), 0 8px 40px rgb(0 0 0 / 0.55);
--mediaItemShadow: inset 0px 0px 0px 1px rgb(200 200 200 / 16%); --mediaItemShadow: inset 0px 0px 0px 1px rgb(200 200 200 / 16%);
--mediaItemShadow-Shadow: 0 8px 40px rgb(0 0 0 / 0.55);
--mediaItemShadow-ShadowSubtle: 0 4px 14px rgb(0 0 0 / 10%);
--ciderShadow-Generic: var(--mediaItemShadow), 0 8px 40px rgb(0 0 0 / 0.55);
--mediaItemRadius: 6px; --mediaItemRadius: 6px;
--mediaItemRadiusRound: 100%; --mediaItemRadiusRound: 100%;
--contentInnerPadding: 16px; --contentInnerPadding: 16px;
@ -243,7 +245,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
z-index: 9; z-index: 9;
height: 94%; height: 94%;
backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
box-shadow: var(--mediaItemShadow-Shadow); box-shadow: var(--ciderShadow-Generic);
} }
.search-input-container { .search-input-container {
@ -395,7 +397,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
padding: 6px; padding: 6px;
border-radius: 6px; border-radius: 6px;
width: 100%; width: 100%;
box-shadow: var(--mediaItemShadow-Shadow); box-shadow: var(--ciderShadow-Generic);
} }
.item { .item {
@ -477,7 +479,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
background: #242424; background: #242424;
padding: 6px; padding: 6px;
border-radius: 6px; border-radius: 6px;
box-shadow: var(--mediaItemShadow-Shadow); box-shadow: var(--ciderShadow-Generic);
&.context-menu-open { &.context-menu-open {
animation-duration: .10s; animation-duration: .10s;
@ -1752,7 +1754,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
background: rgb(60 60 60); background: rgb(60 60 60);
border: 0px; border: 0px;
appearance: none; appearance: none;
box-shadow: var(--mediaItemShadow-Shadow); box-shadow: var(--ciderShadow-Generic);
>svg { >svg {
height: 50%; height: 50%;
@ -1791,7 +1793,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
.artist-more { .artist-more {
border-radius: 100%; border-radius: 100%;
background: var(--keyColor); background: var(--keyColor);
box-shadow: var(--mediaItemShadow-Shadow); box-shadow: var(--ciderShadow-Generic);
width: 36px; width: 36px;
height: 36px; height: 36px;
position: absolute; position: absolute;
@ -2593,8 +2595,10 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
&.mediaitem-video { &.mediaitem-video {
height: 200px; height: 200px;
width: 240px;
.artwork { .artwork {
height: 106px; height: 120px;
width: 212px;
} }
} }
} }

View file

@ -1,12 +1,12 @@
<script type="text/x-template" id="mediaitem-artwork"> <script type="text/x-template" id="mediaitem-artwork">
<template v-if="type == 'artists'"> <template v-if="type == 'artists'">
<div class="mediaitem-artwork rounded" :key="url" :style="{'box-shadow': shadow ? 'var(--mediaItemShadow-Shadow)' : ''}"> <div class="mediaitem-artwork rounded" :key="url" :style="getStyle()">
<img :src="app.getMediaItemArtwork(url, size)" <img :src="app.getMediaItemArtwork(url, size)"
class="mediaitem-artwork--img"> class="mediaitem-artwork--img">
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="mediaitem-artwork" :key="url" :style="{'box-shadow': shadow ? 'var(--mediaItemShadow-Shadow)' : ''}" <div class="mediaitem-artwork" :key="url" :style="getStyle()"
v-observe-visibility="{callback: visibilityChanged}"> v-observe-visibility="{callback: visibilityChanged}">
<img :src="app.getMediaItemArtwork(url, size)" v-if="isVisible" <img :src="app.getMediaItemArtwork(url, size)" v-if="isVisible"
class="mediaitem-artwork--img"> class="mediaitem-artwork--img">
@ -38,16 +38,32 @@
required: false required: false
}, },
shadow: { shadow: {
type: Boolean, type: String,
default: false default: 'none'
} }
}, },
data: function () { data: function () {
return { return {
isVisible: false isVisible: false,
style: {
"box-shadow": ""
}
} }
}, },
methods: { methods: {
getStyle() {
switch(this.shadow) {
case "large":
this.style["box-shadow"] = "var(--mediaItemShadow-Shadow)"
break;
case "subtle":
this.style["box-shadow"] = "var(--mediaItemShadow-ShadowSubtle)"
break;
default:
break;
}
return this.style;
},
getArtworkStyle() { getArtworkStyle() {
return { return {
width: this.size + 'px', width: this.size + 'px',

View file

@ -6,8 +6,8 @@
:badge="item.attributes" v-for="item in items"></mediaitem-mvview-sp> :badge="item.attributes" v-for="item in items"></mediaitem-mvview-sp>
</template> </template>
<template v-else> <template v-else>
<mediaitem-mvview :item="item ? (item.attributes.kind ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []" :imagesize="imagesize" <mediaitem-square :kind="kind" :item="item ? (item.attributes.kind ? item : ((item.relationships && item.relationships.contents ) ? item.relationships.contents.data[0] : item)) : []" :imagesize="imagesize"
v-for="item in items"></mediaitem-mvview> v-for="item in items"></mediaitem-square>
</template> </template>
</div> </div>
</template> </template>
@ -17,7 +17,25 @@
<script> <script>
Vue.component('mediaitem-scroller-horizontal-mvview', { Vue.component('mediaitem-scroller-horizontal-mvview', {
template: '#mediaitem-scroller-horizontal-mvview', template: '#mediaitem-scroller-horizontal-mvview',
props: ['items',"imagesize","browsesp"], props: {
items: {
type: Array,
required: true
},
imagesize: {
type: String,
required: true
},
browsesp: {
type: Boolean,
required: true
},
kind: {
type: String,
required: false,
default: ""
}
},
methods: {} methods: {}
}); });
</script> </script>

View file

@ -9,6 +9,7 @@
:url="item.attributes.artwork ? item.attributes.artwork.url : ''" :url="item.attributes.artwork ? item.attributes.artwork.url : ''"
:video="(item.attributes != null && item.attributes.editorialVideo != null) ? (item.attributes.editorialVideo.motionDetailSquare ? item.attributes.editorialVideo.motionDetailSquare.video : (item.attributes.editorialVideo.motionSquareVideo1x1 ? item.attributes.editorialVideo.motionSquareVideo1x1.video : '')) : '' " :video="(item.attributes != null && item.attributes.editorialVideo != null) ? (item.attributes.editorialVideo.motionDetailSquare ? item.attributes.editorialVideo.motionDetailSquare.video : (item.attributes.editorialVideo.motionSquareVideo1x1 ? item.attributes.editorialVideo.motionSquareVideo1x1.video : '')) : '' "
size="300" size="300"
shadow="subtle"
:type="item.type"></mediaitem-artwork> :type="item.type"></mediaitem-artwork>
</div> </div>
<button class="menu-btn" v-if="item.type != 'artists' && item.type != 'stations'" @click="contextMenu"><%- include("../svg/more.svg") %></button> <button class="menu-btn" v-if="item.type != 'artists' && item.type != 'stations'" @click="contextMenu"><%- include("../svg/more.svg") %></button>
@ -29,7 +30,16 @@
<script> <script>
Vue.component('mediaitem-square', { Vue.component('mediaitem-square', {
template: '#mediaitem-square', template: '#mediaitem-square',
props: ['item'], props: {
item: {
type: Object,
required: true
},
kind: {
type: String,
default: ''
}
},
data: function () { data: function () {
return { return {
isVisible: false, isVisible: false,
@ -39,10 +49,15 @@
}, },
methods: { methods: {
getClasses() { getClasses() {
switch(this.item.type) { let type = this.item.type
if(this.kind != "") {
type = this.kind
}
switch(type) {
default: default:
return [] return []
break; break;
case "music-videos":
case "uploaded-videos": case "uploaded-videos":
return "mediaitem-video"; return "mediaitem-video";
break; break;

View file

@ -9,8 +9,7 @@
<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="true" shadow="large"
:url="data.attributes.artwork ? data.attributes.artwork.url : ''" :url="data.attributes.artwork ? data.attributes.artwork.url : ''"
size="220" type="artists"></mediaitem-artwork> size="220" type="artists"></mediaitem-artwork>
<button class="overlay-play" @click="app.mk.setStationQueue({artist:'a-'+data.id}).then(()=>{ <button class="overlay-play" @click="app.mk.setStationQueue({artist:'a-'+data.id}).then(()=>{

View file

@ -12,10 +12,14 @@
</div> </div>
</div> </div>
<template v-if="recom.relationships && ((recom.relationships.children && recom.relationships.children.data) || (recom.relationships.contents && recom.relationships.contents.data))"> <template v-if="recom.relationships && ((recom.relationships.children && recom.relationships.children.data) || (recom.relationships.contents && recom.relationships.contents.data))">
<template v-if="(['385']).includes(recom.attributes.editorialElementKind) || index === 0"> <template v-if="index === 0">
<mediaitem-scroller-horizontal-mvview :imagesize="800" :browsesp="index == 0" <mediaitem-scroller-horizontal-mvview :imagesize="800" :browsesp="index == 0"
:items="recom.relationships.children ? recom.relationships.children.data.limit(10) : recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-mvview> :items="recom.relationships.children ? recom.relationships.children.data.limit(10) : recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-mvview>
</template> </template>
<template v-else-if="(['385']).includes(recom.attributes.editorialElementKind)">
<mediaitem-scroller-horizontal-mvview :imagesize="800" kind="music-videos"
:items="recom.relationships.children ? recom.relationships.children.data.limit(10) : recom.relationships.contents.data.limit(10)"></mediaitem-scroller-horizontal-mvview>
</template>
<template v-else-if="recom.attributes.name == 'Chart Set'"> <template v-else-if="recom.attributes.name == 'Chart Set'">
<!-- ignored --> <!-- ignored -->
</template> </template>

View file

@ -11,8 +11,7 @@
v-if="item.attributes.playParams.kind == 'song'" v-if="item.attributes.playParams.kind == 'song'"
:index="key" :index="key"
:item="item"></mediaitem-list-item> :item="item"></mediaitem-list-item>
<mediaitem-mvview v-else-if="item.attributes.playParams.kind == 'musicVideo'" :item="item"></mediaitem-mvview> <mediaitem-square v-else :item="item" :type="item.attributes.playParams.kind"></mediaitem-square>
<mediaitem-square v-else :item="item"></mediaitem-square>
</template> </template>
</template> </template>
<button v-if="triggerEnabled" style="opacity:0;height: 32px;" v-observe-visibility="{callback: visibilityChanged}">Show More</button> <button v-if="triggerEnabled" style="opacity:0;height: 32px;" v-observe-visibility="{callback: visibilityChanged}">Show More</button>

View file

@ -5,7 +5,7 @@
<div class="col-sm" style="width: auto;"> <div class="col-sm" style="width: auto;">
<div class="artist-image"> <div class="artist-image">
<mediaitem-artwork <mediaitem-artwork
:shadow="true" shadow="large"
:url="data.attributes.artwork ? data.attributes.artwork.url : ''" :url="data.attributes.artwork ? data.attributes.artwork.url : ''"
size="220" type="artists"></mediaitem-artwork> size="220" type="artists"></mediaitem-artwork>
</div> </div>