Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
peacepostman

SVG wave animation

Recommended Posts

I added an option to show the points in case it's not clear what's going on. Each point is animated between the minRadius and maxRadius at a certain angle. And on every update, the catmull-rom/cardinal function creates a smooth path between all the points in a blob.

 

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

 

 

  • Like 3

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

@Carl thanks for your reply!

But is this possible to change width and height like that?Screenshot_at_18-03-41.png 

 

Share this post


Link to post
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 ...

Mikel

 

 

  • Like 1

Share this post


Link to post
Share on other sites
On 3/17/2017 at 12:49 PM, peacepostman said:

Hello,

 

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?

 

Share this post


Link to post
Share on other sites

Hi DAM,

 

I am not sure I understand what you are asking for here, can you rephrase it please?

Share this post


Link to post
Share on other sites

Can any one help me to animate the sea waves hitting wall and rebounding back?

Share this post


Link to post
Share on other sites

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

Mikel
 

Share this post


Link to post
Share on other sites

Hello sir,

 

I have attached HTML file with this message.

 

Thank you

 

wavy.html

Share this post


Link to post
Share on other sites

Hey @ABS,

 

Just a try ...

 

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

 

Happy tweening ...

Mikel

 

 

  • Like 1

Share this post


Link to post
Share on other sites
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.

http://google.github.io/liquidfun/

 

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

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×