-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace frontpage hero images with image slider
Implement Swiper
- Loading branch information
Showing
13 changed files
with
246 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,78 @@ | ||
<template> | ||
<div> | ||
<div | ||
id="hero" | ||
class="flex w-full mx-auto mt-16 bg-right bg-cover md:pt-0 md:items-center" | ||
> | ||
<swiper id="hero" ref="mySwiper" :options="swiperOption"> | ||
<swiper-slide | ||
><img alt="Image slider slide #1" src="~assets/images/Hero.jpg" /> | ||
<div | ||
class="flex flex-col items-start justify-center w-full mx-auto tracking-wide lg:w-1/2" | ||
> | ||
<span | ||
class="w-full p-4 mt-4 text-center text-white bg-black text-md lg:text-2xl lg:-mt-64" | ||
> | ||
Modern Pillow Sample Set | ||
</span> | ||
</div> | ||
</swiper-slide> | ||
<swiper-slide | ||
><img alt="Image slider slide #2" src="~assets/images/Hero2.jpg" /> | ||
<div | ||
class="flex flex-col items-start justify-center w-full mx-auto tracking-wide lg:w-1/2" | ||
> | ||
<span | ||
class="w-full p-4 mt-4 text-center text-white bg-black text-md lg:text-2xl lg:-mt-64" | ||
> | ||
Modern Interior Sample | ||
</span> | ||
</div> | ||
</swiper-slide> | ||
<div | ||
class="flex flex-col items-start justify-center w-full px-6 tracking-wide lg:w-1/2" | ||
> | ||
<span class="p-4 my-4 text-2xl text-white bg-black rounded-lg"> | ||
Modern Pillow Sample Set | ||
</span> | ||
</div> | ||
</div> | ||
slot="button-prev" | ||
class="swiper-button-prev" | ||
@click="swiper.slidePrev(1000, false)" | ||
></div> | ||
<div | ||
slot="button-next" | ||
class="swiper-button-next" | ||
@click="swiper.slideNext(1000, false)" | ||
></div> | ||
</swiper> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { Swiper, SwiperSlide } from 'vue-awesome-swiper' | ||
import 'swiper/swiper-bundle.min.css' | ||
export default { | ||
name: 'Hero', | ||
components: { | ||
Swiper, | ||
SwiperSlide, | ||
}, | ||
data() { | ||
return { | ||
swiperOption: { | ||
navigation: { | ||
nextEl: '.swiper-button-next', | ||
prevEl: '.swiper-button-prev', | ||
}, | ||
}, | ||
} | ||
}, | ||
computed: { | ||
swiper() { | ||
return this.$refs.mySwiper.$swiper | ||
}, | ||
}, | ||
mounted() { | ||
this.swiper.slideTo(2, 2000, false) | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
#hero { | ||
background-image: url('~assets/images/Hero.jpg'); | ||
height: 24rem; | ||
max-width: 1350px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
af3478f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: