Jump to content
Search Community

SVG wave animation

peacepostman test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

12 hours ago, OSUblake said:

And don't be afraid to experiment. Everybody writes bad code, and everybody starts out at the same level. I was a total n00b at one point in time.


Appreciate the insight & advice, very interesting to hear. Also just checked the pen again & saw show points ... very cool!

  • Like 1
Link to comment
Share on other sites

  • 7 months later...
On 2/24/2018 at 11:46 PM, OSUblake said:

How's this @smallio


Create your blob like so. The options should be easy enough to understand.


var blob1 = createBlob({
  element: document.querySelector("#path1"),
  numPoints: 20,
  centerX: 500,
  centerY: 500,
  minRadius: 300,
  maxRadius: 325,
  minDuration: 1,
  maxDuration: 2



See the Pen vdzjyg by osublake (@osublake) on CodePen



@OSUblake How we can change width and height of this blob?

Link to comment
Share on other sites

Hi matthee,


Welcome to the forums.


An easy approach would be to put your paths in a group and scale the group like


TweenMax.to("#blobs", 3, {scale:4, repeat:-1, yoyo:true, transformOrigin:"center"})


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


if you don't want to animate the scaling, use set() – which is a tween with no duration.


TweenMax.set("#blobs",  {scale:4, repeat:-1, yoyo:true, transformOrigin:"center"});


edit: updated with proper pen


Link to comment
Share on other sites

Hi @matthee,


Here are some additional comments on CARL's great example.

With '.fromTo' the range of scaling can be defined. With separate tweens per axis, the axes can be animated offset (different durations). Depending on the scaling the SVG should be set with 'overflow: visible'.

And: Try out the options that @OSUblake offers: for example 'centerY' or 'numPoints' ...


See the Pen jePRLb by mikeK (@mikeK) on CodePen


happy tweening and a unique blob ...




  • Like 1
Link to comment
Share on other sites

  • 4 months later...
On 3/17/2017 at 12:49 PM, peacepostman said:



I've adapted an existant codepen to a jquery plugin in order to animate a svg into a random wave effect. I managed to use tweenMax in order to smooth the animation but i dont know if i've done that properly or if something can be improved or re-writed in a more clever way.


Feel free to copy the jquery plugin if you need it :)


Best regards,

See the Pen jBavvN by peacepostman (@peacepostman) on CodePen


How to remove the resize effect on windows resize, and keep it always at 100% in width?


Link to comment
Share on other sites

  • 5 months later...

Hey @ABS,


Welcome to the GreenSock Forum.


It would be great to create a new topic for such a question.


AND: Where's the wall? What kind of wave?
Please provide a reduced CodePen to imagine what you want to animate.


Kind regards


Link to comment
Share on other sites

  • 1 month later...
1 hour ago, ABS said:

Can you help me to animate the waves hitting wall and rebounding back?


Do you have a GSAP question? It doesn't look like you're using GSAP.


This type of question is beyond the scope of the forum. Having a wave rebound off a wall is incredibly difficult to do. You would most likely need some type of physics engine.



See the Pen XRvBNg by ste-vg (@ste-vg) on CodePen



  • Like 2
Link to comment
Share on other sites

  • 4 months later...

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