Jump to content

Dipscom last won the day on July 19 2019

Dipscom had the most liked content!


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Dipscom

  1. Allow me to chime in a bit as well. Firstly, AnnaMarie, I would caution you that what you are trying to achieve is not trivial, not if I understand what you are after. It involves calculating boundaries and working out where each egg is relative to the parent element. Also, I think Blake was being a little bit too literal when responding to your question. He's great but operates on a much higher mental RPM so, he tends to leave us mortals behind... Having said all that, the crutial point I think we should get to is what is exactly the intended behaviour that you are after? Do you want the eggs to disappear because they are touching the top of the container or would you want your animation to be contained within the container? Mikel has given you an example that works but I feel it might be a bit too much right now. It also uses scaling rather than perspective so, it doesn't quite look right. I had a look at how you constructed your example and assumed you intend to use the CSS perspective. I also assumed you wanted the eggs to stay within the container. Even if you wanted the eggs to fall at the end of the tween, it's just a matter of creating a more detailed timeline. Have a look bellow, it's the simplest example I could come up with that I think fits your criteria. And, is responsive to boot. https://codepen.io/dipscom/pen/3f4a9496f0122bf60fbf25f79b238ed7 ps: Note that I have also removed some redundant code you had added a few more eggs.
  2. Dipscom

    SVG animation

    This is what I understood from your last response, correct me if I am wrong: Click on button A > Animation plays; Click Back > Animation reverts; Click on button A > nothing happens; I can't say why that is happening as I don't know how you have implemented the suggested code. But, this shouldn't be something too hard to debug. Have you checked the console? Do you see any errors? Have you tried to log out the variable as you click around?
  3. Dipscom

    SVG animation

    Well, I can't really say as I don't know how you have implemented my example code but I can hazard a guess. If you are clicking on the same button twice it would mean you are calling the same function twice, running the same code twice, therefore, telling the timeline to reverse and play at the same time. Let's try something different this time, rather than me writing code to figure things out, tell me what behaviour do you expect from your animation when you click the circle button twice?
  4. I'll go off on a limb here and say that what you want is to calculate the coordinates of your target element then, feed that as the last entry of your bezier curve. That way, your animated element will flow along whatever curve you have created and end up at the target element's position.
  5. Dipscom

    SVG animation

    Hey DD77, Long time no speak! Hope you have been well. There is nothing wrong with using the .reverse() method, actually, that is the method to use if you want to rewind your animation. I would say your issue is that you are not keeping track of which section you have open and which are closed. For that, you can create an object to hold a reference to which section is open and use that to control your timelines. Something along the lines: var controller = { currentOpen: undefined } $(".button_one").on("mousedown", function() { if(controller.currentOpen) controller.currentOpen.reverse(); animation_one.play(); controller.currentOpen = animation_one; }); $(".button_two").on("mousedown", function() { if(controller.currentOpen) controller.currentOpen.reverse(); animation_two.play(); controller.currentOpen = animation_two; }); $(".button_three").on("mousedown", function() { if(controller.currentOpen) controller.currentOpen.reverse(); animation_three.play(); controller.currentOpen = animation_three; }); //BACK BUTTON ACTION $("#back-top").click(function () { controller.currentOpen.reverse(); controller.currentOpen = undefined; TweenMax.to(".svgButton", 0.8, {className: '-=animate',autoAlpha:1 }, 0) TweenMax.to(".svgButton", 0.8, {className: '-=active',autoAlpha:1 }, 0) })
  6. Hi Kerstin, You have pretty much answered your own question. And you have scaffolded your code in your example nearly all completely correct. First I have a question: is there any reason why you are doing a querySelectAll on your toggles? Is this because you plan to have several toggles? As to what you need to do to achieve your desired effect is simply to create the animation you want to play in your 'tlback' and change your click event to something like the following: // This really should be outside your forEach loop let open = false; function accordionToggle() { // Note the zero inside the method call, to make sure we always start the timeline from its start open ? tlback.play(0) : tl.play(0); // Toggle the open state to its opposite value open = !open; }
  7. Wellllll.... This is not really GSAP related is it? But I think we can get away with a simple tip. Let's hope we don't get into trouble for it. So, as I said, you have to know on top of which element your mouse is. Look at this code, it does not use jQuery, as I know nothing of jQuery. It will be your homework to make it work with jQuery if you decide to use it. You should read into event capturing & bubbling. For more details.
  8. Hi vencule, Welcome to the forums! Just to clarify: when you say "have active scroll" - what do you mean? That has scrollable content inside it? Or that it scrolls on its own? What Chrysto has done in this pen is attach a mouse wheel event on the window object (are you familiar with said object?) - So, no matter where you use the mouse wheel it will get hijacked. If you want to have scrollable content inside of this implementation, will have to check if the mouse is scrolling inside of your nested scrollable div or not. If it is inside your scrollable nested div, you need to stop Chrysto's code from hijacking it.
  9. Hey flowen, Your second message here has got me confused. Have you resolved your issue and are now happy with it or do you still need some assistance?
  10. I've left the banne world over a year ago but I still get offered the odd banner contract here and there. I have noticed an increase on GWD as a requirement/tool to be used. To me it's just like the days of Flash, where there was an abundance of designers/animators that would work on banners that had no interest in learning to code. They would get by just fine when it comes down to the everyday banner. The few developers who work in the field would work on the programatic/dynamic ones. And everyone will be happy. Obviously, Doubleclick/Google will want to push their internal software, for whatever reasons they have.
  11. Ditto. What have you tried that did not work previously? Been hiding under a baby. For such small things, they are a handful... And no, my parking spot is definitely NOT up for grabs. My paternity leave (aka money) is coming to an end so, expect me back some point next week.
  12. As Sahil said, if you killAll it will get rid of ALL of your tweens in the entire page. You cannot unkill it. It's not that it is a bad thing, it has its use cases, you just need to know when to use it. It really sounds like the answer is to simply pause the animation on mouse enter and resume on mouse leave. You could overwrite tlEsad but why would you want to do that unless you plan to change its animation? If you are going to re-use the same animation, you are far better off by just pausing it.
  13. You can create a single function that handles your tweens. It will also reduce the number of tweens you have to manage.
  14. I've done plenty of 'that' myself but I started with '_this' because somewhere I had read that one should name one's private variables with a underscore to mark them as private only.
  15. If you use the cycle property, you can define some clever way to select your desired elements using a function and adding a delay to each instead of using the staggerFrom/To own stagger:
  16. I am not aware of any particular slowdown in Safari on iOS but if it really is a browser/OS issue, there will be next to nothing one can do to overcome it. Would you have any simple example that you can share for us to try and replicate?
  17. OH LORD COMMANDER CODEGOD! I HAVE FAILED! NO CONVERTS! PLEASE DO NOT TURN ME INTO A WORM! I have a couple of things I consider eye candy but it's a wall of code... So, no dice there. I know there is plenty of cool stuff that can be done with a line of TweenMax and cycle or the function modifier, hopefully with someone who'll be a bit more prepared than me, it will shine. Anyways, it was alright, small meetup, about half a dozen people. I'm no Sara Drasner but I do think I did not suck. @OSUblake that pen of yours is super useful to a ton of people. It's really what people say "practical" animation. Did not surprise me when it was in the top pens of the year.
  18. So as requested by PointC - Post presentation report. You know the original plan as described at the start of this thread? Out of the window. These were the slides I managed to put together in the hours prior to the talk: https://docs.google.com/presentation/d/1prtPuIM2Gw1Gd5ylTYzfEdUNflWWvnpZ--LdFpSp8fE/edit#slide=id.p Couldn't blow many people's socks off with Blake's stuff because he operates in such a high level that the stuff I showed people didn't quite get why it was baffling or what problem it overcomes. They get really impressed with plain old DrawSVG revealing a stroke but try and explain why the exponential ease is such a cool thing and people go: uh? All in all the feedback was positive, the gang there said it was a nice talk but I don't feel like I have converted anybody. Sorry boss...
  19. Nice one Sahil, but I am now on my way. Can't go over those in the 15 minutes it takes me to drive to the venue. But I will check all of those out and possibly show some. Time to break a leg!
  20. @PointC is there a way for you to transfer ownership of a certain Star Wars pen?
  21. That's great Carl, thank you. I will resist the urge to impersonate you. More because most of the people at the meetup know me and I wouldn't get away introducing myself as Carl Schoof... Will definitely rip half of your presentation off. Still open for further suggestions, people!
  22. So, later on tonight I am doing a 45 minute talk in a MeetUp I take part. The topic: GSAP Crash Course And as a great and prepared guy that I am, I am getting my stuff together now 5 hours prior to the thing. Ops. The plan is: - Short Introduction on GSAP: What is a tweening engine, what GSAP does, GSAP plugins - Live code a simple DOM tween - Live code a simple SVG tween - Live code a simple Canvas tween - Live code a simple timeline - Build a shirne to the CODEGOD (Scratch this one, not enough time in a 45 minute talk) Then, I would like to show a few practical day-to-day example and that where YOU come in. Can I have some suggestions of things I can either steal or setup? Suggestions of simple things Suggestions of medium/advanced things Suggestions of which of @OSUblake's pens to show to make people's head hurt.