deployed a basic stracture for self made carousel

pull/53/head
Noisyboy-9 2019-08-12 00:32:08 +04:30
parent 0d675b9187
commit 9e19442e84
6 changed files with 76 additions and 9 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "jukebox", "name": "jukebox",
"version": "0.0.1", "version": "0.0.7",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -0,0 +1,63 @@
<template>
<div class="container">
<div class="content">
<slot></slot>
</div>
<div class="navigation__container">
<span class="navigation__left">
<svg class="navigation__icon" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 129 129" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 129 129">
<g>
<path d="m88.6,121.3c0.8,0.8 1.8,1.2 2.9,1.2s2.1-0.4 2.9-1.2c1.6-1.6 1.6-4.2 0-5.8l-51-51 51-51c1.6-1.6 1.6-4.2 0-5.8s-4.2-1.6-5.8,0l-54,53.9c-1.6,1.6-1.6,4.2 0,5.8l54,53.9z"/>
</g>
</svg>
</span>
<span class="navigation__right">
<svg class="navigation__icon" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 129 129" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 129 129">
<g>
<path d="m40.4,121.3c-0.8,0.8-1.8,1.2-2.9,1.2s-2.1-0.4-2.9-1.2c-1.6-1.6-1.6-4.2 0-5.8l51-51-51-51c-1.6-1.6-1.6-4.2 0-5.8 1.6-1.6 4.2-1.6 5.8,0l53.9,53.9c1.6,1.6 1.6,4.2 0,5.8l-53.9,53.9z"/>
</g>
</svg>
</span>
</div>
</div>
</template>
<script>
export default {}
</script>
<style lang="sass" scoped>
div.container
display: flex
flex-direction: column
padding: 1rem 2rem
div.content
display: flex
position: relative
.navigation
&__container
display: flex
flex: 1 0 100%
justify-content: space-between
padding: 1rem 2rem
&__right,
&__left
display: flex
justify-content: center
align-items: center
padding: .5rem
cursor: pointer
border-radius: 50%
&:hover
background: lighten(grey, 35)
&__icon
width: 25px
heghit: 25px
fill: #666
</style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div id="test">
<Dialog :open="aboutOpen" :onClose="closeAbout"> <Dialog :open="aboutOpen" :onClose="closeAbout">
test test
<Logo :nopadding="true"/> <Logo :nopadding="true"/>
@ -159,6 +159,8 @@ export default {
</script> </script>
<style lang="sass"> <style lang="sass">
div#test
border: 1px solid rgba(0,0,0,.05)
section.handle section.handle
position: absolute position: absolute
left: 0 left: 0

View File

@ -269,7 +269,7 @@ section.page
.action-bar .action-bar
padding: 1rem 2.5rem padding: 1rem 2.5rem
.upper-row .upper-row
padding: 1rem 2.5rem padding: 1rem 2rem
.middle-row .middle-row
display: flex display: flex
@ -277,7 +277,7 @@ section.page
flex: 1 0 50% flex: 1 0 50%
max-width: 50% max-width: 50%
&.recommend &.recommend
max-width: 30% max-width: 40%
.favourite .favourite
background: white background: white

View File

@ -6,7 +6,7 @@
<script> <script>
export default { export default {
name: 'MusicPage' name: 'MusicPage'
} }
</script> </script>

View File

@ -1,9 +1,9 @@
<template> <template>
<section class="music-row"> <section class="music-row">
<legend>{{title}}</legend> <legend>{{title}}</legend>
<section class="items"> <Carousel>
<MusicBox v-for="item in items" :key="item.id" :item="item" /> <MusicBox v-for="item in items" :key="item.id" :item="item" />
</section> </Carousel>
</section> </section>
</template> </template>
@ -11,12 +11,13 @@
import MusicBox from '../components/MusicBox' import MusicBox from '../components/MusicBox'
import Scrollbar from 'smooth-scrollbar' import Scrollbar from 'smooth-scrollbar'
import HorizontalScrollPlugin from '../utility/HorizontalScrollPlugin' import HorizontalScrollPlugin from '../utility/HorizontalScrollPlugin'
import Carousel from '../components/Carousel'
Scrollbar.use(HorizontalScrollPlugin) Scrollbar.use(HorizontalScrollPlugin)
export default { export default {
name: 'MusicRow', name: 'MusicRow',
props: ['items', 'title'], props: ['items', 'title'],
components: { MusicBox }, components: { MusicBox, Carousel },
mounted () { mounted () {
let container = this.$el.getElementsByClassName('items')[0] let container = this.$el.getElementsByClassName('items')[0]
Scrollbar.init(container, { overscrollEffect: 'bounce', continuousScrolling: true, horizontal: true }) Scrollbar.init(container, { overscrollEffect: 'bounce', continuousScrolling: true, horizontal: true })
@ -38,4 +39,5 @@ section.music-row
display: flex display: flex
.scrollbar-thumb,.scrollbar-track .scrollbar-thumb,.scrollbar-track
display: none !important display: none !important
</style> </style>