-
-
Save tiansial/64f96c068c4415f151fba1d8d4cc1d37 to your computer and use it in GitHub Desktop.
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
/*eslint no-unused-vars: ["error", { "varsIgnorePattern": "homeSwiper" }]*/ | |
import Swiper from 'swiper'; | |
import { TweenMax, EasePack, TimelineMax } from 'gsap'; // eslint-disable-line | |
import Barba from 'barba.js/dist/barba.min'; | |
export default { | |
init() { | |
const home = Barba.BaseView.extend({ | |
namespace: 'home', | |
onEnter: function() { | |
}, | |
onEnterCompleted: function() { | |
var homepageSlider = document.getElementById('homepageSwiper'), | |
homepageCardsTimeline = new TimelineMax({ paused: true }); | |
homepageCardsTimeline | |
.staggerTo('.homepage-selects--each', 1.2, { | |
delay: 0.3, | |
css: { | |
marginTop: 80, | |
}, | |
ease:Power3.easeOut, | |
}, .030);// eslint-disable-line | |
// build homepage slider | |
var homeSwiper = new Swiper (homepageSlider, { | |
slidesPerView: 1, | |
speed: 1000, | |
loop: false, | |
scrollBar: false, | |
centeredSlides: true, | |
autoplay: true, | |
observer: true, | |
observeParents: true, | |
navigation: { | |
nextEl: '.homepage__swiper-next', | |
prevEl: '.homepage__swiper-prev', | |
}, | |
}); | |
console.log('test'); | |
}, | |
onLeave: function() { | |
}, | |
onLeaveCompleted: function() { | |
// The Container has just been removed from the DOM. | |
}, | |
}); | |
home.init(); | |
}, | |
finalize() { | |
// JavaScript to be fired on the home page, after the init JS | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment