Save
This commit is contained in:
@@ -36,6 +36,26 @@ jQuery(function ($) {
|
||||
|
||||
$(window).on('resize orientationchange', () => ScrollTrigger.refresh())
|
||||
}
|
||||
|
||||
if ($(window).width() <= 576) {
|
||||
const box = document.querySelector('.box-1')
|
||||
const col2 = box.querySelector('.col-2')
|
||||
const row = box.querySelector('.row')
|
||||
|
||||
const moveX = row.offsetLeft - col2.offsetLeft - 30
|
||||
gsap.to(col2, {
|
||||
x: moveX,
|
||||
ease: 'none',
|
||||
scrollTrigger: {
|
||||
trigger: box,
|
||||
start: 'top-=15px top',
|
||||
end: () => `+=${box.offsetHeight}`,
|
||||
scrub: true,
|
||||
pin: true,
|
||||
markers: false,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -134,3 +154,51 @@ jQuery(function ($) {
|
||||
$('body').toggleClass('no-scroll')
|
||||
})
|
||||
})
|
||||
|
||||
jQuery(function ($) {
|
||||
document.querySelectorAll('.animate-text').forEach((block) => {
|
||||
gsap.fromTo(
|
||||
block.querySelectorAll('.word .char'),
|
||||
{
|
||||
opacity: 0.2,
|
||||
},
|
||||
{
|
||||
scrollTrigger: {
|
||||
trigger: block,
|
||||
start: 'top 80%',
|
||||
toggleActions: 'play none none none',
|
||||
},
|
||||
opacity: 1,
|
||||
duration: 0.3,
|
||||
stagger: {
|
||||
each: 0.02,
|
||||
from: 'start',
|
||||
},
|
||||
ease: 'power2.out',
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
jQuery(function ($) {
|
||||
gsap.fromTo(
|
||||
document.querySelectorAll('.animate-text-linear .word .char'),
|
||||
{
|
||||
opacity: 0.2,
|
||||
},
|
||||
{
|
||||
scrollTrigger: {
|
||||
trigger: '.animate-text-linear',
|
||||
start: 'top 80%',
|
||||
toggleActions: 'play none none none',
|
||||
},
|
||||
opacity: 1,
|
||||
duration: 0.25,
|
||||
stagger: {
|
||||
each: 0.015,
|
||||
from: 'start',
|
||||
},
|
||||
ease: 'power2.out',
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user