File: /var/www/vhosts/greenclinic.kz/newsite/wp-content/themes/green-clinic/assets/js/animate.js
gsap.registerPlugin(ScrollTrigger, ScrollSmoother)
if (ScrollTrigger.isTouch !== 1) {
ScrollSmoother.create({
wrapper: '.wrapper-scroll',
content: '.scroll-content',
smooth: 1.3,
effects: true
})
gsap.fromTo('.header__before', { opacity: 1 }, {
opacity: 0,
scrollTrigger: {
trigger: '.header__before',
start: 'center',
end: '320',
scrub: true
}
})
let itemsL = gsap.utils.toArray('.show-left')
itemsL.forEach(item => {
gsap.fromTo(item, { opacity: 0, x: -50 }, {
opacity: 1, x: 0,
scrollTrigger: {
trigger: item,
start: '-900',
end: '-100',
scrub: true,
ease: Power2.easeOut
}
})
})
let showL = gsap.utils.toArray('.show-left-no-scroll')
showL.forEach(item => {
gsap.fromTo(item, { opacity: 0, x: -250 }, {
opacity: 1,
x: 0,
duration: 2,
ease: Power2.easeOut
})
})
let showR = gsap.utils.toArray('.show-right-no-scroll')
showR.forEach(item => {
gsap.fromTo(item, { opacity: 0, x: 250 }, {
opacity: 1,
x: 0,
duration: 2,
ease: Power2.easeOut
})
})
let servicesR = gsap.utils.toArray('.show-right')
servicesR.forEach(item => {
gsap.fromTo(item, { opacity: 0, x: 50 }, {
opacity: 1, x: 0,
scrollTrigger: {
trigger: item,
start: '-750',
end: 'top',
scrub: true,
ease: Power2.easeOut
}
})
})
}