Merge pull request #16 from nikandlv/development

MusicBox and MusicRow update
master
Nikan Dalvand 2019-07-24 19:28:37 +04:30 committed by GitHub
commit 87bb0e3f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 92 additions and 12 deletions

5
package-lock.json generated
View File

@ -14231,6 +14231,11 @@
"inherits": "^2.0.1" "inherits": "^2.0.1"
} }
}, },
"roboto-slab-fontface-kit": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/roboto-slab-fontface-kit/-/roboto-slab-fontface-kit-1.0.2.tgz",
"integrity": "sha512-EdwkOvb6+D7ENrnjs1JzuHQHbeeEuQpddtbYqHzjl+c4dE2Vep0Jh5CHkpQkAhj+nELrXEUikzDayvIn2xzNNA=="
},
"run-async": { "run-async": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",

View File

@ -59,6 +59,7 @@
"axios": "^0.18.0", "axios": "^0.18.0",
"dominant-color": "0.0.1", "dominant-color": "0.0.1",
"normalize-scss": "^7.0.1", "normalize-scss": "^7.0.1",
"roboto-slab-fontface-kit": "^1.0.2",
"vue": "^2.5.16", "vue": "^2.5.16",
"vue-carousel": "^0.18.0", "vue-carousel": "^0.18.0",
"vue-custom-scrollbar": "^1.1.0", "vue-custom-scrollbar": "^1.1.0",

View File

@ -25,6 +25,9 @@ function createWindow () {
width: 1000, width: 1000,
minHeight:600, minHeight:600,
minWidth:400, minWidth:400,
//frame: false,
//titleBarStyle: 'hidden',
//titleBarStyle: 'customButtonsOnHover',
}) })
mainWindow.loadURL(winURL) mainWindow.loadURL(winURL)

View File

@ -21,6 +21,8 @@ export default {
<style lang="sass"> <style lang="sass">
@import 'normalize-scss' @import 'normalize-scss'
@import 'lato-font/scss/_public-api.scss' @import 'lato-font/scss/_public-api.scss'
$FontPath: '/node_modules/roboto-slab-fontface-kit/fonts'
@import 'roboto-slab-fontface-kit/roboto-slab.scss'
@include normalize() @include normalize()
$lato-font-path: '/node_modules/lato-font/fonts' $lato-font-path: '/node_modules/lato-font/fonts'
@ -44,7 +46,7 @@ $lato-font-path: '/node_modules/lato-font/fonts'
.page .page
flex-grow: 1 flex-grow: 1
overflow: auto overflow-x: hidden
transition: padding-top 300ms transition: padding-top 300ms
@media(max-width: 800px) @media(max-width: 800px)
.page .page

View File

@ -15,7 +15,7 @@ export default {
onLoad () { onLoad () {
let img = this.$el.getElementsByTagName('img')[0] let img = this.$el.getElementsByTagName('img')[0]
color(img.src, {format: 'rgb'}, (_, color) => { color(img.src, {format: 'rgb'}, (_, color) => {
img.style['boxShadow'] = `0px 10px 55px 5px rgba(${color[0]},${color[1]},${color[2]},0.60)` img.style['boxShadow'] = `0px 5px 55px 5px rgba(${color[0]},${color[1]},${color[2]},0.60),0px 10px 40px 4px rgba(${color[0]},${color[1]},${color[2]},0.40)`
}) })
} }
} }
@ -24,7 +24,7 @@ export default {
<style scoped lang="sass"> <style scoped lang="sass">
div.music-box div.music-box
width: 150px width: 140px
img img
border-radius: 4px border-radius: 4px
width: 100% width: 100%

View File

@ -220,7 +220,7 @@ section.sidebar
@media(max-width: 1000px) @media(max-width: 1000px)
section.sidebar section.sidebar
width: 200px width: 200px
overflow-y: auto overflow-y: hidden
padding: 1rem 0rem 0rem 1rem padding: 1rem 0rem 0rem 1rem
@media(max-width: 800px) @media(max-width: 800px)
section.sidebar section.sidebar

View File

@ -1,21 +1,21 @@
<template> <template>
<section class="page"> <section>
<ActionBar /> <ActionBar />
<div> <div>
<MusicBox v-for="item in top" :key="item.id" :item="item" /> <MusicRow :items='items' />
</div> </div>
</section> </section>
</template> </template>
<script> <script>
import ActionBar from './ActionBar' import ActionBar from './ActionBar'
import MusicBox from '../components/MusicBox' import MusicRow from './MusicRow'
export default { export default {
name: 'HomePage', name: 'HomePage',
components: { ActionBar, MusicBox }, components: { ActionBar, MusicRow },
data: () => { data: () => {
return { return {
top: [ items: [
{ {
id: 0, id: 0,
title: 'Habiba', title: 'Habiba',
@ -33,6 +33,42 @@ export default {
title: 'Tilte', title: 'Tilte',
artist: 'Juice WRLD', artist: 'Juice WRLD',
artwork: '/static/demo/clever.jpg' artwork: '/static/demo/clever.jpg'
},
{
id: 3,
title: 'Habiba',
artist: 'Oldasinus',
artwork: '/static/demo/habiba.jpg'
},
{
id: 4,
title: 'Starboy',
artist: 'The Weeknd',
artwork: '/static/demo/starboy.png'
},
{
id: 5,
title: 'Tilte',
artist: 'Juice WRLD',
artwork: '/static/demo/clever.jpg'
},
{
id: 6,
title: 'Habiba',
artist: 'Oldasinus',
artwork: '/static/demo/habiba.jpg'
},
{
id: 7,
title: 'Starboy',
artist: 'The Weeknd',
artwork: '/static/demo/starboy.png'
},
{
id: 8,
title: 'Tilte',
artist: 'Juice WRLD',
artwork: '/static/demo/clever.jpg'
} }
] ]
} }
@ -40,8 +76,10 @@ export default {
} }
</script> </script>
<style scoped lang="sass"> <style lang="sass">
section.page section.page
padding: 1rem 2.5rem padding: 1rem 2.5rem
overflow-x: hidden
.VueCarousel-wrapper
overflow: unset
</style> </style>

View File

@ -0,0 +1,29 @@
<template>
<section>
<legend>Top music of the month</legend>
<Carousel class="carousel-custom" :paginationEnabled="false" :scrollPerPage="false" :perPageCustom="[[300, 2], [540, 3], [740, 4], [800, 3], [900, 4], [1000, 4], [1200, 5] , [1300, 6]]">
<Slide v-for="item in items" :key="item.id">
<MusicBox :item="item" />
</Slide>
</Carousel>
</section>
</template>
<script>
import { Carousel, Slide } from 'vue-carousel'
import MusicBox from '../components/MusicBox'
export default {
name: 'MusicRow',
props: ['items'],
components: { MusicBox, Carousel, Slide }
}
</script>
<style scoped lang="sass">
section
legend
font-size: 2rem
font-family: 'Roboto Slab', serif
margin: 20px 0px
</style>

View File

@ -12,5 +12,7 @@ export default {
<style lang="sass" scoped> <style lang="sass" scoped>
section section
height: 3rem display: flex
border-top: 1px solid rgba(0,0,0,0.1)
height: 4.5rem
</style> </style>