Jump to content
GreenSock

bigmamainthemud

GSAP and -webkit-mask-position

Recommended Posts

Hey all,

 

I've been messing with masking to get a shine effect on buttons when mouseover takes place but I can't seem to get GSAP to affect "-webkit-mask-position".

I want to give up a code pen but that wold require a bunch of time which I don't have tonight. Just wondering if anyone has successfully used this before.

 

Thanks!

Link to comment
Share on other sites

I've never seen that used, sorry. That property doesn't even seem to work in Chrome (unrelated to GSAP). Firefox was okay, though, at least in the demo I saw here: https://developer.mozilla.org/en-US/docs/Web/CSS/mask-position. If you need some help, we'd be happy to take a peek at a codepen demo (perhaps you could just fork the one from that URL?) It'd help to see what kind of values you're trying to apply/animate. It's probably possible using an onUpdate or Modifier or string tween.  

Link to comment
Share on other sites

Thanks for getting back to me, Jack. Actually the mask is rendering fine but I can't move the mask as I would like from JS. I want to put up a Codepen but right now I am under the gun for EOD so I'll have to approach this later tonight or sometime next week. Thanks for getting back to me though - I will post asap.

  • Like 1
Link to comment
Share on other sites

MouseOver this and hold. You will see the -webkit-mask-position animate. I have not been able to do this with GSAP but I would really like to be able to.

Link to comment
Share on other sites

Do you mean like this?: 

See the Pen RyXNjR?editors=0010 by GreenSock (@GreenSock) on CodePen

 

There are actually a bunch of ways to accomplish it with GSAP. This is probably the easiest. 

  • Like 2
Link to comment
Share on other sites

Duuuuuuude hahaha. Yes. Now I am wondering why I wasn't able to make that happen. Hmmm. If I figure out what was breaking it for me I'll chime in. Thanks a ton! GSAP 4EVAH! ;)

 

B

  • Like 1
Link to comment
Share on other sites

So "Webkit" can be both capitalized and lower case, eh? That's unusual. Why is that?

Link to comment
Share on other sites

You'd have to ask the Webkit people. My understanding is that it's technically supposed to be uppercase. :)

Link to comment
Share on other sites

OK thanks. I have used both now and they are both working so that's good. Thanks!

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.
×