Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

1,730 profile views

SammyC123's Achievements

  1. I knew I was doing something wrong on a fundamental and basic level! Turns out it was actually multiple things. 🙃 Thanks, Jack! Every time one of you (team GSAP) posts, I end up learning more in 5 minutes than I do in weeks of self study and research. Know that your assistance is truly appreciated.
  2. I have some circular text rendered to a canvas that I want to advance (or reverse) the direction of based on user scroll. In the demo provided, this is partly hooked up and working, but I'm pretty convinced that I'm going about this completely the wrong way, so I'd be grateful for some collective problem solving. Issues that I could use help on: Is my whole technique for accomplishing this relatively simple effect incorrect? If so, are there any relevant examples for how to go about doing something similar? I've scoured both Codepen and these forums and not come up with much. How would I get the rotate animation to use easing for a smoother effect? Since the rendering is taking place in canvas, I can't exactly use GSAP for it, can I? I don't want to have to build out an entire easing system for the renderer. Appreciate anyone taking the time to offer their wisdom.
  3. I'm truly blown away. The breadth and depth of information contained in your post is enough to save me weeks or months of headaches and Google / Stackoverflow research, and your examples are incredibly well structured and easy to follow. I really can't thank you enough, @OSUblake. This is fantastic. You're one of the reasons GSAP is worth every penny.
  4. Oh wow, both of those Codepens were a huge help. Thanks, Blake! I'm a lot closer than I was, but I think I still have a long way to go. I've taken a different approach: Centered canvas elements via translate so everything starts at 0,0 Drew in the lines using lineTo() Faked the shrinking transition by drawing a rect on top of the lines, then clearing the lines, then shrinking the rect (probably not the best solution, but sufficient for now) Lastly, I'm working toward making the canvas be responsive on resize while keeping the elements within it fixed in size But there are a few things I'm still struggling with. When the rect comes in, it's seemingly a different stroke color than the lines... closer to light gray than white. Any idea why that is? I'm scratching my head trying to make the rect shrink from all sides equally to the center, rather than shrinking into the top left. Animating point5(via the function animateLineTopLeftOut) happens instantaneously and I don't quite understand why. I think it has to do with the fact that I need to animate both x and y properties, but it's unclear to me. If you have any more wisdom to share, I'd greatly appreciate it. I don't want to keep leaning on you for answers, but you always make it look so easy on these forums. 😀 https://codepen.io/codepenrequiredit/pen/eYvYdoJ?editors=0010
  5. My task has two components. First, I'm trying to draw a 800x800 pixel square in canvas via lineTo, but I'm not sure I understand how to use the onUpdate callback with lineTo to properly execute it. If I shift the y value, it skews the line rather continuing it. How would I achieve a point-to-point effect, as if you're drawing each side of the square consecutively? If someone could help me understand how to draw a straight line down after the initial horizontal line is drawn in the Codepen, I can probably take it from there. My second issue, and one that seems easy once I get this figured out, is how do I then shrink that square to half its size (so 400x400)? Seems like I could use the same approach, but with each callback shrink the total line size (length and width) little by little until I end up at the appropriate size. All thoughts and suggestions are greatly appreciated.
  6. After the initial animations (fade up with autoAlpha and y), if you begin to scroll, Locomotive Scroll's parallax takes over but the position of the trees jump down. I'm assuming this is because when Locomotive initializes, it remembers the position of those elements, and then GSAP adjusts them afterward. Then when Locomotive takes back over, they snap back to the position Locomotive remembers. Is there a simple way to fix this? Thanks in advance. Edit: Looks like the embed window for Codepen isn't showing it. You need to click in to the example.
  7. Yep, I'm a dumbass, as usual. ? I thought it wouldn't fit my use-case because it snaps back to the boundaries immediately in your example above when you try to drag it, but it turns out that's precisely the behavior I needed. Although I'm still not sure I understand the relationship that occurs when you offset it by a percentage, i.e. {x: "-20%"} It seems to offset everything, including the boundaries. Is that intended behavior? Anyway, thank you for pointing out the error of my ways, @PointC! And doubly thank you for blowing my mind with .delayedCall()... I had no idea that even existed and it will no doubt come in very handy in the future.
  8. Thank you for the reply, @PointC! Unfortunately, that standard method seemingly does not work with the pen I linked, which is what caused me to create this thread to begin with. You can test it yourself by adding the following code to the pen above: TweenMax.set(".draggable", {x: 125}); It makes no impact whatsoever on the position of the draggable element (the map). Nor does tweening it seem to have the proper effect. Perhaps I'm not calling it at the right moment, or maybe I need to better understand the .update() method, as referenced here? Either way, thank you again for trying to help.
  9. On an initial load, how would I go about centering the map on, say, Africa? I've checked the documentation and looked at various threads, including this one, but those solutions do not seem to work for me. And if I translate with percentages, it moves the entire map to a relative position inside its container, creating a large gap. I feel like I have to be missing something simple, but it's eluding me...
  10. Yes, that's perfect! Thank you. That's so much more elegant and simple than what I thought I needed. My whole idea of tweening the container values seems pretty silly in hindsight. ? You GreenSock guys, I swear... you're just the best. Every single time.
  11. When you're using applyBounds() to set new container boundaries (e.g. on a resize event), is there a way to make the old boundary values tween to the new ones... with easing? For context: I'm using Draggable on a fullscreen map element and then using applyBounds when I show/hide a sidebar. It's a rather jarring experience when the map is forced into the new boundaries. The whole screen seemingly jumps. EDIT: Added a Codepen. To replicate this, drag the map all the way to the left, then toggle the sidebar closed. You will see how the map jumps to fit the new boundaries. I would like to tween it to resize the bounds in tandem with the sidebar toggle animation... slowly and smoothly.
  12. You're a godsend. That was exactly what I was missing. Thank you a ton! And yeah, the code needs quite a bit of cleanup.
  13. A few weeks ago, Blake graciously instructed me in the use of .getItem() and it helped me make significant progress, but I was forced to abandon that structure of SVG in favor of something more controlled. I'm closer to being where I want, but it's becoming clear that I'm failing to understand precisely how to update the path locations as the timeline is running. Line 214: onUpdate: updatePath, is simply not doing the trick like I thought it would. What am I missing? I think I need to feed the coordinates of the circles ('handles') to update the paths, but I'm not sure how to get that data in or out. As a secondary issue, all the circles are 'floating' in the exact same direction at the same time. I want them to be diverse, but I think it's happening because I initiated all of them simultaneously by defining the 'handle' var as all 'circle' elements (Line 187). Been scratching my head for a full day on this one. I feel like it should be a relatively easy fix, but I'm just not seeing it. Thanks for any potential assistance.
  14. Holy cow, I can't believe you responded so quickly! I shouldn't have even stepped away from my computer. Thank you so much, @OSUblake. That is exactly what I was looking for, and you did it in record time. Like Jack said, that is a whole lot of Greensock goodness in one tidy little Codepen. I never cease to be amazed when I visit this forum.