Jump to content
GreenSock

PointC last won the day on October 30

PointC had the most liked content!

PointC

Moderators
  • Posts

    4,964
  • Joined

  • Last visited

  • Days Won

    401

Everything posted by PointC

  1. That's a good idea Carl. I wasn't even thinking about labels for that, but that would be better. I've never needed a spritesheet animation for any of my projects, but that's good to know for any need in the future.
  2. Hi redmile I think the easiest approach would be to loop through the first 4 frames and then have a click interrupt that loop, set the background back to 0 and then play the entire animation. When that sequence finishes you can then go back to the 4 frame loop. I made a quick CodePen for you: http://codepen.io/PointC/pen/oLdrPz/ If you could create a pen for your future question that would be helpful in getting an answer for you. Here's the link about how to create one: http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/ Hopefully that helps. Happy tweening.
  3. Hi nep You said you want to move the mask from right to left so I'm assuming this is a soft reveal of the image? I'd agree with Jack and recommend an SVG mask. The pen Rodrigo pointed out is using a solid colored square as the mask, but we can add a black to white linear gradient to the square and get a nice soft edged reveal. Using GSAP we just need to animate the x1 and x2 attributes of the linear gradient: TweenMax.to("#theGradient", 2, {attr:{x1:-800, x2:1}, repeat:-1, yoyo:true, repeatDelay:0.5, ease:Power2.easeIn}) // adjusting the x1 value in the tween can change the reveal. switch it to your liking // the closer you get to 0, the more abrupt the end of the reveal will be Here's a CodePen to get you started: http://codepen.io/PointC/pen/yJjNOX Hopefully that gets you closer to your goal. Happy tweening.
  4. Hi ne0nlight Welcome to the forums. That is being caused by your CSS. You have this: transition: all 0.4s ease; on lines 55 & 73 for your .camera-center and .lighting-center classes. GSAP and CSS are fighting to control the animation. You'll get the best results by not mixing the two. If you remove that from your CSS, everything should work just fine for you. Hopefully that helps. Happy tweening.
  5. Yep - you're calculating the delay correctly. Sorry - I didn't mean to imply that you weren't. I was just looking at your pen and you had 4 tweens and each had a delay equal to the total duration of each preceding tween. That can certainly work, but when you change the duration of your first tween then you have to go and change all your delays. That's what makes a timeline so nice for sequencing. Change the first tween's duration and all the other tweens will adjust accordingly. That's just the beginning of the power of timelines. I'm just trying to make your life easier. Happy tweening.
  6. The GSAP animation feels different because of the easing you have on the tweens. When you ease in and out of an animation it will naturally start slower, speed up and then end a little more slowly. Your first tween is ending slowly and the second one is starting slowly so it feels like it hangs for a bit. You can solve this a few different ways. You could set an easeIn for your first tween and an easeOut for the second. Since you're bringing the size right back to it's original value, you could also use one tween and add repeat:1 and yoyo:true like this: TweenMax.to(btn1, 0.7, { fontSize: 24, autoRound:false, ease:Power1.easeInOut, yoyo:true, repeat:1, delay:0.7 }); // you can play with the eases to your liking If you want to experiment with some eases, please take a look at my GreenSock Easing Playground: http://codepen.io/PointC/pen/RaVEpP And don't miss the Ease Visualizer http://greensock.com/ease-visualizer Just my 2 cents worth - but you're starting to line up a lot of tweens and coding a lot of delays to get the timing right. I'd recommend using a timeline instead. Timelines make your life easier and are made for sequencing tweens. I'd also echo Jonathan's advice about using GSAP to set() your properties. Hopefully that helps a bit. Happy tweening.
  7. Some? You have to 'heart' all my work. I'm very insecure. Glad to help. Happy tweening.
  8. Hi KerryRuddock Looks like you've got 2 tweens happening at the exact same time and the second one that animates to a size of 20 has overwritten the first one. I'm assuming your starting font size is 20 so it looks like nothing is happening. Please try it like this: TweenMax.to(".btn1", 0.7, { fontSize: 24}); TweenMax.to(".btn1", 0.9, { fontSize: 20, delay:0.7 }); or use a timeline like this: var tl = new TimelineMax(); tl.to(".btn1", 0.7, { fontSize: 24}); tl.to(".btn1", 0.9, { fontSize: 20}); Hopefully that helps. Happy tweening.
  9. Have you taken a look at Blake's Doodle Morpher Pen? http://codepen.io/osublake/pen/dYVNYd/ He's also got a cool Line Trails pen that may be of some help: http://codepen.io/osublake/pen/mEpado Happy tweening.
  10. If you haven't been to Petr Tichy's site yet, I highly recommend it. He's a wizard with ScrollMagic. https://ihatetomatoes.net/scrollmagic-tutorials-for-complete-beginners/ https://ihatetomatoes.net/5-days-with-scrollmagic/ Happy tweening.
  11. Hi KerryRuddock Welcome to the forums. Looks like Carl gave you some good answers and I'll just add my 2 cents with some additional links to forum posts that should be helpful: http://greensock.com/forums/topic/14235-about-irregular-collision-javascript/?hl=hittest#entry60402 http://greensock.com/forums/topic/14412-hittest-without-draggable/ http://greensock.com/forums/topic/14244-how-to-do-collision-detection-with-css-plugin/ Happy tweening and welcome aboard.
  12. Hi Jud_ben Welcome to the GreenSock forums. You don't have to have a paid membership to get help here. Everyone is welcome to ask for assistance. Just an FYI - you mentioned using DrawSVG which is a Club plugin. You may try it out on CodePen, but to use it in your projects you would need a Club membership. As far as opacity or autoAlpha not working, it's hard to say without a CodePen demo. Showing that to us would be most helpful. A few things to check: If you're loading TweenMax and other scripts locally, make sure you're pointing to the right directory and don't have typos in your filenames. Be sure you're not using links to the CodePen only versions of the GSAP files Make certain the scripts are loaded before you try to animate something. As I mentioned - if you can create a CodePen for us that demonstrates the problem, we can be of more help to you. Happy tweening.
  13. Hi pauljohnknight If I understand your question correctly, you need to get to the paths inside the group. You've got quite a few paths in there, but right now you're targeting the entire #letter_m group. If you want to do something like staggering the individual paths, you could do this: TweenMax.staggerFrom ('#letter_m path', 1, {scale: 2, autoAlpha: 0, ease:Power4.easeOut},0.5); If you want to target one specific path in the group, you'd have to give that path a class or ID. Hopefully that helps. Happy tweening.
  14. Hi gmw If you change lines 57 and 58 to these, I think you'll get the outcome you'd like: tl2.set( leftFace, {fill: 'green', immediateRender:false},0) tl2.set( rightFace, {fill: 'silver', immediateRender:false},0) Hopefully that helps. Happy tweening.
  15. Hi gmw I think I understand what you're asking about some elements not appearing when you try to animate them again. The reason for that is the opacity is already at 0 and you're using a from() tween with an opacity of 0. You're animating from 0 to 0 so those elements are invisible. Take a look at this sample code. Assuming we start with a box that has a starting opacity of 1. tl.from(".box", 1, {opacity:0}) // works fine tl.to(".box", 1, {opacity:0}) // works fine tl.from(".box", 1, {opacity:0}) // won't work - this is a 0 to 0 animation because the opacity is already 0 from the previous tween To solve this you could use a fromTo() tween like this: tl.fromTo(".box", 1, {opacity:0}, {opacity:1}) Hopefully that helps a bit. Happy tweening.
  16. PointC

    GSAP call function

    Hi Kv2 Since you're using a from() tween for the characters in your function, I'd recommend setting the visibility of your .anim-text div to hidden in your CSS and then in your animpar() function add this line before the each() loop: TweenMax.set(".anim-text", {autoAlpha:1}); The reason for that is when you set the visibility to hidden in your CSS and then you animate from an autoAlpha of 0, you'd essentially be animating from 0 to 0 and the words would not appear. Here's a fork of your pen with that solution: http://codepen.io/PointC/pen/XKZPbB Hopefully that helps. Happy tweening.
  17. Hi Theo Welcome to the forums and thank you for joining Club GreenSock. You're gonna love it. Everything you're describing is certainly doable. As far as where to start - I'd recommend the GSAP Jump Start Guide: http://greensock.com/jump-start-js Also take a look at the GSAP Jump Start collection on CodePen: http://codepen.io/collection/ifybJ/ Other than that, start hanging out in the forums to learn from other questions/topics and code some practice animations of your own. Create a few plain divs and start making them move. When you have a specific question or problem, create a CodePen for us and post your question. We'll be happy to assist you. It's always best to start a new topic when you have question. That will get you the most attention and quickest answers rather than posting on someone else's thread. Happy tweening and welcome aboard.
  18. Hey celli I'm not sure if you can do that or not. The placeholder text is an attribute of the input element so that may not be something SplitText can work with. I know you can access it via the AttrPlugin like this: TweenMax.set(document.querySelector(".innershadow"), {attr:{placeholder:"Some new text"} }) But I'm not sure if you can have SplitText do anything with that attribute. Just for the heck of it I tried: var elAttr = document.querySelector(".innershadow").getAttribute("placeholder"); and fed that into SplitText, but got an error. Someone smarter than myself may have a way to do it. Happy tweening.
  19. Hi nbashiri95 Welcome to the forums. Dipscom is right - you want to use duration() for that. It's important to note that by using duration as a setter, you're not changing the actual duration of the timeline, but you are adjusting the timeScale(). If I have 5 boxes and use the following code: tl.staggerTo(".box", 1, {x:500}, 1); tl.staggerTo(".box", 1, {rotation:360}, 1); tl.duration(2).play(); That timeline will play over 2 seconds, but the console will still log the duration as 10 seconds. Here's a simple CodePen with that setup for you. http://codepen.io/PointC/pen/RRLrmb/ Hopefully that helps. Happy tweening and welcome aboard.
  20. Hi grimey It only works with paths but has a utility method to convert your circles, rectangles, etc. to a path. MorphSVGPlugin.convertToPath("circle, rect, ellipse, line, polygon, polyline"); More info: http://greensock.com/morphSVG Happy morphing.
  21. Hi miraclemaker Welcome to the GreenSock forums. If I understand your desired outcome correctly, I think you're going to need two paths to make this work. This thread about seamlessly looping a circle should provide some guidance: http://greensock.com/forums/topic/12546-seamless-loop-with-drawsvg/ Hopefully that helps. Happy tweening.
  22. Hi stessyco Welcome to the GreenSock forums. That actually doesn't work in Desktop FF either. SVG 1.1 doesn't support 3D transforms. Chrome will allow it, but not the other browsers. That's probably something that will be available in SVG 2.0. We had a similar discussion in this thread: http://greensock.com/forums/topic/14664-animate-3d-with-greensock-separate-animation-for-children/ Hopefully that helps. Happy tweening.
  23. Hi PR25 Welcome to the GreenSock forums. The library performs extremely well across all browsers and doesn't add much weight at all. Depending on what you're doing, you may be able to get by with TweenLite, but even TweenMax isn't very big and it loads the CSS plugin for you. You may have someone tell you that using CSS animations won't add any weight, but that can shift pretty quickly when you consider the amount of CSS code necessary to animate something when the same thing can be achieved with a few lines (or sometimes one line) of JavaScript. You can download and try GSAP for free, so I'd suggest giving it a whirl. You'll get hooked pretty quickly on the performance and ease of use. Happy tweening and welcome aboard.
  24. You could try this: tl.staggerFrom(".box", 1, { y:400, autoAlpha:0 },2) tl.staggerTo(".box", 1, { y:-400, autoAlpha:0 },2,2) tl.from(".lastBox", 1, {y:400},"-=1") Revised pen: http://codepen.io/PointC/pen/pbALvN Happy tweening.
  25. Hi martis I'd recommend talking a look at ScrollMagic. It's great for that kind of site. http://scrollmagic.io/ Check out Petr Tichy's site for a lot of great info, tutorials and classes about it. He's a great teacher. https://ihatetomatoes.net/ https://ihatetomatoes.net/scrollmagic-tutorials-for-complete-beginners/ https://ihatetomatoes.net/5-days-with-scrollmagic/ Hopefully that helps. Happy tweening.
×