Jump to content
Search Community

GSAP ScrollTrigger with clip-path polygon

Miguel Brave test
Moderator Tag

Recommended Posts

Hi,

 

I´m working with GSAP and ScrollTrigger trying to do a mask effect with clip-path css property. You can see an example here: http://www.wearebrave.net/proyectos/SCROLL/

 

The scroll mouse desktop and mobile works well but  doesn´t with Trackpad of desktop. The events of ScrollTrigger are not launched with the move of finger over the trackpad. I changed the "polygon" property for "inset" and go ok.

 

I put the same code in CodePen and it works well with "polygon"! You can see the same code here: 

 

My reference web is https://www.cavuventures.com/, I think they use GSAP and Scrolltrigger but trackpad go perfect with the same "polygon" property animation.

 

Could anybody help me? I don´t understand why trackpad works well with "polygon" transition in CodePen but doesn´t in my hosting.

 

Regards,

 

See the Pen GRMRqJQ by miguel_brave (@miguel_brave) on CodePen

Link to comment
Share on other sites

Sorry Miguel,

I'm really confused here. I opened that link on my mac, with a trackpad and it's working fine for me - just the same as codepen. Unless I'm misunderstanding what the desired outcome is?

I'm not really sure why you're approaching the clip paths like this either, there's a lot of other code in there for playing videos frame by frame so maybe it fits into the wider approach you're taking?

But I would probably do the clip path tweening like this?

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

Link to comment
Share on other sites

I am not using video, is only the name of the class, sorry for the nomenclature... I want to do a mask effect scrolling sections like in this site (without the intro sprite "video" on scroll, only the sections with image and text): https://www.cavuventures.com/ 

 

In local, does my example move the clip-path mask when you move your finger in the trackpad without release? Or is moving the clip-path when you release?

 

I´m testing in Google Chrome, important! It is working fine in Safari and Firefox. It doesn´t work fine in Chrome... but in Codepen Chrome is going fine! I don´t understand what is the difference. The site https://www.cavuventures.com/  has solved the problem with Chrome. 

 

Link to comment
Share on other sites

Ok - so is the video stuff leftover from a pen you've copied this from?

If so, it's not really necessary - just use a normal tween tied to scroll like the last example I provided.


It moves without release.

4 minutes ago, Miguel Brave said:

In local, does my example move the clip-path mask when you move your finger in the trackpad without release? Or is moving the clip-path when you release?

 

  • Like 1
Link to comment
Share on other sites

I simplified my code. It works fine in mobile, Safari and Firefox. In Google Chrome works with mouse wheel but not with trackpad: http://www.wearebrave.net/proyectos/SCROLL/

 

However, in Codepen goes fine with all including Goggle Chrome with trackpad: 

 

The mystery continues... perhaps is my Chrome version? (Versión 96.0.4664.55 (Build oficial) (x86_64))

Link to comment
Share on other sites

4 hours ago, Miguel Brave said:

The mystery continues... perhaps is my Chrome version?

 

If it works in CodePen but not on your site, then your site is doing something different than CodePen. This is most likely your problem. Get rid of that scroll-behavior.

 

image.png

 

 

 

 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...