Jump to content
Search Community

Toso last won the day on December 26 2023

Toso had the most liked content!

Toso

Members
  • Posts

    159
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Toso

  1. Hi everyone,

    I hope you're all doing great!

     

    I'm creating a magnet effect for the cursor, and I've run into a small issue. Everything works perfectly until I add ScrollSmoother to the mix.

     

    The issue arises when I try to calculate the bounding rectangles of the buttons (`btns`). It seems that the calculations go wrong for buttons that are not initially within the viewport. I suspect that this discrepancy might be due to the way the `getBoundingClientRect` function captures the positions of the buttons before the scrolling comes to a complete stop.

     

    you can  comment the smoother part and everything will work fine 

     

     

    Thanks in advance for your help.

     

     

     

    See the Pen gOyxYWa?editors=0011 by ahmed-attia (@ahmed-attia) on CodePen

  2. here is a quick one you can add any effect you want or play with the other options,

    just 5-10 min to take a look at the seamlessloop documentation and you're ready 

    See the Pen RwOpyVX?editors=0011 by ahmed-attia (@ahmed-attia) on CodePen

     

     

    you can check Carl's courses here and GSAP3 Express is free by the way 

     

     

    https://www.creativecodingclub.com/bundles/creative-coding-club

    https://www.creativecodingclub.com/courses/FreeGSAP3Express

    • Like 3
  3. 2 hours ago, amjad_barchini said:

    thank you so much but after a lot of searching I think only the three.js can build like this bubbles or vanilla javascript but it is too hard

     

    with threejs you are making it 10x harder for yourself since you will also need a physics engine with threejs like Rapier or cannon, creating it with a framework like react for example. you will need to study also extra stuff like react three fiber, react three drei, react three rapier / cannon 

     

    i think Rodrigo gave you the best option here to use a physics engine directly something like this one i created with Matter it was much simpler to do it compared to trying to add physics with threejs 

     

    https://balls-orcin.vercel.app/

    you can grab them and test the zero gravity btn 

    • Like 1
  4. thank you glad you like that switch button 🙏 🫡

    I found an old demo  that may help, i cleaned all unnecessary code and created a repo 

     

    https://github.com/Toosoo/laptop

     

     

    ps: the demo was created when I started Bruon's course so i left the i frame of his website as we did in the lesson  and  added the scrollTrigger animation to it 

    i would highly recommend checking the course   https://threejs-journey.com/

     

     

    hope it helps 

    • Like 1
  5. hi @Ev1lMush unfortunately, the demo is not loading but i would recommend using only scrollTrigger to do all your scroll-related animations for you, scrollControls was killing me also, and I didn't find a clear fix for making them both work together in most cases 

    drei is great but still not enough to use it alone for everything 

     

    something like where i was trying to make drei scroll and scrolltrigger work together but in the end, i only used scrolltrigger maybe its different in your case idk what you are building 

    https://garden-self.vercel.app/

    (Hit a refresh if it doesn't work it was a demo for testing so it's a mess and dusty)

     

    I am not R3F expert so keep looking for a solution that suits you 

     

    also since you are using react you  can check the new useGSAP() its a replacement for useEffect and useLayouteffect 

    https://gsap.com/resources/React#usegsap-hook-

     

     

    and here are some templates you can fork one , for me its easier to work with React on stackblitz 

    https://stackblitz.com/@GreenSockLearning/collections

     

     

     

    • Like 1
    • Thanks 1
  6. hi @AmanVerma in your demo  i would recommend using a loop and animating on Ypercent instead of y  it will be easier also take a good look at this post by @mvaneijgen  to get a good understanding of how stacking works 

     

     

    another great demos 

     

     

     

    See the Pen jOROjzb?editors=1010 by ahmed-attia (@ahmed-attia) on CodePen

     

     

     

    also you can load gsap from here not in the HTML 

     

    image.thumb.png.9019624aed0df9b63161e6060bc12e38.png

     

    or just fork this one

     

    See the Pen aYYOdN?editors=1010 by GreenSock (@GreenSock) on CodePen

     

    • Like 1
  7. got it,

    great catch  I tried to ask Copliot about a use case and he was like 🤔 🤔 🤔(so you trying to lag your project)  😂 , I will add it to my to-never-do list to check it someday, good luck with it 🙏

  8. hi @Sirena  where did you find this video i have never seen it before even when searching in docs 🫣 but it's from GSAP 1.12 I don't think it's recommended to use the same technique now (maybe I am wrong ) but now GSAP has powerful tools like easing,  staggering, and timelines 

     

    so the most important question here is, what are you trying to build? 🙏

     

    edit

    I think i was wrong i  found some recent posts about ppl asking about it so this means it's still a thing I guess  🫡

     

  9. also since you are trying to animate a model I would add it to a group and animate the group, so you don't worry about the names or  axes or children order every time you export from blender

     

    if you are using R3F you can easily just convert the glb file to a react component thanks to pmndrs and animate only the part you want instead of just importing the whole object and animating it 

    • Like 1
  10. h1 @DW92  maybe something like 🤔

     

    this one without any functions 

    See the Pen PoLvaKM?editors=1010 by ahmed-attia (@ahmed-attia) on CodePen

     

     

    in your demo, you didn't load gsap so this code won't work in a million years 😂

     

     

    here is how you load gsap

     

    image.thumb.png.fa7ea177f32bbf7a2bfee703411ff08c.png

     

     

    or just fork this demo it contains all the plugins 

     

    See the Pen OPqpRJ by GreenSock (@GreenSock) on CodePen

    • Like 1
×
×
  • Create New...