Search the Community
Showing results for tags 'pin'.
-
Hi, I have a problem with pinning mainly on mobile. It's similar on desktop, but I somehow managed it, but on mobile, by scrolling on the phone, my "end" moves even though the element is already on the "pin". The faster I scroll with my finger, the more my "end" goes up, as if it doesn't hold its position. This will be perfectly illustrated in the video below https://streamable.com/5tzbzq my simple piece of code, although I have already tried many solutions. With lenis, without lenis, etc.... scrollTrigger: { trigger: ".p-single-gallery", start: "top top", end: "bottom 50%", pin: true, scrub: false, markers: true, }
-
Hi everyone, I'm working on a Next.js project using GSAP and ScrollTrigger for horizontal scrolling. At the end of the horizontal scroll, I want the last panel to split into left and right sections. The left section should pin while the right section scrolls vertically. CodePen Example : Horizontal Scroll Example StackBlitz Project : Pin Left Section and Scroll Right
-
Hello again guys, I am using a Lottie animation in my site, but I am having an issue while using it with scroll trigger the animation of moving that element and also playing the animation both are not working together. Here I am adding CodeSandbox URL for sample code. Your help is always appreciated. https://codesandbox.io/p/sandbox/react-tailwind-starter-forked-vtg6tq?layout=%7B%22sidebarPanel%22%3A%22EXPLORER%22%2C%22rootPanelGroup%22%3A%7B%22direction%22%3A%22horizontal%22%2C%22contentType%22%3A%22UNKNOWN%22%2C%22type%22%3A%22PANEL_GROUP%22%2C%22id%22%3A%22ROOT_LAYOUT%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22UNKNOWN%22%2C%22direction%22%3A%22vertical%22%2C%22id%22%3A%22clxbdqk5z00063b6mjlbkp8o8%22%2C%22sizes%22%3A%5B100%2C0%5D%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22EDITOR%22%2C%22direction%22%3A%22horizontal%22%2C%22id%22%3A%22EDITOR%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL%22%2C%22contentType%22%3A%22EDITOR%22%2C%22id%22%3A%22clxbdqk5z00023b6musdc5mfv%22%7D%5D%7D%2C%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22SHELLS%22%2C%22direction%22%3A%22horizontal%22%2C%22id%22%3A%22SHELLS%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL%22%2C%22contentType%22%3A%22SHELLS%22%2C%22id%22%3A%22clxbdqk5z00033b6m21p0u6qg%22%7D%5D%2C%22sizes%22%3A%5B100%5D%7D%5D%7D%2C%7B%22type%22%3A%22PANEL_GROUP%22%2C%22contentType%22%3A%22DEVTOOLS%22%2C%22direction%22%3A%22vertical%22%2C%22id%22%3A%22DEVTOOLS%22%2C%22panels%22%3A%5B%7B%22type%22%3A%22PANEL%22%2C%22contentType%22%3A%22DEVTOOLS%22%2C%22id%22%3A%22clxbdqk5z00053b6mrxrz1ogu%22%7D%5D%2C%22sizes%22%3A%5B100%5D%7D%5D%2C%22sizes%22%3A%5B50%2C50%5D%7D%2C%22tabbedPanels%22%3A%7B%22clxbdqk5z00023b6musdc5mfv%22%3A%7B%22tabs%22%3A%5B%7B%22id%22%3A%22clxbdqk5y00013b6mldsa1egk%22%2C%22mode%22%3A%22permanent%22%2C%22type%22%3A%22FILE%22%2C%22filepath%22%3A%22%2FREADME.md%22%2C%22state%22%3A%22IDLE%22%7D%5D%2C%22id%22%3A%22clxbdqk5z00023b6musdc5mfv%22%2C%22activeTabId%22%3A%22clxbdqk5y00013b6mldsa1egk%22%7D%2C%22clxbdqk5z00053b6mrxrz1ogu%22%3A%7B%22tabs%22%3A%5B%7B%22id%22%3A%22clxbdqk5z00043b6m5ix72z55%22%2C%22mode%22%3A%22permanent%22%2C%22type%22%3A%22UNASSIGNED_PORT%22%2C%22port%22%3A0%2C%22path%22%3A%22%2F%22%7D%5D%2C%22id%22%3A%22clxbdqk5z00053b6mrxrz1ogu%22%2C%22activeTabId%22%3A%22clxbdqk5z00043b6m5ix72z55%22%7D%2C%22clxbdqk5z00033b6m21p0u6qg%22%3A%7B%22tabs%22%3A%5B%5D%2C%22id%22%3A%22clxbdqk5z00033b6m21p0u6qg%22%7D%7D%2C%22showDevtools%22%3Atrue%2C%22showShells%22%3Afalse%2C%22showSidebar%22%3Atrue%2C%22sidebarPanelSize%22%3A15%7D
- 8 replies
-
- lottie
- scrolltrigger
-
(and 1 more)
Tagged with:
-
Help Needed: Combining Scroll-Based Div Resizing with Text and Image Animations Using GSAP
availablecode posted a topic in GSAP
My Problem: I can't make the transition between the two animations in my CodePen so that they are combined into a single smooth animation. What I'm Looking for in the Animation: Global Animation: The two animations below should be combined into a single smooth animation. Resize on Scroll: During scrolling, a div should resize until it reaches a certain size on the left side. Text Appearance: Once the size is reached, text should appear on the right side. Image Change: For each section of text, a new image should appear. Technical Details: Div Resizing: The div should gradually change size based on scrolling until it reaches a predefined width on the left side of the screen. Text Appearance: The text should appear smoothly after the div has reached its final size. Each section of text corresponds to a different scroll step. Image Change: Each new section of text should trigger the appearance of a new image. What I've Tried So Far: GSAP ScrollTrigger: I've used GSAP ScrollTrigger to try and trigger the animations on scroll. I managed to resize the div, but then I can't get the text to scroll alongside it. GSAP Timeline: I tried creating a timeline with GSAP to sequence the animations, but I'm having trouble synchronizing the text appearance and image change with the div resizing. CSS Transitions: I also tried using CSS transitions for resizing, with a fixed position. Additional Information: Sketch: I have attached a sketch to help illustrate what I'm aiming for. YouTube Link: Here is a YouTube link showing the expected result in two parts after resizing: Youtube Link :- 2 replies
-
- help
- scrolltrigger
-
(and 2 more)
Tagged with:
-
Hello everyone! We're building a website using GSAP with ScrollTrigger, ScrollTo and ScrollSmoother. We noticed that if you refresh the webpage after scrolling (so not when its on top) the pinned sections completely broke. Here's the website we're building: https://terramata.croma.site/it/ Looks like the page height is not calculated propely after a refresh. Do you have any idea how to fix this? (Tested on CHROME) Thanks!
-
ScrollTrigger - Pin sections and reveal the second layer over the first
shubhra posted a topic in GSAP
Hi, hope everyone is doing great. I would like to be able to achieve an effect that is done with scrollmagic but with scrolltrigger. It layers 2 images on top of each other and the second image is hidden. But when you scroll the second image and section is revealed on top of the first section. You can understand the effect more from this gif - I hope its not too much of a trouble and I can get a starting point here as I am not very good with code. Thank you so much. Have a great day!- 1 reply
-
- scrolltrigger
- pin
-
(and 1 more)
Tagged with:
-
fade-in Achieve Fade In Feature on Children Div inside Stacks Container
jeycraz posted a topic in GSAP
Hello to all the professionals out there, I'm working to implement the feature reveal bottom when scrolling as shown in the GSAP reveal btm demo gsap. But I want to add a feature where it implements a fade-in feature as I slowly scroll through section .panel. For example, when I'm about to scroll until the end of image 1. It will slowly reveal,(opacity:1) image 2 along with the words. I also have an additional problem in my codepen, somehow when I put them inside the parent container of display:flex,flex-direction:column,i am expecting my header(h1) will be shown as a display: block. I am not sure why it floats on top of the pin-container#container. The methods, i have used its actually looping through the toarray.panel(:not:first) but somehow, because my .panel is stacked together because of position absolute, the scrollTrigger of opacity:0-1 somehow triggers when its in contact of the #Container. If anyone reads this, please help me. THANKIUUU!!! Really thank you for your precious times!! -
scrolltrigger ScrollTrigger: update horizontal scroll pin on window resize
Mister Pixel posted a topic in GSAP
Hi GSAP community, Can anyone help me with the following issue? I'm using ScrollTrigger to horizontally scroll/pin a few slides. The number of pixels to scroll (x) is a dynamic value: the overflow of the row with slides compared to it's parent. This works perfectly on the initial load of the page. But if you resize the viewport to a point where the parent narrows the pin end point gets off. I made a minimal demo to reproduce the issue. Resize the window to a point where the parent/container (blue border) narrows. You'll see that the last slide (the end of the scrub) won't line up with the parent container (blue border) anymore. I assume my function to calculate the overflow is wrong. Any help is greatly appreciated!- 2 replies
-
- horizontal scroll
- resize
-
(and 1 more)
Tagged with:
-
Hi there, I am new to ScrollTrigger and was trying to create a simple scrollytelling page as shown in the codepen below. The pinning of sections 1 and 3 works well. However, for section 2, pinning didn't work and it just scrolled passed without pausing. Expected behavior: On enter section 2, it is supposed to be pinned like the previous section. After 2 scrolls, unpin and then proceed to the next section. Any advice is greatly appreciated. Thanks!
-
scrolltrigger ScrollTrigger Pin Spacer creates additional height at the bottom
ysk posted a topic in GSAP
Hello, I have a simple implementation of ScrollTrigger that pins a heading while scrolling until the next one comes in. All nice and good but I'm getting extra space at the bottom. Can someone help me please. Thank you! -
Hello friends! I have a very specific issue with a project I'm working on. There are multiple sections that get loaded in dynamically and to be rearranged by the end-users, hence the foreach loop I've used on the different types of sections. I've attached a small demo with the exact same problem I'm facing on the project. I would love to hear your input on this. Thanks!
- 2 replies
-
- bug
- scrolltrigger
-
(and 1 more)
Tagged with:
-
Hi all ? https://codepen.io/mikhail21990/pen/QWPEeRP I use two pin animations In the first, the block stands still and the photo is scrolled from bottom to top from the top of the text. in the reviews block, the block also stands still while the animation is running, containers with reviews should move from right to left. Separately, the animations work as they should, but together for some reason an incomprehensible flickering effect occurs. Tell me what could be the problem ?
-
I would like to create a pin animation like https://www.scalvinimarmi.it/en/
kaii299 posted a topic in GSAP
My pin is not starting at the correct point. Please help -
How to fix the reverse animation of circle dots using scrolltrigger?
gsapmonkey posted a topic in GSAP
Hi, I am just starting on gsap from last few weeks. I have a simple animation, I am trying to figure out from last few days. I have a circle and dots on the circle radius. Requirement is to scale the dots when the screen enters the section and when the user scrolls each dot should get a border indicating different content (which means a text change and image change). The issue I am facing is the borders around circle are able to appear correctly when scrolling down. But when scrolling up, the borders around the dots are not disappearing correctly. Only 3 dots out of 5 disappear when it reaches the first content, where 4 should disappear. I am not sure if I am having the right approach. Any help in the right directly is greatly appreciated. thanks in advance! Codepen attached.- 2 replies
-
- scrolltrigger
- pin
- (and 4 more)
-
Hi all, thank you in advance for checking out my post! I have a video reference of what I'm trying to achieve here: https://assets.codepen.io/191332/comp.mp4 And here is the Codepen demo I have started. Note: Please view Codepen in a new tab / window and view in Full mode or increase the Codepen panel height to have a better visual of what is going on, ha! I'm stuck on understanding a few things in my forEach loop of text blocks (right column)... As noted in purple for each block, as the video shows, I'm trying to expand / show the first text block and collapse the other two. Then as I scroll into the second block, collapse the first and last block. As I scroll into the last block, collapse the prior two blocks, and keep this block expanded as you continue to scroll down the page. And two more things: Is there a way to get the current self.progress / percent value for each block so I can animate their progress bar? This is the purple vertical line in the video example that grows / shrinks based on current scroll / scrub. For the 3 text bocks, is it possible to pin or hold longer on the first block, say 50% of the timeline progress, and then the other two blocks for 25% each? Hope this demo and video make enough sense and any help to point me in the right direction is beyond appreciated! Thank you all so much!
- 3 replies
-
- scrolltrigger
- pin
-
(and 3 more)
Tagged with:
-
Hello, I'm trying to create an animation with "scrollTrigger + pin" with 2 cards ( overlap + scale on scroll ). The animation works fine but in the end I have way too much empty space and I don't know how to fix this. I put 2 images to explain the problem and the desired result. Demo https://codepen.io/paallaire/pen/ZEZzarJ Visual Bug Expected
- 3 replies
-
- scrolltrigger
- pin
-
(and 1 more)
Tagged with:
-
I have a pinned section in my page, which makes the other Scroll triggers I have in different child components have their starting positions inaccurate. I tried refreshing the Scroll trigger(using ScrollTrigger.refresh()) in the main page(file) but the issue remained. Also I want to know if there is a way I can pass down an instance of Scroll trigger and Gsap to my other components, so If i refresh that one instance, it updates everywhere, or is there a better way to handle having multiple gsap and scroll triggers in different components but still being able to control them from the main page? Also I want to know if the better approach is to write all my animations in one useEffect with all the jsx in one page(file) or have some of the animations for different parts of the page as components which include their respective jsx. So pretty much everything in one page or components style ? I ask this because the component approach has been a headache for me, because one way or another the starting points end up inaccurate. I would apperciate if someone could help with a direction I could take. This is a simplified version https://stackblitz.com/edit/vite-react-tailwind-fpc1wz?file=src/App.jsx where I tried to refresh a child component but it didn't work
- 2 replies
-
- react
- components
-
(and 3 more)
Tagged with:
-
What i need is i want to pin the red section until scrolling inside the blue section. But it is not working properly getting blinking effect. Using next js useEffect(() => { gsap.registerPlugin(ScrollTrigger); ScrollTrigger.create({ trigger: '.sect', start: 'top top', // pinType: 'fixed', pin: true, // preventOverlaps: true, endTrigger: '.section4', markers: true }); }); JSX Code <div className="relative bg-[#0093e8b8]"> <Object3d /> #red color section <div className="h-screen section2"></div> <div className="h-screen section3"></div> <div className="h-screen section4"></div> </div>
-
Hello everyone, can you tell me how to create the same effect with pin, only my first block is similar, and then there are examples of work: Here is a link to what I want to receive: https://airbagstudio.it/en/methodology
-
import React, { useEffect, useRef } from 'react'; import './services.css'; import { gsap } from 'gsap/all'; import { ScrollTrigger } from 'gsap/all'; gsap.registerPlugin(ScrollTrigger); const Services2 = () => { const staticRef = useRef(null); const scrollRef = useRef(null); const componentRef = useRef(null); let componentHeight; useEffect(() => { // Access the height of the component using ref componentHeight = componentRef.current.clientHeight; console.log('Component Height:', componentHeight); // You can perform further actions with the height, such as updating state or triggering animations }, []); useEffect(() => { const staticPart = staticRef.current; const scrollPart = scrollRef.current; gsap.timeline({ scrollTrigger: { trigger: scrollPart, start: 'top 75px', end: `bottom ${componentHeight}`, pin: staticPart, scrub: true, onEnter: () => console.log('Pin starts'), onLeave: () => console.log('Pin ends'), }, }); }, []); return ( <div> <div style={{ display: 'flex', justifyContent: 'space-evenly', margin: '10px', }} > <div ref={componentRef} style={{ width: '40%' }}> <div style={{ width: '100%', height: '400px' }} ref={staticRef}> hi, my name is yosh </div> </div> <div style={{ width: '40%' }} ref={scrollRef}> <div style={{ height: '400px' }}>yes</div> <div style={{ height: '400px' }}>yes</div> <div style={{ height: '400px' }}>yes</div> <div style={{ height: '400px' }}>yes</div> </div> </div> </div> ); }; export default Services2;
- 2 replies
-
- pin
- scrolltriger
-
(and 2 more)
Tagged with:
-
Hi, newbie here. I'm desperately trying to figure out how to pin the second div to the top of the screen, beneath the first div, then releasing it as the div above it ends. Just like - https://jeongsteph.design/ I've tried toggleclass too but I just can't get it and I don't know where I'm going wrong. Please help me Thank you
-
Hi, I'm having some issues when I tried to hide an element with height initially and on scroll add a class to make the height auto. The problem is, when I add the class and use the auto height CSS, it's not adjusting the pin height. If I resize the browser a bit, it works. Because of that, my next element's are sometimes triggering before reaching the top or starting the scrollTrigger. In summary, I have 2 problem- 1. Auto adjust pin height while change the element height. 2. All element should start 100px before reaching the top. I think this issue will fix if we can fix the first issue. Ant help would be appreciated, Many Thanks, Sajidul
- 9 replies
-
- scrolltrigger
- gsap
-
(and 1 more)
Tagged with:
-
Hello All! I am facing a weird issue that I haven't seen anyone else encounter. Or maybe I was just searching for the wrong terms. \ Basically I have a Next.js instance where I am trying to pin a box to a scroll area... pretty straight forward. However, once the pinning is initiated, the box jumps down to a position where it should end up once the scroll is over. Im gonna attach a recording to explain the issue. Any help would be appreciated. here is my code: "use client"; import { useEffect, useRef } from "react"; import gsap from "gsap"; import ScrollTrigger from "gsap/dist/ScrollTrigger"; gsap.registerPlugin(ScrollTrigger); export default function Home() { const pinContainer = useRef(null); useEffect(() => { initScrollTrigger(); }, []); const initScrollTrigger = () => { gsap.to(".block", { scrollTrigger: { trigger: ".block", start: "top center", end: "top center-=300", pin: true, scrub: true, markers: true, }, x: 400, }); }; return ( <main> <div className="content" style={{ paddingRight: 100 }}> <h1>Content Content Content Content Content Content Content Content Content Content Content Content Content Content </h1> <h1>Content Content Content Content Content Content Content Content Content Content Content Content Content Content </h1> <h1>Content Content Content Content Content Content Content Content Content Content Content Content Content Content </h1> <div className="block h-64 bg-black" ref={pinContainer} style={{ height: 200, background: "red", display: "inline-block" }}> test test test{" "} </div> <h1>Content Content Content Content Content Content Content Content Content Content Content Content Content Content </h1> <h1>Content Content Content Content Content Content Content Content Content Content Content Content Content Content </h1> <h1>Content Content Content Content Content Content Content Content Content Content Content Content Content Content </h1> </div> </main> ); } Screen Recording 2024-01-10 at 20.37.001.mp4
-
Hey Greensock! I was just wondering if I could get some assistance on my project. I want to create animation letter that appear one by one when scrolling, right now this is my progress https://stackblitz.com/edit/react-xogadh?file=src%2FApp.js I kinda hope when user scroll to the second section they have to scroll one by one/slowly to make the all letters appears. I've tried using pin and adding values "end" more but it makes section after them got pushed down and it some breakpoints it make the animation section got scrolled too. is this the right way to achieve it? Thank you for any help. Sorry for my english
-
Good evening! I'm in the process of creating a simple scrollytelling page with full-screen cards that scroll. The cards are broken up into sections where the background of the cards fade, and where one background can serve multiple grouped cards. I'm using the pin property in ScrollTrigger to have the stacked backgrounds of a section stay fixed until the next section reaches it. However, I'm experiencing some trouble upon reloading the page in Chrome while being scrolled down beyond the first section; the backgrounds of the first section appears to get stuck. The same issue occurs upon resizing the window without reloading. I have not been able to reproduce this behavior in Firefox nor Safari. I have recorded a video of the issue here: https://streamable.com/wiiyhx I'm very new to JavaScript and GSAP (thank you for making it so approachable!), so I'm probably committing more than one mistake in this pen, but I'm not able to spot what exactly is happening here. Could my CSS or template literals be causing issues with GSAP? Or maybe my logic is just no good? Thank you for any advice you may give!