stcode
stcode
KPCKevin Powell - Community
Created by DoContra on 8/7/2023 in #front-end
Wordpress
depends on the project
2 replies
KPCKevin Powell - Community
Created by stcode on 7/31/2023 in #front-end
Intersection Observer Animations feels jumpy
const observerOptions = {
root: null,
threshold: 0.5,
rootMargin: '0px 0px -50px 0px',
};

const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('in-view');
observer.unobserve(entry.target);
}
});
}, observerOptions);

const sections = Array.from(document.getElementsByClassName('section'));
for (const section of sections) {
const fadeups = section.getElementsByClassName('fade-delay');
for (let count = 0; count < fadeups.length; count++) {
fadeups[count].setAttribute('style', `transition-delay: ${count * 0.25}s`);
}
observer.observe(section);
}
const observerOptions = {
root: null,
threshold: 0.5,
rootMargin: '0px 0px -50px 0px',
};

const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.classList.add('in-view');
observer.unobserve(entry.target);
}
});
}, observerOptions);

const sections = Array.from(document.getElementsByClassName('section'));
for (const section of sections) {
const fadeups = section.getElementsByClassName('fade-delay');
for (let count = 0; count < fadeups.length; count++) {
fadeups[count].setAttribute('style', `transition-delay: ${count * 0.25}s`);
}
observer.observe(section);
}

this is the setting for intersection observer
2 replies
KPCKevin Powell - Community
Created by stcode on 12/16/2022 in #front-end
How can i combine these arrays elements together gsap, scroll trigger, vanilla js
I want to animated two thing in the same time but both of them need to toggle a class in the same time
12 replies
KPCKevin Powell - Community
Created by stcode on 12/16/2022 in #front-end
How can i combine these arrays elements together gsap, scroll trigger, vanilla js
however I need both of them from index[0] to work together
12 replies
KPCKevin Powell - Community
Created by stcode on 12/16/2022 in #front-end
How can i combine these arrays elements together gsap, scroll trigger, vanilla js
Thank you for the information
12 replies