mirror of
https://github.com/tachiyomiorg/website.git
synced 2024-12-21 07:31:58 +01:00
Add Carousel components (#75)
* Add carousel components * Fix "Carousel.vue" indentation * Fix "CarouselItem.vue" indentation
This commit is contained in:
parent
455f45161d
commit
2c797d433f
46
src/.vuepress/components/Carousel.vue
Normal file
46
src/.vuepress/components/Carousel.vue
Normal file
@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="carousel-root">
|
||||
<div class="carousel" v-bind:id="name">
|
||||
<slot />
|
||||
</div>
|
||||
<script>
|
||||
var config = {{ config }};
|
||||
new Flickity("#{{ name }}", config)
|
||||
</script>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
config: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return {
|
||||
adaptiveHeight: true,
|
||||
wrapAround: true,
|
||||
pageDots: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.carousel {
|
||||
background: #F0F4F8;
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
.flickity-button {
|
||||
position: absolute;
|
||||
background: hsla(0,0%,100%,.75);
|
||||
border: none;
|
||||
color: rgba(44, 62, 80);
|
||||
}
|
||||
</style>
|
25
src/.vuepress/components/CarouselItem.vue
Normal file
25
src/.vuepress/components/CarouselItem.vue
Normal file
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<div class="carousel-cell" v-bind:id="name">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "carousel-item",
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
default: "carousel-cell"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.carousel-cell {
|
||||
width: 100%;
|
||||
margin-right: 16px;
|
||||
margin-left: 16px;
|
||||
}
|
||||
</style>
|
@ -5,7 +5,6 @@ module.exports = {
|
||||
head: [
|
||||
['script', { src: 'https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js'} , ''],
|
||||
['link', { rel: "stylesheet", type: "text/css", href: 'https://unpkg.com/flickity@2/dist/flickity.min.css'} , ''],
|
||||
['link', { rel: "stylesheet", type: "text/css", href: '/assets/css/carousel.css'} , '']
|
||||
],
|
||||
themeConfig: {
|
||||
repo: 'inorichi/tachiyomi',
|
||||
|
@ -1,17 +0,0 @@
|
||||
.carousel {
|
||||
background: #F0F4F8;
|
||||
border-radius: 1em;
|
||||
}
|
||||
|
||||
.carousel-cell {
|
||||
width: 100%; /* full width */
|
||||
margin-right: 16px;
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
.flickity-button {
|
||||
position: absolute;
|
||||
background: hsla(0,0%,100%,.75);
|
||||
border: none;
|
||||
color: rgba(44, 62, 80);
|
||||
}
|
Loading…
Reference in New Issue
Block a user