Jloafs Posted May 5, 2021 Share Posted May 5, 2021 Hi everyone - thanks heaps in advance for any help. I'm trying to use the custom wiggle plugin for the first time on a pseudo element. I want the pseudo element to wiggle on rotation and loop infinitely. Really struggling with this - I don't think the custom wiggle is being used for the ease. Can anybody spot where I'm going wrong? gsap.registerPlugin(CSSRulePlugin, CustomEase, CustomWiggle); var rule = CSSRulePlugin.getRule(".intro--image-wrap:before"); //get the css rule for the :before psuedo element CustomWiggle.create("iconWiggle", {wiggles:10, type:"random"}); // create the wiggle const introIcons = gsap.timeline({}) introIcons.to(rule, {duration: 0.5, cssRule: {rotation: "2", ease: 'iconWiggle'},yoyo:true, repeat: -1, }) Link to comment Share on other sites More sharing options...
Solution GreenSock Posted May 5, 2021 Solution Share Posted May 5, 2021 It looks like you just put the ease in the wrong spot: // BAD introIcons.to(rule, {duration: 0.5, cssRule: {rotation: "2", ease: 'iconWiggle'}, yoyo:true, repeat: -1}) // GOOD introIcons.to(rule, {duration: 0.5, cssRule: {rotation: "2"}, ease: 'iconWiggle', yoyo:true, repeat: -1}) (don't nest it inside the cssRule:{} object). Does that help? 1 Link to comment Share on other sites More sharing options...
Jloafs Posted May 5, 2021 Author Share Posted May 5, 2021 Oh man. Legend! thanks heaps. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now