Jump to content
GreenSock

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

Leaderboard

  1. ZachSaucier

    ZachSaucier

    Administrators


    • Points

      103

    • Content Count

      2,416


  2. PointC

    PointC

    Moderators


    • Points

      100

    • Content Count

      3,561


  3. GreenSock

    GreenSock

    Administrators


    • Points

      76

    • Content Count

      14,280


  4. OSUblake

    OSUblake

    Moderators


    • Points

      63

    • Content Count

      5,318



Popular Content

Showing content with the highest reputation since 04/02/2020 in all areas

  1. 6 points
    I am continuing to work with GSAP and learn new and cool things. I recently started playing with the Motion Path Plugin, MotionPathHelper, and drawSVGPlugin. No question this time - just a fun shout out to everyone in this community for GSAP and the help you provide. I will get there eventually.
  2. 6 points
    @chrisgannon did a nice one (as you describe inside a circle). https://codepen.io/chrisgannon/pen/xqwgPq
  3. 6 points
    Hey Horse friends, These horses elegantly take the curves https://codepen.io/mikeK/pen/Exjzejr And the winner is ... ? Happy riding ... Mikel
  4. 6 points
    Hey @Chronic, Welcome to the GreenSock Forum. You don't need ScrollMagic - just a little parallax logic and everything runs smoothly. And you could use the super GSAP tool motionPath to position objects. https://codepen.io/mikeK/pen/XWbwmZY Happy tweening ... Mikel
  5. 5 points
    So add points using that helper (alt + click), copy the path data, and then put the path data inside the d="" quotes. <path id="red-piece" fill="#ff39aa" d="" /> Now move the those points to the melted position, copy the path data, and insert it in thed="" quotes. <path id="red-piece-melted" fill="#ff39aa" d="" />
  6. 5 points
    If you are using ActionScript 3 then you can export to swf and video, maybe gif (its been awhile). The video export with AS3 is excellent with no dropped-frames. Each frame renders perfectly before being recorded. If you are using HTML5 canvas and JavaScript, no the scripted animations can not be exported to video. you will have to run your output file in a web-browser and use a screen recording program. If you need help doing common tasks in Animate with JavaScript check out my "not a course" collection of starter files: https://www.creativecodingclub.com/courses/adobe-animate-for-html5
  7. 5 points
    That wasn't my intent. I was genuinely trying to help you. Those demos show how you can speed up drawing lines using SVGPoints as it might require less updating i.e. setting attributes. That was not clear to me in your original post. You just showed that spring demo. The way I set those up is with the modifiers plugin is to run infinitely. The only reason I did that was to demonstrate how the modifiers plugin works. Normally I would have just used a ticker to animate something like that.
  8. 4 points
    Unfortunately it looks like the challenges you're facing are more related to generic logic issues that are unrelated to GSAP. As much as we love helping people around here, we just don't have the resources to provide free consulting services for things that don't directly relate to GSAP. Is there anything GSAP-specific that I can help you with? If so, I'd be happy to dive in and help.
  9. 4 points
    Yeah, since you've got a very different number of points in the end shape, MorphSVGPlugin has to add them in artificially and you've got a disproportionate amount clustered at the bottom. In cases like these, asset prep is key. So I'd suggest adding a similar number of points to the bottom of the STARTING shape so that when it morphs, it more naturally finds ones at the bottom to map to. I very quickly added some to the bottom here and you can see that it improves things (but I'm sure you could get it better): https://codepen.io/GreenSock/pen/193d53a53f3896608254829409700973?editors=0010 Here's a screen shot of where the points/anchors are on each shape: https://greensock.d.pr/oT3ksO If you want it to be REALLY good, you could start with the un-melted shape, add a bunch of smooth points to the bottom of it (but DON'T actually drag them down to make it look melted yet - just add the points first so the shape looks completely unmelted). Then copy that shape and pull the points down and position them to make it look melted. Then morph between those shapes. It'll map the points perfectly. Does that help? And welcome to the club! Thanks for joining. 🙌
  10. 4 points
    Sure, that's possible. The problem is that you're converting to the wrong coordinate space - if you want to apply transforms to the blue-box, those coordinates would actually be in the parent element's space. In other words, you were converting things into the blue-box's coordinate space (like...inside of it), thus if you move -100px for example, it'd actually look like it's moving a lot less because the blue-box is already scaled down. I put together a function for you that'd do the conversion: https://codepen.io/GreenSock/pen/8871a41b7d65dd82c153d693c8f2141e?editors=0010 Technically you should be able to use the getRelativePosition() method for that but it's very late and my brain is foggy right now so I'm not sure why that's not working. I'll have to look into that a different time, but the helper function in the codepen above seems to do the trick just fine. Happy tweening!
  11. 4 points
    Hey @AaronP and welcome to the GreenSock forums! For now, in order to get an animation to fire on scroll, you need to use either the intersection observer API or keep track of the scroll location. For how to use the intersection observer API, one of our moderators wrote this helpful post. GreenSock is actually working on a new scroll-based plugin that will make this effect even easier to implement!
  12. 4 points
    I'm not 100% sure the order of things in React, but the short story is you probably need a css rule to hide the element (visibility:hidden) when its first rendered. More info here:
  13. 4 points
    I would second everything Ivan said. It's really hard to estimate how well each medium (WebGL, canvas2D, SVG) will perform for animating graphics like that. I'm pretty sure canvas2d will be faster than SVG, but it's not the easiest thing to work with. Will Pixi be faster than canvas2D for an animation like that? I honestly don't know, but it will be much easier to create in Pixi.
  14. 4 points
    Interesting - it looks like PixiJS is now returning a string for the property, but in a hexidecimal kinda way like "0xFF54CC" instead of "#FF54CC" or a regular number, 0xFF54CC. I'll update the plugin accordingly in the next release. You can preview it here: https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/PixiPlugin3.min.js
  15. 4 points
    There's @mikel just horsing around during a global pandemic. 🤣
  16. 4 points
    I'd recommend creating your elements in a loop. Here's a basic starter example of that. https://codepen.io/PointC/pen/ZEGNyQy Here's another thread where professor @OSUblake talks about using a document fragment and the performance pitfalls of <use>. I think you'll find it helpful. Happy tweening.
  17. 4 points
    The quickness in speed is because .myImage is larger than the img inside of it. Thus the clip path has a longer way to travel in the same amount of time, thus the speed appears faster. To fix it, make .myImage the size of your img. It can be fine if you're not using it too much and not on too large of elements. In general animating clip paths is not the most performant thing. If you can create the same effect you want using regular elements, layering, and overflow: hidden that's probably going to perform better.
  18. 4 points
    Here's one other way to approach the flipping of the car: https://codepen.io/GreenSock/pen/ExjJOWp?editors=0010 We apply autoRotate: true and then in an onUpdate, we get the current rotation and if it's within a certain threshold, we invert the scaleY. I even snuck in some helpful utility functions in there Happy tweening!
  19. 4 points
    You could just animate the rotation. It's hard figuring out an exact transform origin on your image, but something like this. https://codepen.io/osublake/pen/009d53625978e660b93a7265cfc0f826
  20. 4 points
    Hey romain. By default, GSAP sets new transformOrigins, not animates them, because that's what most people expect. To animate the transform origin, you can use a proxy object and update the values in an onComplete. Here's how I'd set it up: https://codepen.io/GreenSock/pen/MWwRVqX?editors=0010 Some other improvements you could make: Put the duration inside of the vars parameter so that you can use GSAP's defaults. Use GSAP's defaults to save you some typing. Use GSAP's keyframes to save you some more typing. Don't put units on your rotations to save you even more typing. Drop jQuery because why not?
  21. 4 points
    Why are you trying to optimize it? JavaScript is fast. SVG is slow. That's really not how it works. The line redraws at the end of all your updates. That said, I like using SVGPoints with polylines/polylines instead of updating a <line>. Move your mouse around. https://codepen.io/osublake/pen/c199810fd80ff33d1cf34f67dfa275aa Points can be animated too. https://codepen.io/osublake/pen/yakOjY Doesn't sound hacky, but why not just updated everything inside a single onUpdate? Not sure why are you using the modifiers plugin based on your description? A demo might help to understand your problem better.
  22. 3 points
    Very nice work, @PointC! 🙌 And @OSUblake also gets bonus points for making use of another GreenSock tool Happy tweening @nikolev!
  23. 3 points
    PS Here's your AI file with the Copy/Paste solution applied. https://codepen.io/PointC/pen/jObNjBo
  24. 3 points
    @OSUblake is showing an excellent solution there. I highly recommend it. 👍 If you do want to tame the Adobe Illustrator beast, here's a little trick. I made a simple blue rectangle on a background white rectangle. I then converted the blue one to a compound path and added an extra random point on each side. You can see the AI result: Now when I use export I get this: <svg xmlns="http://www.w3.org/2000/svg" width="600" height="400" viewBox="0 0 600 400"> <title>rectTest</title> <g id="Layer_1" data-name="Layer 1"> <rect width="600" height="400" fill="#fff"/> </g> <g id="Layer_2" data-name="Layer 2"> <path d="M525,325H75V75H525V325Z" fill="#29abe2"/> </g> </svg> My 4 extra points are now gone. Adobe Illustrator is sooooo helpful. 🙄 But if I select my two rectangles and go up to the top menu and choose Copy and then paste everything into my code editor, I get this: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="600px" height="400px" viewBox="0 0 600 400" style="enable-background:new 0 0 600 400;" xml:space="preserve"> <style type="text/css"> .st0{fill:#FFFFFF;} .st1{fill:#29ABE2;} </style> <defs> </defs> <g> <rect class="st0" width="600" height="400"/> </g> <path class="st1" d="M525,325H351.6H75v-74.9V75h220.3H525v78.2V325z"/> </svg> Ah-ha. My 4 extra points on the blue rectangle path remain. It requires a little more clean-up for the CSS, but it will prevent AI from being too helpful. Just my two cents. Happy morphing.
  25. 3 points
    Yeah, your shape does NOT have the extra points at the bottom. I just updated the codepen-only MotionPathHelper file to add an editPath() method so that you can see what I mean: https://codepen.io/GreenSock/pen/8fcb337385d0f1e401a66f260cf73e76?editors=0010 Look at the anchors. No extra points along the bottom. Maybe your software is stripping them out when you save?
  26. 3 points
    Hey @agilepixel and welcome to the GreenSock forums! Thanks for being a Club GreenSock member. We couldn't do what we do without people like you. GreenSock is actually working on our own scroll plugin but it hasn't been released yet. Until we have the scroll plugin, to animate thing on scroll you have to use either the scroll position or the intersection observer API. Here's a basic demo using the scroll position: https://codepen.io/GreenSock/pen/BaNPoEK And here's an article that talks about using the intersection observer API with GSAP: https://medium.com/elegant-seagulls/parallax-and-scroll-triggered-animations-with-the-intersection-observer-api-and-gsap3-53b58c80b2fa
  27. 3 points
    You can also take a mathy and logic approach like @OSUblake did. 😉 https://codepen.io/osublake/pen/yJgaYY
  28. 3 points
    I don't think Dropbox allows you to embed images on other sites for bandwidth reasons? It's not meant to be used as a CDN.
  29. 3 points
    CodePen Pro allows Image Uploads. I'd suggest that. Otherwise, if you're just proof-of-concept-ing, unsplash is a good source. Try adding: 'https://source.unsplash.com/random/500x500/?indoors' as your background-image. background-size: cover; (or contain;) will also help, or if you're using images, object-fit
  30. 3 points
    Hey @nikolev, Like Jack, I'm convinced there's something wrong with your SVG. Here in this SVG I have a little 'frayed out' the initial shape also. https://codepen.io/mikeK/pen/bGVbroe The shape could be further optimized. By the way: It is enough to set .hide {visibility: hidden;} Happy tweening ... Mikel
  31. 3 points
    Your calculations are wrong. I recommend using .set()s in the timeline. Keeps it more clean because it can progress backwards more easily. Yep, your approach is good. Fixing your calculations, you get this: https://codepen.io/GreenSock/pen/pojzoxy?editors=0010 Note that I added a spacer element to handle the offset of the image when it goes from static to fixed. Also note that I didn't add resize support.
  32. 3 points
    Thanks a ton Jack! I was switching places of fromElement/toElement and I wasn't in best mind state - it was already getting early Yeah, I've tested most of the MotionPathPlugin stuff, getRelativePosition() was my first try and I almost had it working but there were some offsets from my position that I just couldn't figure out. Though those were the beginnings when I was testing it inside my transformed environment - when I realized I can't even do this with two simple boxes I just had to reach out here for help and get some sleep. This solution is a life saver - thank you again Happy tweening to you too!
  33. 3 points
    ScrollMagic isn't a GreenSock product and we don't really recommend using it. You can do what you need to do without it. In fact, GreenSock is in the process of making its own scroll animation plugin! Until then, you can use this approach: https://codepen.io/GreenSock/pen/BaNPoEK First, setup each of the elements and animations like you need them to run. In other words, animate it as you want it to animate before you attach anything to the scroll. Second, attach your animations to the scroll by using the method above. Alternatively, you could use intersection observers like this post talks about.
  34. 3 points
    So for anyone running across the same problem as i had (my sight was much clearer after lunch), this is the solution: Follow the instructions as written in the docs that is, download the zip, place the gsap-bonus.tgz file in your project root, install it with: npm install ./gsap-bonus.tgz and in your frontend: import { gsap } from "gsap"; import { PixiPlugin } from "gsap/PixiPlugin.js"; (or whatever plugin you're in need of). so this will include the plugins and gsap in your bundle. if you want to use the gsap from the cdn instead, you need to include it first in a script tag: <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.2.6/gsap.min.js"></script> and in your webpack-config: module.exports = { ... externals: { gsap: 'gsap', }, ... } this will tell webpack not to include gsap in your bundle as it will be served from outside. 🎡🙌🏼🤪☄️🍕 gsapaliciouuuus
  35. 3 points
    Hey @karelrosseel82, You cannot expect that every question, every problem will be solved here in the GreenSock Forum. Or even build a complete app for you. We are happy to help when it comes to a specific GSAP question. Check out tutorials when it comes to js constructions or how to e.g. build a sprite. Just a friendly pointer: https://codepen.io/mikeK/pen/vYOojpY If you need professional help, you can also make a request in the Jobs & Freelance forum. Happy tweening ... Mikel
  36. 3 points
    OK, Thanks for your help, here I finish the implementation that support GSAP3 in ReactNative, I hope people looking for better library than RN Animated found this implementation useful. https://www.npmjs.com/package/gsap-rn
  37. 3 points
    Hi @Odi, I'd bet you'd have better luck if you used the current GSAP3 syntax. You shouldn't need to import css plugin, etc. There's no advantage to using TimelineLite anymore, as it's just an alias in gsap3. All you should need need is to: import gsap from 'gsap'; then for your timeline use: this.Comments = gsap.timeline({ paused: true });
  38. 3 points
    Hey @james182 "We recommend animating the properties that you need animated because tweening between classes isn't very performant, are not explicit, and adding support for them takes a significant amount of kbs for how few people use them. For more information, check out this post: Happy tweening ... Mikel
  39. 3 points
    There are a whole bunch of DNA demos on CodePen that should give you some ideas. https://codepen.io/search/pens?q=dna If you have specific GSAP related problems or questions as you progress with your project, we're happy to help.
  40. 3 points
    Hey @karelrosseel82, A lot questions. Let me start with a few answers. the horses are flipped already: Please study the code. As with the turns, you can set the direction of the horses at the beginning. function theHorses(which, dur, ease) { var action = gsap.timeline() .set(which, { scaleY: -0.5}) Why are these IDs for?: Its up to you to use. GIF: of course https://codepen.io/mikeK/pen/JjdQyWq But you can use a simple sprite animation simple sprite animation instead. Random: There are lot of options, e.g. https://codepen.io/mikeK/pen/qBdzrGO Happy tweening ... Mikel
  41. 3 points
    I'm not 100% sure what you're asking. It sounds like you read my thread here: If you're trying to animate the same way as your example pen, I'd think it would come down to proper grouping. A lot of the flame elements seem to move as one group so you wouldn't need to name or directly animate each one. You could rotate the group as one unit, stagger each flame, etc. Does that help? I'm also not sure what this means. Do you mean where you install your GSAP scripts? If you have specific GSAP questions, we're happy to help. Happy tweening.
  42. 3 points
    Do you have some url we can take a look at? With the information you're providing is hard to pinpoint what the issue could be and we'll be just guessing. Honestly this is quite odd. I'll assume that you're working with create react app to bundle your code, the thing about that is that it generates a single JS file with all the code for the app which should work as it did in your development environment. I assume that you're using this approach for your animation: https://codesandbox.io/s/simple-gsap-instance-toggle-xc741 One option could be that the timeline instance is not paused when you create it. Another possibility is that the app is too complex and all the rendering and painting work the browser has to do is taking too long. Have you checked the performance tab in chrome dev tools in order to see how the initial render of the site is working? This could also be a performance problem which is consistent with the fact that in mobile devices it gets worst. Also you can install React Devtools and use the profiler to see how the React part of your code is working. React Dev Tools for chrome: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=es React Devtools profiler docs: https://reactjs.org/docs/optimizing-performance.html#profiling-components-with-the-devtools-profiler Short video tutorial on using and understanding the profiler:
  43. 3 points
    Hey @Arun, Its a question of easing. Try ease:'none' Happy tweening ... Mikel
  44. 3 points
    Good SVG morphs (or any SVG animation) comes down to 3 things. Prep. Prep. & Prep. Something like you're describing should probably be broken into pieces for each letter. That will give you the coolest effect and smoothest animation. Here's a demo I did a couple years ago with SVG text. I created the original text and then duplicated and warped each piece in Illustrator. https://codepen.io/PointC/pen/yPbYRY Happy morphing.
  45. 3 points
    guys, fixing the issues after uninstalling @types/gsap solved my issue. Now after build, there is no error that gsap is not defined :). The issues were of sort that delayedCall does not exists in TweenMax, TweenLite and etc, so i imported everywhere gsap and used gsap.delayedCall. Im really happy, thank you very much ! ❤️
  46. 3 points
    To make the scrolling infinite, you actually want to use the regular scrolling as a proxy. What I mean by that is you don't want to show the regular scrolling or let it affect the page's scroll location but instead use the values from the scroll event to animate your elements. The core positioning and approach could be the same as in mikel's demo above. ScrollMagic wouldn't help you make the scrolling infinite AFAIK.
  47. 3 points
    I'm not 100% sure what the end goal is here, but you could position the divs off the screen and set the overflow-x:hidden. Or you could use a parent div and the two solid color divs could be children of that with overflow:hidden. There would actually be several ways to set it up. It does sound you want the entire div to move in/out of view so rather than use a pixel based animation, I'd recommend using a percentage based translation with xPercent. Something like this: gsap.to("#home", { xPercent: -100 }); You can read more about that here: https://greensock.com/docs/v3/GSAP/CorePlugins/CSSPlugin Hopefully that helps. Happy tweening.
  48. 3 points
    We really pride ourselves around here on maintaining a friendly, positive, non-snarky tone (unlike many other forums). Very sorry to hear that Blake's response came across as dismissive - I totally didn't see it that way. He's a legend around here and he even provided some demos that I thought could be very useful for your scenario but maybe I misunderstood what you were after. I see your point about modifiers potentially causing 4 redraws for each tick on each line. If I were in your shoes, I'd totally do what Blake was suggesting and use generic points almost like proxies - animate only those values (coordinates) and then in a single onUpdate (or tick listener) do all your redrawing in one fell swoop for all lines/shapes. I'm pretty confident that'd perform the best. As others have said, if you really want top-notch performance my guess is that the SVG rendering lay is BY FAR the biggest bottleneck, so perhaps consider using something like PixiJS or raw canvas or something like that. In almost every case I've seen, GSAP code is only a tiny fraction of the overall load on the device. When things get jittery, it's typically like 98%+ graphics rendering and only 0.1-2% animation code execution (CPU load). Thanks for being a Shockingly Green member, @pragdave. Is there anything else we can do to help?
  49. 3 points
    Seems like that's your performance cap no matter what related JS calculations you're doing. Most likely it'd be better to use canvas for having that many things on a screen at once. Can you please create a minimal demo or diagram of your situation? Perhaps we could make more relevant suggestions then. I didn't get that vibe at all from Blake's answer. He suggested alternative ways of using lines in SVG that may be more performant, that's all. And without seeing how you're doing calculations or even how your elements are set up it's pretty hard to give pointed help on how to improve those calculations.
  50. 3 points
    With a string like that you'd want lowercase: ease: 'power3.out' // or this would be the same ease: 'power3' More info https://greensock.com/docs/v3/Eases Happy tweening.
×