diff --git a/src/renderer/layouts/PlayerBar.vue b/src/renderer/layouts/PlayerBar.vue index 0900fa0..1bf8384 100644 --- a/src/renderer/layouts/PlayerBar.vue +++ b/src/renderer/layouts/PlayerBar.vue @@ -34,7 +34,7 @@ -
+
@@ -57,7 +57,8 @@ export default { playingStatus: false, isFavorited: false, duration: '00:00', - isFullscreen: false + isFullscreen: false, + updateCurrent: false } }, computed: mapGetters(['fullscreenStatus', 'currentlyPlaying', 'playerQueue']), @@ -65,7 +66,10 @@ export default { this.drawVisualizer() }, updated () { - this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream) + if (this.updateCurrent) { + this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream) + this.updateCurrent = false + } }, methods: { drawVisualizer () { @@ -155,6 +159,7 @@ export default { onArtworkLoad () { let img = this.$el.getElementsByTagName('img')[0] let controlIcons = this.$el.getElementsByClassName('control-buttons')[0].children + let themeBackground = this.$el.getElementsByClassName('theme-background') color(img.src, (_, color) => { this.wavesurfer.setProgressColor(`#${color}`) this.wavesurfer.minimap.params.progressColor = `#${color}` @@ -181,6 +186,11 @@ export default { controlIcons[child].style.backgroundColor = `#${color}` } } + for (let item in themeBackground) { + if (typeof themeBackground[item] === 'object') { + themeBackground[item].style.backgroundColor = `#${color}` + } + } }) }, playNext () { @@ -189,6 +199,7 @@ export default { map.style['height'] = '0%' window.setTimeout(() => { this.playQueueItem(this.currentlyPlaying + 1) + this.updateCurrent = true }, 500) }, playPrevious () { @@ -197,6 +208,7 @@ export default { map.style['height'] = '0%' window.setTimeout(() => { this.playQueueItem(this.currentlyPlaying - 1) + this.updateCurrent = true }, 500) }, play () { diff --git a/src/renderer/utility/HorizontalScrollPlugin.js b/src/renderer/utility/HorizontalScrollPlugin.js index f8dfbed..ebb90e0 100644 --- a/src/renderer/utility/HorizontalScrollPlugin.js +++ b/src/renderer/utility/HorizontalScrollPlugin.js @@ -5,6 +5,7 @@ export default class HorizontalScrollPlugin extends Scrollbar.ScrollbarPlugin { transformDelta (delta, fromEvent) { const { x, y } = delta if (!this.scrollbar.options.horizontal) { + console.log('wtf', x) return { y: y, x: 0