Queue is now implemented into main window, active drawers will now change the icons on the chrome

This commit is contained in:
booploops 2021-12-15 19:51:00 -08:00
parent 36019b518d
commit 459175ef1b
5 changed files with 84 additions and 29 deletions

View file

@ -127,6 +127,10 @@ const app = new Vue({
desiredDuration: 0, desiredDuration: 0,
userInteraction: false userInteraction: false
}, },
drawer: {
open: false,
panel: ""
},
browsepage: [], browsepage: [],
listennow: [], listennow: [],
radio: { radio: {
@ -390,6 +394,23 @@ const app = new Vue({
}) })
document.body.removeAttribute("loading") document.body.removeAttribute("loading")
}, },
invokeDrawer(panel) {
if(this.drawer.panel == panel && this.drawer.open) {
if(panel == "lyrics") {
this.lyricon = false
}
this.drawer.panel = ""
this.drawer.open = false
}else{
if(panel == "lyrics") {
this.lyricon = true
}else{
this.lyricon = false
}
this.drawer.open = true
this.drawer.panel = panel
}
},
async showCollection(response, title, type) { async showCollection(response, title, type) {
let self = this let self = this
this.collectionList.response = response this.collectionList.response = response

View file

@ -1319,11 +1319,6 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
height: 100%; height: 100%;
} }
.queue-body {
width: 100%;
height: 100%;
}
.search-body { .search-body {
position: absolute; position: absolute;
width: 100%; width: 100%;
@ -1861,6 +1856,31 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
} }
} }
.queue-panel {
height: 100%;
width: 100%;
display: flex;
flex-flow: column;
.queue-header-text {
margin: 18px 6px;
}
.queue-body {
overflow: overlay;
height: 100%;
}
.autoplay {
background: rgb(200 200 200 / 15%);
appearance: none;
border: 0;
border-radius: 6px;
font-weight: 500;
font-family: inherit;
height: 30px;
}
}
/* queue item */ /* queue item */
.cd-queue-item { .cd-queue-item {
border-bottom: 1px solid rgb(200 200 200 / 10%); border-bottom: 1px solid rgb(200 200 200 / 10%);

View file

@ -1,6 +1,14 @@
<script type="text/x-template" id="cider-queue"> <script type="text/x-template" id="cider-queue">
<div> <div class="queue-panel">
<h3>Queue</h3> <div class="row">
<div class="col">
<h3 class="queue-header-text">Queue</h3>
</div>
<div class="col-auto flex-center">
<button class="autoplay" :style="{'background': app.mk.autoplayEnabled ? 'var(--keyColor)' : ''}" @click="app.mk.autoplayEnabled = !app.mk.autoplayEnabled">AUTO</button>
</div>
</div>
<div class="queue-body">
<draggable v-model="queueItems" @start="drag=true" @end="drag=false;move()"> <draggable v-model="queueItems" @start="drag=true" @end="drag=false;move()">
<template v-for="(queueItem, position) in queueItems"> <template v-for="(queueItem, position) in queueItems">
<div v-if="position <= queuePosition" style="display: none;">{{ position }}</div> <div v-if="position <= queuePosition" style="display: none;">{{ position }}</div>
@ -20,6 +28,7 @@
</template> </template>
</draggable> </draggable>
</div> </div>
</div>
</script> </script>
@ -29,10 +38,13 @@
data: function () { data: function () {
return { return {
drag: false, drag: false,
queuePosition: app.mk.queue.position, queuePosition: 0,
queueItems: app.mk.queue._queueItems queueItems: []
} }
}, },
mounted() {
this.updateQueue()
},
methods: { methods: {
queueContext(event, item, position) { queueContext(event, item, position) {
let self = this let self = this

View file

@ -114,11 +114,11 @@
</button> </button>
</div> </div>
<div class="app-chrome-item generic"> <div class="app-chrome-item generic">
<button class="playback-button--small queue"></button> <button class="playback-button--small queue" :class="{'active': drawer.panel == 'queue'}" @click="invokeDrawer('queue')"></button>
</div> </div>
<div class="app-chrome-item generic"> <div class="app-chrome-item generic">
<button class="playback-button--small lyrics" <button class="playback-button--small lyrics" :class="{'active': drawer.panel == 'lyrics'}"
@click=" lyricon =!lyricon; if( document.getElementById(`apple-music-video-container`).style.display != `block`){drawertest = !drawertest; if (drawertest) lyricon = true;}; "></button> @click="invokeDrawer('lyrics')"></button>
</div> </div>
<div class="app-chrome-item full-height"> <div class="app-chrome-item full-height">
<div class="window-controls"> <div class="window-controls">
@ -372,9 +372,10 @@
</transition> </transition>
</div> </div>
<transition name="drawertransition"> <transition name="drawertransition">
<div class="app-drawer" v-if="drawertest"> <div class="app-drawer" v-if="drawer.open">
<lyrics-view v-if="drawertest && lyricon" :time="lyriccurrenttime" :lyrics="lyrics"> <lyrics-view v-if="drawer.panel == 'lyrics'" :time="lyriccurrenttime" :lyrics="lyrics">
</lyrics-view> </lyrics-view>
<cider-queue ref="queue" v-if="drawer.panel == 'queue'"></cider-queue>
</div> </div>
</transition> </transition>
</div> </div>

View file

@ -1,6 +1,7 @@
<template v-if="page == 'zoo'"> <template v-if="page == 'zoo'">
<div class="content-inner"> <div class="content-inner">
<h3>Welcome to element park. *BERR NERR NERR NERR NERRRRR BERR NER NER NER NERRR BERRR NR NR NRRRR*</h3> <h3>Welcome to element park. *BERR NERR NERR NERR NERRRRR BERR NER NER NER NERRR BERRR NR NR NRRRR*</h3>
<button @click="app.playMediaItemById('1592151778', 'album')">Play Test Album</button>
<cider-queue ref="queue"></cider-queue> <cider-queue ref="queue"></cider-queue>
</div> </div>
</template> </template>