Jump to content
Search Community

Circle arrow animation

venn 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

Hi team,

 

I am trying to figure how do create this particular animation.

 

Here I attach an image with the steps from left to right in order.

 

The idea is that when you hover your mouse on the "circle arrow": 

  1. The arrow will transition to the left and out of the view while getting clipped in the circle.
  2. The circle will get filled.
  3. A new arrow will comes from the right.

Any kind of pseudo code or idea on how I should start this will be most appreciated.

 

I believe SVG will the best option?

 

Cheers,

Venn.

post-31825-0-19742300-1476679956_thumb.jpg

Link to comment
Share on other sites

I managed to figure it out.

 

Here is my code that tries to solve this problem.

I use SVG and animate the SVG attributes.

arrowLeftTL = new TimelineMax({paused: true});

arrowLeft.on(Events.MouseOver, function(){
	arrowLeftTL
	.to(arrowLeftCircle, quick, {attr:{'fill-opacity': 1}}, "slide")
	.set(arrowLeftArrow, {attr: {fill: '#000000'}}, "slide")
	.to(arrowLeftArrow, quick, {x: "-=20"}, "slide")
	.set(arrowLeftArrow, {x: "+=40"}, "slide2")
	.to(arrowLeftArrow, quick, {x: "-=20"},  "slide2");

	arrowLeftTL.play(0);
})

arrowLeft.on(Events.MouseOut, function(){
	TweenMax.to(arrowLeftCircle, quick, {attr:{'fill-opacity': 0}})
	TweenMax.set(arrowLeftArrow, {attr: {fill: '#ffffff'}})
})

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