I'm sorry, but I can't recreate it.
I think the best I can do is to iterate the fact, removing the logic that changes the "--scalefactor" that represents the zoom value takes care of the issue (as shown in the video) .
... but I can't get rid of the scale-factor. Otherwise the site wouldn't be responsive.
Is there any way to delay GSAP doing its thing?
I've tried the useLayoutEffect as seen above.
I've also tried conditionalising the useEffect, that houses the GSAP Logic with a pageHeightIsSteady variable, that is set true, right after I call:
const scaleFactor = currentBodyWidth / baseWidth
body.style.setProperty('--scalefactor', (scaleFactor < 1) ? scaleFactor.toString() : "1")
// GSAP Scroll Animation
React.useEffect(() => {
if (pageHeightIsSteady) {
//@ts-ignore
gsap.registerPlugin(ScrollTrigger);
gsap.to(".contentCardLeft", {
x: 500,
y: 500,
scale: 0.6, // scale of card
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
markers: true,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// Email
gsap.to(".sourceIconMail", {
x: 580,
y: 650,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// YouTube
gsap.to(".sourceIconYoutube", {
x: 450,
y: 650,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// Twitter
gsap.to(".sourceIconTwitter", {
x: 250,
y: 600,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// Wifi
gsap.to(".sourceIconRss", {
x: 550,
y: 400,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// User
gsap.to(".sourceIconPodcast", {
x: 400,
y: 250,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// Pix art
gsap.to(".sourceIconPinterest", {
x: 250,
y: 350,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// right side
// cards
gsap.to(".contentCardRight", {
x: -430,
y: 550,
scale: 0.6, // scale of card
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// Vimeo
gsap.to(".sourceIconVimeo", {
x: -450,
y: 670,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// Instagram
gsap.to(".sourceIconInstagram", {
x: -550,
y: 650,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// // arrow down
gsap.to(".sourceIconPocket", {
x: -650,
y: 500,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
//
gsap.to(".sourceIconReddit", {
x: -450,
y: 200,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
// // stat icon
gsap.to(".sourceIconFeedly", {
x: -250,
y: 450,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
gsap.to(".sourceIconBookmark", {
x: -350,
y: 280,
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iconAnimationStart}%`,
end: `+=${animationEndValues.iconAnimationEnd}%`,
scrub: 1, // animation - max speed bound
// scrub: true // speed of animation equal to scroll speed
},
});
gsap.to(".iPhone", {
scale: 0.8, // scale of phone
scrollTrigger: {
trigger: ".PlasmicBringItAllTogetherSection_root",
start: `-=${animationStartValues.iphoneAnimationStart}%`,
end: `+=${animationEndValues.iphoneAnimationEnd}%`,
scrub: 1, // animation - max speed bound
markers: {startColor: "purple", endColor: "fuchsia"}
// scrub: true // speed of animation equal to scroll speed
},
});
}
},[pageHeightIsSteady]);
You can also have a look at the live page here:
https://www.hubhub.app/
Sth else, that I want to note is that the two cards often have odd positions - but only on the live page ?♂️