Jump to content

PointC last won the day on May 26

PointC had the most liked content!


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by PointC

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. Hi Technics1210 Have you tried starting with the text at the largest size you will need, set() it to something like scale:0.25 at the beginning and then scale up to 1? I find it's generally much easier to get good results starting with something a bit too big and scaling down rather than trying to scale up. It might be worth a try. Happy tweening.
  12. o.k. - It sounds like you'd want to set up a 'resize' listener and calculate some new values. You'd then create a new tween to overwrite the old one or you have the option to kill() it as well.
  13. Hi qarlo You're right - you have to get new values for the window width so everything works correctly. I moved your window calculations and tween into a function that will play on page load as well as a click of the repeat button. function moveIt() { var windowWidth = $(window).width(); var distance = $('.img-wrap').width() - windowWidth; TweenMax.fromTo(".img-wrap", 5,{x:0} ,{x:-distance, ease:Power3.easeInOut}); } Here's a fork of your pen with that option: http://codepen.io/PointC/pen/VjWWaJ/ Hopefully that helps a bit. Happy tweening.
  14. o.k. - I'll throw my 2 cents worth out here too. I made a little CodePen for you to see the difference. It has two squares with a child square in each. One is an SVG with a child rectangle and the other one is made of two simple divs. You'll see in all browsers that the SVG itself will rotate just like the plain parent div. The child div and child rectangle behave differently. In Chrome, the rectangle in the SVG kind of animates, but it looks more like it's scaling from the center and then back out. In FF and Edge, it doesn't even appear to move. http://codepen.io/PointC/pen/bZWqGj/ I know it's not what you want to hear, but Jonathan is absolutely right. You'll have to wait for SVG 2.0 or go with Blake's suggestion of Three.js. Happy tweening.
  15. PointC

    Unfolding div

    Yep - I see the same thing Jonathan is seeing. No flicker at all, but the divs snap at the end of their rotation. I tested in FF, Chrome and Edge. Windows 10.
  16. PointC

    SVG line animation

    HI Meds86 Welcome to the GreenSock forums. There are a few problems to correct, but we can get you there. 1. You need to load TweenMax and the DrawSVG plugin. You can click the little gear icon in the JS panel and load your scripts. ...or the easiest thing to do is fork this GS demo which loads all the plugins for you. http://codepen.io/GreenSock/pen/OPqpRJ 2. I see in your CSS that you're trying to add a stroke to everything which can work, but you're targeting a class of .path rather than the paths in the SVG. You can target all of those like this: #Layer_1 path { stroke-width: 3px; stroke: red; } 3. The last thing is the size of your SVG (93x93). Adding a 3px stroke on that is going to look pretty thick. I forked your pen and changed it to a 0.5px stroke so you can see that everything does indeed work, but probably not the result you were looking for. http://codepen.io/PointC/pen/KrmKQB You'll probably need to rework your SVG a bit to get what you want here. I'd recommend starting at a larger size when you do that. Hopefully that helps a bit. Happy tweening and welcome aboard.
  17. Hi gilesht Welcome to the GreenSock forums. The x and y is going to be relative to the SVG rather than screen size. Unless you tell it otherwise, the SVG will stretch out to 100% of the available width. In your example, you're setting the width to 600 and the height to 207, but try this: remove the width and height from the SVG and change the window size. You'll see that the SVG will shrink and grow to 100%, but your animation will still play perfectly at any window width. I made a CodePen as an answer to another question a few months ago, but it could also be helpful here. It has the same SVG displayed three times at different sizes, but the same x/y animation plays in all three and the positioning is correct at each size. http://codepen.io/PointC/pen/QyjMaW Hopefully that helps a bit. Happy tweening and welcome aboard.
  18. Hi Ritch.b You can't just drop a div ID or class in there because the animation engine needs a number, but you can easily get that number by figuring out the offset from the top. // via jQuery $("#yourElement").offset().top // or plain JavaScript document.getElementById("yourElement").offsetTop I've made a simple CodePen for you to see how that could work. http://codepen.io/PointC/pen/LkyPvv Hopefully that helps. Happy scrolling.
  19. Hi phantomboogie That quick flash can be eliminated by setting the visibility of your SVG to hidden in your CSS. Then you can bring it back via a set() of the autoAlpha to 1 before animation. // hide it #yourSVG { visibility:hidden; } // bring it back right before the animation TweenMax.set("#yourSVG", {autoAlpha:1}) Hopefully that helps. Happy tweening.
  20. ha! Of course fromTo would be better. What was I thinking? I probably shouldn't be answering questions before a morning dose of caffeine.
  21. Hi resting Welcome to the GreenSock forums. I'm not sure I understand your question, but based on your pen, you want box1 and box2 to move 200px and then you want box 1 to move exactly the same way again? If that's what you want, you have some options. You could set() box1 back to a position of 0 and then animate it 200px again. I'd probably use clearProps to clear everything from box1 and then you can animate it again. Either way will create a jump back to an x position of 0. t1.to(b1, 1, {x:200}) .to(b2, 1, {x:200}) .set(b1,{clearProps:"all"}) // this will jump it back to 0 .to(b1, 1, {x:200}); Here's a fork of your pen. http://codepen.io/PointC/pen/wWJNEz If I've misunderstood what you meant, please add some more details to your question. Happy tweening.
  22. Hi swampthang Looks like you're loading an older version of TweenMax (1.14.2). I switched your pen to 1.18.5 and it worked fine for me. You also don't need to load the AttrPlugin as it's already loaded with TweenMax. Edit: dang it Blake. Mr. Fast Typist.
  23. o.k. - since you want them all to animate on the y axis in the same way, we won't need to use the cycle property. You can go back to a regular stagger. Here's the code: tl.staggerFrom(".box", 1, { y:400, autoAlpha:0 },3) tl.staggerTo(".box", 1, { y:-400, autoAlpha:0 },3,2) tl.from(".lastBox", 1, {y:400}) My revised pen: http://codepen.io/PointC/pen/GqWxgj/ Does that help? Happy tweening.
  24. In that case, you'd want to take advantage of the cycle property. tl.staggerFrom(".box", 1, { cycle:{ x:[ -400,400,0,0 ],y:[0,0,-400,400] } },3) tl.staggerTo(".box", 1, { cycle:{ x:[ 400,-400,0,0 ],y:[0,0,400,-400] },autoAlpha:0 },3,2) tl.from(".lastBox", 1, {x:400}) Here's a revised pen: http://codepen.io/PointC/pen/jrBqWV/ More info about cycle and stagger: http://greensock.com/docs/#/HTML5/Sequencing/TimelineMax/staggerTo/ Happy tweening.
  25. An easy way would be to take the last image out of your stagger tween and animate it by itself when the stagger has completed. Here's a revised pen: http://codepen.io/PointC/pen/aZJdxE/ Happy tweening.