This commit is contained in:
Roman Pyrih
2025-09-05 12:39:57 +02:00
parent 7ad1eefe30
commit 2a3ed50e96
8 changed files with 151 additions and 30 deletions

View File

@@ -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',
}
)
})