Merge pull request #35 from nikandlv/development

Bug fix and playerbar update
master
Nikan Dalvand 2019-07-30 23:33:18 +04:30 committed by GitHub
commit 6640e11511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 106 additions and 18 deletions

View File

@ -2,7 +2,7 @@
<div id="app" class="root">
<DockableSidebar />
<div class="page-wrapper">
<router-view class="page"></router-view>
<router-view class="page" :class="{'fullscreen' : fullscreenStatus}"></router-view>
<PlayerBar class="player-bar" />
</div>
</div>
@ -11,10 +11,12 @@
<script>
import DockableSidebar from './layouts/DockableSidebar'
import PlayerBar from './layouts/PlayerBar'
import { mapGetters } from 'vuex'
export default {
name: 'jukebox',
components: { DockableSidebar, PlayerBar }
components: { DockableSidebar, PlayerBar },
computed: mapGetters(['fullscreenStatus'])
}
</script>
@ -48,7 +50,18 @@ $lato-font-path: '/node_modules/lato-font/fonts'
flex-grow: 1
overflow-x: hidden
transition: padding-top 300ms
img
user-drag: none
user-select: none
-moz-user-select: none
-webkit-user-drag: none
-webkit-user-select: none
-ms-user-select: none
@media(max-width: 800px)
.page
padding-top: 64px
&.fullscreen
padding-top: 0px
</style>

View File

@ -0,0 +1,22 @@
<template>
<div class="dialog-wrapper" :class="{'open' : open}">
<div class="overlay">
</div>
<div class="dialog">
</div>
</div>
</template>
<script>
export default {
name: 'Dialog',
props: ['open']
}
</script>
<style scoped lang="sass">
.dialog
display: block
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<section class="handle" :class="{'open': menuStatus === true}">
<section class="handle" :class="{'open': menuStatus, 'fullscreen': fullscreenStatus}">
<div @click="toggleMenuStatus" class="icon">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 384.97 384.97" style="enable-background:new 0 0 384.97 384.97;" xml:space="preserve">
<g>
@ -16,8 +16,8 @@
</div>
<Logo :nopadding="true"/>
</section>
<section class="overlay" :class="{'open': menuStatus === true}" @click="toggleMenuStatus" />
<section class="sidebar" :class="{'open': menuStatus === true}">
<section class="overlay" :class="{'open': menuStatus, 'fullscreen': fullscreenStatus}" @click="toggleMenuStatus" />
<section class="sidebar" :class="{'open': menuStatus, 'fullscreen': fullscreenStatus}">
<div class="logo-wrapper">
<Logo class="logo" />
</div>
@ -142,7 +142,7 @@ export default {
methods: {
...mapActions(['toggleMenuStatus'])
},
computed: mapGetters(['menuStatus'])
computed: mapGetters(['menuStatus', 'fullscreenStatus'])
}
</script>
@ -208,6 +208,13 @@ section.sidebar
min-height: 48px
.icon
display: none
&.fullscreen
transform: translateX(-100%)
overflow-y: hidden
z-index: 1200
position: absolute
left: 0
top: 0
&.open
transform: translateX(0%)
padding: 1rem 0rem 0rem 1rem

View File

@ -1,5 +1,5 @@
<template>
<section class="wtf">
<section>
<ActionBar class="action-bar" />
<div class="upper-row" >
<MusicRow :items='items' title="Top rated" />
@ -272,7 +272,10 @@ section.page
display: flex
.grow-half
flex: 1 0 50% // deviding the space equally between two element
flex: 1 0 50%
max-width: 50%
&.recommend
max-width: 30%
.favourite
background: white

View File

@ -36,4 +36,6 @@ section.music-row
overflow: visible !important
.scroll-content
display: flex
.scrollbar-thumb,.scrollbar-track
display: none !important
</style>

View File

@ -1,5 +1,5 @@
<template>
<section class="player">
<section class="player" :class="{'fullscreen' : fullscreenStatus}">
<img @load="onArtworkLoad" class="artwork" src="/static/demo/yellow.jpeg" />
<div>
<p class="title">Yellow</p>
@ -28,6 +28,9 @@
<IconButton variant="contained">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
</IconButton>
<IconButton variant="contained" :click="toggleFullscreenStatus">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
</IconButton>
</div>
</section>
</template>
@ -38,9 +41,20 @@ import minimap from 'wavesurfer.js/dist/plugin/wavesurfer.minimap'
import color from 'dominant-color'
import { formatSeconds } from '../utility/DateTime'
import IconButton from '../components/IconButton'
import { mapActions, mapGetters } from 'vuex'
export default {
name: 'PlayerBar',
components: { IconButton },
data () {
return {
playingStatus: false,
isFavorited: false,
duration: '00:00',
isFullscreen: false
}
},
computed: mapGetters(['fullscreenStatus']),
mounted () {
let progress = this.$el.getElementsByClassName('progress')[0]
this.wavesurfer = WaveSurfer.create({
@ -111,13 +125,6 @@ export default {
currentWidth = progressWave.style.width
})
},
data () {
return {
playingStatus: false,
isFavorited: false,
duration: '00:00'
}
},
methods: {
onArtworkLoad () {
let img = this.$el.getElementsByTagName('img')[0]
@ -186,7 +193,8 @@ export default {
},
toggleFavorite () {
this.isFavorited = !this.isFavorited
}
},
...mapActions(['toggleFullscreenStatus'])
}
}
</script>
@ -197,7 +205,13 @@ section.player
align-items: center
border-top: 1px solid rgba(0,0,0,0.1)
height: 4.5rem
background-color: white
min-height: 4.5rem
transition: height 500ms ease, min-height 500ms ease, width 500ms ease
&.fullscreen
height: 100vh
min-height: 100vh
z-index: 1300
.control-buttons
span
margin: 0 0.2rem
@ -221,7 +235,7 @@ section.player
top: 0
bottom: 0
margin: auto
transition: height 500ms ease
transition: height 500ms ease ease
height: 0px
width: 100%
z-index:

View File

@ -0,0 +1,26 @@
const state = {
fullscreen_mode: false
}
const getters = {
fullscreenStatus: (state) => state.fullscreen_mode
}
const mutations = {
TOGGLE_FULLSCREEN (state) {
state.fullscreen_mode = !state.fullscreen_mode
}
}
const actions = {
toggleFullscreenStatus ({ commit }) {
commit('TOGGLE_FULLSCREEN')
}
}
export default {
actions,
state,
mutations,
getters
}

View File

@ -3,6 +3,7 @@ import Scrollbar from 'smooth-scrollbar'
export default class HorizontalScrollPlugin extends Scrollbar.ScrollbarPlugin {
static pluginName = 'horizontalScroll';
transformDelta (delta, fromEvent) {
console.log(fromEvent.type)
if (!/wheel/.test(fromEvent.type)) {
return delta
}