.avif)
Stay Ahead of Every Conversation.
Get productivity tips, email management insights, and the latest updates.
Thank you for subscribing!
Something went wrong. Please try again.
<link rel="stylesheet" href="https://unpkg.com/lenis@1.3.15/dist/lenis.css" />
<script src="https://unpkg.com/lenis@1.3.15/dist/lenis.min.js"></script>
<script>
const lenis = new Lenis({ duration: 1.4 });
lenis.on('scroll', ScrollTrigger.update);
gsap.ticker.add((time) => {
lenis.raf(time * 1000);
});
gsap.ticker.lagSmoothing(0);
</script><script>
document.addEventListener('DOMContentLoaded', () => {
gsap.registerPlugin(ScrollTrigger);
const mm = gsap.matchMedia();
mm.add(
{
mobile: '(max-width: 479px)',
mobileLandscape: '(min-width: 480px) and (max-width: 767px)',
tablet: '(min-width: 768px) and (max-width: 991px)',
desktop: '(min-width: 992px)',
},
(context) => {
const { mobile, mobileLandscape, tablet, desktop } = context.conditions;
document.querySelectorAll('[data-parallax="trigger"]').forEach((trigger) => {
// Disable parallax on selected breakpoints
const disable = trigger.getAttribute('data-parallax-disable');
if ((disable === 'mobile' && mobile) || (disable === 'mobileLandscape' && mobileLandscape) || (disable === 'tablet' && tablet) || (disable === 'desktop' && desktop)) {
return;
}
// Target element
const target = trigger.querySelector('[data-parallax="target"]') || trigger;
// Direction
const direction = trigger.getAttribute('data-parallax-direction') || 'vertical';
const property = direction === 'horizontal' ? 'xPercent' : 'yPercent';
// Parallax values
const startValue = parseFloat(trigger.getAttribute('data-parallax-start')) || 0;
const endValue = parseFloat(trigger.getAttribute('data-parallax-end')) || -15;
// Scrub
const scrubAttribute = trigger.getAttribute('data-parallax-scrub');
const scrub = scrubAttribute !== null ? parseFloat(scrubAttribute) : true;
// ScrollTrigger positions
const scrollStart = trigger.getAttribute('data-parallax-scroll-start') || 'top bottom';
const scrollEnd = trigger.getAttribute('data-parallax-scroll-end') || 'bottom top';
gsap.fromTo(
target,
{
[property]: startValue,
},
{
[property]: endValue,
ease: 'none',
scrollTrigger: {
trigger: trigger,
start: `clamp(${scrollStart})`,
end: `clamp(${scrollEnd})`,
scrub: scrub,
invalidateOnRefresh: true,
},
},
);
});
ScrollTrigger.refresh();
},
);
});
</script>The custom GSAP script controls the image parallax effect and connects Lenis smooth scrolling with GSAP's animation ticker. Edit the script in Project Settings → Custom Code → Footer Code. The GSAP and ScrollTrigger libraries must load before this script runs.
In the Designer, add the attribute data-parallax="trigger" to the wrapper that controls the scroll animation. Add data-parallax="target" to the child element you want to move. If no target is provided, the trigger wrapper itself is animated.
Wrapper attribute:
data-parallax="trigger"
Optional child target:
data-parallax="target"Use data-parallax-direction to choose the movement axis: vertical (default) or horizontal. Set data-parallax-start and data-parallax-end to control the starting and ending percentage offsets. The defaults are 0 and -15. Negative values move upward or left; positive values move downward or right.
data-parallax-direction="vertical"
data-parallax-start="0"
data-parallax-end="-15"
For horizontal movement:
data-parallax-direction="horizontal"data-parallax-scrub controls how closely the animation follows scroll progress. Use true for a direct link to scrolling, or a number such as 1 or 0.5 for smoothing. data-parallax-scroll-start and data-parallax-scroll-end set the ScrollTrigger start and end positions. Their defaults are top bottom and bottom top.
data-parallax-scrub="1"
data-parallax-scroll-start="top bottom"
data-parallax-scroll-end="bottom top"
Remove data-parallax-scrub to use the script default (true). Numeric scrub values are supported.Use data-parallax-disable to skip the effect at one responsive breakpoint. Accepted values are mobile, mobileLandscape, tablet, and desktop. The breakpoint ranges are defined in the script's gsap.matchMedia() configuration.
data-parallax-disable="mobile"
data-parallax-disable="mobileLandscape"
data-parallax-disable="tablet"
data-parallax-disable="desktop"
Use one value per trigger element.The Lenis duration is set to 1.4 in the script. A higher duration gives scrolling a slower, smoother feel; a lower duration makes it respond more quickly. Lenis updates ScrollTrigger and uses the GSAP ticker to keep both systems synchronized.
const lenis = new Lenis({ duration: 1.4 });
lenis.on("scroll", ScrollTrigger.update);
gsap.ticker.add((time) => {
lenis.raf(time * 1000);
});
gsap.ticker.lagSmoothing(0);After changing values, preview the page at desktop, tablet, and mobile widths. Keep the data attribute names unchanged unless you also update the selectors in the script.
Open the CMS panel in Webflow and choose the collection you want to edit: Works, Insights, or Services. Select an existing item to update its title, description, images, category, and other fields.
To add content, choose New Item, complete the required fields, and set a clear name and URL slug. Use the Rich Text field for article or project body content, then save the item.
Preview the item before publishing. Check its text, images, and links on the generated collection page. Publish the item to make the changes live.
Open the Variables panel in the Designer to manage shared colors, font families, and other design values. Edit an existing variable to update every element that uses it, or create a new variable when you need a reusable value.
To apply a variable, select an element, open the Style panel, and choose the variable from the relevant color, typography, or size control. Reuse the existing variables wherever possible to keep pages consistent.
To add or manage fonts, open the site's Fonts settings and add a font you are licensed to use on the web. Then select a text element and choose the font in the Style panel's Typography controls. When a font-family variable is in use, update that variable to keep the site's typography consistent.