Jump to content
Search Community

SammyC123

Members
  • Posts

    50
  • Joined

  • Last visited

Recent Profile Visitors

2,637 profile views
  1. Sorry to necro an old thread (it's been a busy few months), but I just wanted to say thank you. Due in no small part to your assistance, I was able to arrive at something highly satisfactory. And while I feel like there is an opportunity to do this with an entirely different technique and probably in a much more optimal manner, this certainly sufficed for my purposes. Scroll to see the effect. Every time I work with GSAP or come to these forums, I learn something new and exciting. So, I guess you should consider this a double thank you. I've never worked with a product that has such fantastic and enthusiastic support. GreenSock is incredible in its own right, but the team behind it is really what makes it shine. Happy holidays!
  2. I'm trying to adapt a previous SVG demo... (here) ...to canvas and running into what I believe are fairly basic / newbie issues (both structurally and GSAP-wise). Relevant code begins around line 125 in the demo down below. Questions: Why are the circles tweening back to the bottom? I'm using a gsap.set with overwrite: true so shouldn't that reposition them instantaneously? Likewise, if I change it to a gsap.to and give it a duration (e.g. 10 secs), it will respect that duration. But if I set the duration to 0, it still tweens it as if it were set to 1 second. When I resize the window with the ScrollTrigger enabled, it seems to mess with my debounced resize event. If I comment out the ScrollTrigger, the issue goes away. Is there something I should be doing to avoid this unexpected behavior? I'm sure I'll figure this one out but I thought I'd ask in case it was something simple. Finally, on a structural level, I'm unclear on how to incorporate a ScrollTrigger that updates particle velocity (or timeScale) into this. I don't want to create a new ScrollTrigger every time the draw() or move() method is called. So should I be doing that work inside the ScrollTrigger itself (in an onUpdate)? Or should I be passing ScrollTrigger values into the methods instead? Is there a preferred or recommended style? I've pored over Codepens and this forum but nothing really stands out to me as "obviously correct." I'm trying to emulate as much of Blake's style as possible, but he's a hard act to follow.
  3. Oh my god, that's so frigging cool. (And simple, and elegant.) Jack was spot on. This is a vastly superior way to achieve it. If I wasn't able to see the code, I would have just assumed it was WebGL for that skewing effect. That's such a good demo for so many reasons. Thank you for that. It's yet another for my GSAP bookmarks folder.
  4. That's an interesting approach! Would it be something vaguely like this? https://codepen.io/JC5/pen/qBXjXVB If so, how would I go about making it so the acceleration only occurs during user scroll, and then how would I get GSAP to tween the timeScale value back to the default of 1 when they've finished? That's a fair point. My main concern was with the color banding that occurs from CSS gradients, but I'm sure I can figure a way around that. I'll stick with it for now. Dang it, I suspected as much. I probably should've started with that. Oh well, maybe after I've perfected this version, I can move on to bigger and better things. I feel like I still have a ton to learn before then though. Thanks for the help, Jack!
  5. I've managed to wrangle my example to almost precisely how I want it... I'm just stuck on a couple (hopefully) minor details. I have a ScrollTrigger pinned section in the middle, and it has a bunch of circles within it that slowly rise to the top at varying speeds. I'm using velocity to increase that speed when the user scrolls (thanks to some stellar examples on the forums). My issues: I want the circles section to seamlessly wrap by creating new circles that are always coming up from the bottom. Right now I'm using repeat: -1 after 60 seconds, but that is a subpar experience as the circles typically run out before that timer AND the redraw is jarring. I know this is not ideal. I'm cheating to create my fade out/fade in effect at the top and bottom, respectively. Those are just gradient divs. I'd like to actually have the circles fade in and out appropriately near the edges. Both of these problems seem solvable with something like Blake's SVG clouds experiment: https://codepen.io/osublake/pen/wWXRQN?editors=0010 ...but I am having trouble understanding how to integrate what he did into my code, particularly with regard to ScrollTrigger. On a final note (more of a tangent), would you recommend redoing this in canvas with arcs for the circles instead? I don't particularly like how much computational power this seems to take, but I'm uncertain if the performance benefit of canvas would reasonably offset the increase in complexity. Thanks for reading, and for any assistance, tips, thoughts, or recommendations.
  6. 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.
  7. 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.
  8. 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.
  9. 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
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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...
×
×
  • Create New...