Hugh Nivers
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Hugh Nivers
-
-
6 minutes ago, GreenSock said:
Thanks. What's the easiest way to get to the best version? I'm just typing in TweenMax and accepting what CodePen gives me.
-
2 minutes ago, Carl said:
Yup, PointC is exactly right. To see if animations worked I just got rid of the unnecessary code (eventlistener and circles) and put in a to() tween for the bars.
You should be good to go.
See the Pen NMyYry?editors=1010 by GreenSock (@GreenSock) on CodePen
Thank you for taking the time to demonstrate the animation. That helps. I appreciate it.
-
2 minutes ago, PointC said:
You have an error in your code. You've added a listener to the bar0 element, but the go() function doesn't exist.
bar0.addEventListener("mouseover", go);
Other than that, your selectors are fine and the SVG elements should animate correctly. You could also target the elements like this:
TweenMax.set("#bars rect", {transformOrigin:"center bottom", scaleY: 0.01});
Happy tweening.
Thanks. I didn't realize that not having the function yet would break everything else. I commented it out and everything worked. Thanks for the pointer on targeting.
-
I go to the Greensock Docs and find a piece of code like this:
TweenMax.set([obj1, obj2, obj3], {x:100, y:50, opacity:0});
I then take it over to my CodePen and use it as described, changing the properties I want to animate. It then doesn't work. Nowhere in that section of the doc does it talk about exceptions for SVGs. Is there a difference? What am I missing?
See the Pen QrQaXN by hughnivers (@hughnivers) on CodePen
-
Thank you.
-
15 minutes ago, PointC said:
Didn't know you could export. That helps. Thx.
-
For some reason, Greensock is animating differently in the browser than in Codepen. Here's a video showing the difference:
-
For some reason, Greensock is animating differently in the browser than in Codepen. Here's a video showing the difference:
-
Awesome! Thank you.
-
Thank you Carl. That was easy.
If I want to make it so the white rectangle scale on hover in the Y dimension only, I'll need to transform the origin to the bottom center of the rectangle. I did this before with CSS about a year ago and then it broke. Code rot? How would I do that as a transform or is there another/better way? Thx.
-
Hi,
First post here so sorry if I'm asking something that has been answered, but I did a search and didn't find what I needed.
Here's my project and what I'd like to do:
- Create a large infographic with lots of groups in Illustrator.
- Export the large infographic as ONE large SVG.
- Copy the inline SVG code and paste it into the body of an HTML page.
- Animate the individual elements of the ONE large SVG.
I've attached a JPG of an example infographic. It contains ten sections. I'd like to be able to access individual SVG elements (e.g. <rect>, <g>, etc.) in each section and animate them using Greensock.
Also, I attached a Codepen with a much simpler SVG with only two sections. I have tried to simply move the white rectangle in the top section but have been unable to. I set the id of the white rectangle to "logo." I'm just using the simple code from the first Jump Start tutorial.
I'd like to be able to animate each of these elements on hover, clicking, etc. For example, in the codepen, I'd like to be able to rotate the wheel by clicking the "click me" button.
Thanks.
See the Pen VxbYva by hughnivers (@hughnivers) on CodePen
Can't Target SVG Elements
in GSAP
Posted
Bookmarked. Thanks.