Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const blocks = [
- {
- elements: [
- {
- $element: $('.main__luggage'),
- durationCoeff: 0.6,
- params: [{autoAlpha: 0}],
- },
- {
- $element: $('.main__man'),
- durationCoeff: 0.6,
- params: [{autoAlpha: 0}],
- },
- {
- $element: $('.main__woman'),
- durationCoeff: 0.6,
- params: [{autoAlpha: 0}],
- },
- {
- $element: $('.main__title'),
- durationCoeff: 1,
- params: [{y: -500}],
- },
- {
- $element: $('.main__subtitle'),
- durationCoeff: 1,
- params: [{y: -500}],
- },
- {
- $element: $('.main__item').eq(0),
- durationCoeff: 1,
- params: [{y: -700}],
- },
- {
- $element: $('.main__item').eq(1),
- durationCoeff: 1,
- params: [{y: -700}],
- },
- {
- $element: $('.main__item').eq(2),
- durationCoeff: 1,
- params: [{y: -700}],
- },
- ],
- start: 0,
- scrollDuration: 300,
- },
- {
- elements: [
- {
- $element: vars.$mainCircle,
- durationCoeff: 1,
- params: [{
- bottom: innerHeight + vw(424),
- ease: Power0.easeNone,
- }],
- },
- ],
- start: 300,
- scrollDuration: 2000,
- },
- {
- elements: [
- {
- $element: $('.main__text-image'),
- durationCoeff: 1,
- params: [{
- top: '-100%',
- ease: Power0.easeNone,
- }],
- },
- ],
- start: 2300 / 7 * 3,
- scrollDuration: 2300 / 7 * 4,
- },
- ];
- function animateScroll() {
- blocks.forEach(({elements, scrollDuration, start}) => {
- let tween = new TimelineMax();
- elements.forEach(({$element, durationCoeff, params}) => {
- tween = tween.to($element, 1 * durationCoeff, ...params, 0);
- });
- new ScrollMagic.Scene({
- triggerElement: '#trigger',
- duration: scrollDuration,
- offset: start,
- })
- .setTween(tween)
- .addTo(controller);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement