Jump to content
GreenSock

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

Leaderboard

  1. OSUblake

    OSUblake

    Moderators


    • Points

      349

    • Content Count

      4,704


  2. ZachSaucier

    ZachSaucier

    Administrators


    • Points

      179

    • Content Count

      650


  3. GreenSock

    GreenSock

    Administrators


    • Points

      148

    • Content Count

      13,502


  4. PointC

    PointC

    Moderators


    • Points

      55

    • Content Count

      3,464



Popular Content

Showing content with the highest reputation since 09/22/2019 in all areas

  1. 4 points
    If you know the index position of the element it should be something as simple as this: document.querySelector(".anyclass:nth-child(3)"); If you don't then you'll have to do a querySelectorAll(".anyclass") and then iterate through that collection and find a specific attribute in the targeted element. Happy Tweening!!!
  2. 4 points
    Hey folks, My buddy built an online tool for minifying and compressing banner ads. He's been working with large-scale banner campaigns for 20 years and is always looking to "solve problems with code". He showed me Itsy Banner yesterday and it pretty much blew me away. It's still in beta but ready for testing. He asked me if I knew anyone who could give feedback. I told him I know where all the pros hang out 😎 I know some of you have talked about gulp tasks you run and similar tools. Very curious to hear your thoughts on this and whether or not you've seen anything better out there. I made a very informal video highlighting what it does: Please take a few zips of your banners and drop them on http://itsybanner.com/ or just press the demo button to see a bunch of pre-made banners. Some quick notes: no special coding is required in your banner! you can optionally set up a config.js file for image compression and a bunch of other stuff got some crazy three.js + gsap banners? Throw them at it. Let's see what it can do. I don't want this to turn into a big Itsy Banner support thread... just looking for some initial feedback to help him get this thing off the ground. Hopefully even in beta this thing can end up saving you some time and make your production easier. Thanks! Carl
  3. 4 points
    I recommend using a regular input element with type="range" for this. You don't even need GSAP, really https://codepen.io/GreenSock/pen/oNNxOxR?editors=0100 If you need more control over the styling (stying default input elements across browsers can require a lot of testing/workarounds) then you could create a dummy version using divs like you did and hide the input. But this approach avoids the issue you describe above. Edit: Looks like Blake beat me by half a second
  4. 4 points
    Hi @Ek1 Just add actionHover.progress(.5)after you setup your timeline (line 120 on your codepen).
  5. 4 points
    Hi @Ek1 Have you tried using .fromTo Tweens for this? That way the start and endpoints are both existing in the animation code. actionTrHover .fromTo($trPoly,time, { attr: { points: "0,0 100,0 100,100" } }, { attr: { points: "-10,0 100,0 100,110" } }, 0)
  6. 4 points
    You can write your own function. var docStyle = getComputedStyle(document.documentElement); function getProp(value) { return docStyle.getPropertyValue(value); } TweenMax.to(".foo", 1, { color: getProp("--red") }); TweenMax.to(".bar", 1, { color: getProp("--some-other-value") });
  7. 3 points
    Do you have a GSAP question? You probably have a problem in your css, like position. *, *::before, *::after { position: relative; }
  8. 3 points
    Changing the scroll position is messing with Draggable. Probably something @GreenSock will need to check out. But I would just use an input range, and style it vertically. Very quick example. https://codepen.io/osublake/pen/98aea4b0fc9545874b686bb1f23257a8
  9. 3 points
    You'll need to provide a demo to show the problem.
  10. 3 points
    No, I didn't use those plugins. I was just demonstrating how you can use a simple calculation to figure out where something is on grid with dimetric projections. Using those plugins is definitely the easiest route. Not really. The path just needs to follow exactly where you want your object to move along. During development, it might help if you can visibility see the path, to make sure your object is following it correctly, but after that you can hide the path. In this version, I moved the path inside the SVG's <defs></defs> tags so it doesn't render the path. https://codepen.io/osublake/pen/3e35d4db342b87436c59ae09fe0ae88f An easy way to start testing stuff out is on CodePen. Check out this post about how to get started with CodePen. It has some starter templates with all the plugins loaded that you can fork. You can just copy and paste your SVG markup inside the HTML section of a pen. If you're using Illustrator for SVG, here's a good post that shows how to get the markup.
  11. 3 points
    Just build the path on the fly. https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths Is this what you're going for? https://codepen.io/osublake/pen/d1b65a87c5bb18ff6187680c036d24ac If you want curves, here's one way to do it. https://codepen.io/osublake/pen/862fc46fb3781fcc08ddfd7e5fa9f6f3
  12. 3 points
    How I mostly do it is as follows: Split the text using SplitText utility Stagger the character elements Just a quick demo https://codepen.io/kishin-karra/pen/jOONQrQ
  13. 3 points
    Yeah, the key in situations like this is to add some points/anchors strategically, like in the area where there's more complexity. Here's a fork where I added a few anchors to your circle: https://codepen.io/GreenSock/pen/3e9d1e04813e3894985befe810a2b4f3 <path id="start1" class="cls-1" d="M0,207.78C0,177.4,24.624,152.78,55,152.78,58.038,152.78,61.01762,153.026,63.92129,153.5,81.692,156.398,96.6,167.812,104.322,183.417,105.685,186.17074,106.825,189.055,107.716,192.046,109.201,197.03,110,202.31238,110,207.78,110,211.88,109.55,215.877,108.7,219.72,106.714,228.692,102.538,236.84,96.76,243.574,86.67313,255.331,71.7,262.78,55,262.78,24.624,262.78,0,238.156,0,207.78z"/> Does that help?
  14. 3 points
    Like this? Notice the repeat. TweenMax.staggerFrom(".st10", 0.3, {opacity:0, ease:Expo.easeIn, yoyo:true, repeat: 1}, 0.35);
  15. 2 points
    Sounds more like a ScrollMagic question. https://github.com/janpaepke/ScrollMagic It looks like you are using CDN for some of your scripts. Why don't you do that for ScrollMagic? https://cdnjs.com/libraries/ScrollMagic
  16. 2 points
    @brnlmco That's far too much to wade through to help. If you have this running live somewhere, I may be able to help by looking into developer tools. But, knowing that scrollTo works quite simply, if it's not working for you I have a feeling there is some other JS interfering.
  17. 2 points
    Thanks guys, I found that my problem is that I am using componentDidUpdate, because I need to children to listen for the parent change and that was causing the problem, but I will use React Transition Group. I will add the CopePen next time, sorry about that, thanks a lot!
  18. 2 points
    Because the angle isn't as steep as it is in true isometric, 116.565 degrees vs 120 degrees. That video talks about the difference starting at around 1:30. A quick fork that allows you adjust the values. I'm not sure I'm not seeing that when I set z1 and z2 to the same value. Do you mean that it should be hidden when z is 0? And what browser are you seeing that in? https://codepen.io/osublake/pen/44a86e5c54ec6d6ad0c85cfe50f4fcf2
  19. 2 points
    Hey kbeats, good question A few notes: When using timelines, you almost always want to initialize the timeline at the beginning and then manipulate/control (i.e. .play(), .pause(), .progress(), etc.) that timeline. If you create a new tween every hover event (like you're doing in your demo above) you're adding to the timeline each time, therefore not really using the timeline's functionality. When you find yourself repeating code over and over again, that's usually a good time to make your code more abstract! Most of the time that means using functions more. It looks like your _out animation is really just a reverse of your original animation. So we can make use of GSAP's .reverse() method. Instead of adding everything to each button specifically, it's more efficient code wise to select both (all of) them at the start and then loop through each of them to prevent code duplication. You can attach the timeline to the element itself to make accessing the timeline more easy in other parts of your code. Altogether, I'd do it by using an approach like this one: https://codepen.io/GreenSock/pen/PooqwQy?editors=0010
  20. 2 points
    Nice find! Never knew about that event, although I just did a quick test, and it looks like sticky doesn't work with the smooth scroll. I'm guessing it's because the element technically isn't being scrolled. It's being translated in another container.
  21. 2 points
    Your English is fine. 😀 Sorry, but I really don't have a lot of free time to work on this right now. I'm thinking that it might be possible to keep it from scrolling using position:sticky. Kind of like this. https://codepen.io/osublake/pen/41a997ea6297132313629b608d0ba39f Although I'm not sure how you can determine if an element is sticky.
  22. 2 points
    You aren't using a valid target. Like this. TweenMax.from(linePath, 1, { drawSVG: "0%" });
  23. 2 points
    Thanks, that worked perfectly! I had done everything except resetting the TweenLite and pausing the Timeline before clearing it. Really appreciate your help.
  24. 2 points
    Sort of. You can tween from middle values by using a fromTo, i.e. t1.from("#Trace_line", 10, { drawSVG: "50% 50%" }, { drawSVG: "0% 100%" }); So with your demo we can get the percentage of each circle and animate from the first click percentage to the later one: https://codepen.io/GreenSock/pen/xxxKpaJ?editors=0010 Note that I changed your mapping function. I am not sure where you were getting the values that you had... If you need to change the actual origin (i.e. where the wrapping point is; which one is "first") that's technically doable but a bit more complex. In GSAP 2 I think you'd have to change the actual path which wouldn't be fun.
  25. 2 points
    It's not hard, and I have plenty of demos that do this (search around this forum or my pens on CodePen), but I don't have the time to work your problems out for you. This is very similar to the demos I made in this thread.
  26. 2 points
    Just rotate the wheel so your arrow points to the top. No need to modify the code.
  27. 2 points
    thanks guys - sorted
  28. 2 points
    Hey @Chris Prieto, Try a circle with 5 points https://codepen.io/mikeK/pen/MWgMQeL It could be tear-ish ... Mikel
  29. 2 points
    You don't need to unobserve, you can just change .play(0) to .play() and make sure that the timeline is paused (and prevent the intersection observer from firing on load). https://codepen.io/GreenSock/pen/GRKbWEp
  30. 2 points
    Hey @bootstrap007, Welcome to the GreenSock Forum. Try for example this code https://codepen.io/mikeK/pen/rNBEVda Happy tweening ... Mikel
  31. 2 points
    Well, "butt" and "square" are values of the SVG path's stroke-linecap. I was just saying that's the type of linecap you need to use in this case. Animating a path should be straightforward, but here are some simple demos pulled from other threads: https://codepen.io/GreenSock/pen/KWQrvm?editors=0010 https://codepen.io/GreenSock/pen/KdPKZY
  32. 2 points
    This is from another project, but may help. See how the target follows the path on the first tween, but draws the path on the second part. https://codepen.io/PointC/pen/WpPRxo Lines 12-14 are the important part. tl.add("label") tl.to("#path2", 3, {drawSVG:true}, "label"); tl.to("#target", 3, { bezier:{values:motionPath2, type:"cubic"} }, "label"); By using a label, both tweens play at the same time. One animates the target along the path while the other draws the actual path. Hopefully that helps a bit. Happy tweening.
  33. 1 point
    https://codepen.io/GreenSock/pen/gOOgwZV?editors=0010 I did several things here: I switch out the anchors that you had for real buttons. There's no reason why you should use an anchor for moving slides/images, anchors are for navigation. I switched your (now real) buttons to use the disabled attribute instead. This is not only more semantic and accessible, but is easier to manage via CSS. I simplified your enable/disable function. You really are just checking two things: 1) is the counter at the first position? and 2) is the counter at the last position? Based on that information, you set the state of the buttons. I changed your (not working) animations for each box to animate the container instead. It's simpler and more logical. I added a resize event on the window to keep it responsive. I assumed you would allow the button to be clicked before the animation completes. If you don't want this, you will need to keep track of the animations and check .isActive(). Let me know if you have any questions about my approach! Happy tweening.
  34. 1 point
    Sure, like this?: https://codepen.io/GreenSock/pen/zYYoXmR?editors=1010
  35. 1 point
    Thank you Zack. That did help. I'm glad to hear that I didn't make a poor chose with what to call in GSAP. Any other tips would be appreciated. As for GSAP 3, what I have seen of it has me excited. I might do a performance profile of this same use case implemented in GSAP 3 to see if there's any boost.
  36. 1 point
    It really is as simple as including a link to TweenMax and then starting your animation after the ad initializes (the animation code does not need to be any different than usual for GWD). Here's a step by step article on Medium: https://medium.com/@alexcleary/google-web-designer-and-greensock-c11473130184 To keep things cleaner, you can also keep your animation in an external JS file.
  37. 1 point
    It's not involved. Delete that tween code, and it would still work the same. You're setting the d attribute, which makes the path visible.
  38. 1 point
    Alternatively, just use more lines https://codepen.io/GreenSock/pen/BaaBEqy?editors=0010
  39. 1 point
    If you're looking to go from the start (or last clicked dot) to the clicked dot, you could use this: let t1 = new TimelineLite({paused: true}); t1.from("#Trace_line", 10, { drawSVG: "0%" }); document.body.addEventListener("click", e => { var percent = parseFloat(mapDot.get(e.target.id)) / 10; TweenLite.to(t1, 2, {progress: percent}); });
  40. 1 point
    Why are you even using a staggger if there's only 1 element?
  41. 1 point
    I've searched in a lot of forums and sub forms on here and I can't quite figure this out... I've remade a similar codepen using three.js and it is pretty much the same (albeit much less code) as the initial codepen I added to this thread. I can get it working with the mouse (it is a little clunky but good for a POC). Now I am trying to get Tween to work to slow the animation down to where it doesn't snap to the mouse pointers location. In the codepen I have the Tween code commented out and the values that are setting the rotation in. I can't seem to get the tween to work, I am getting a 'cannot create property '_gsTweenID' error. I've looked through a couple forum posts and it references that you shouldn't specify the *.y or *.x properties, but I can't get any rotation out of it when I remove them. https://codepen.io/austin-areaux/pen/LYPKRXP
  42. 1 point
    Hey @Davros, Here is another hint to svg. Use svgomg to clean your svg. Try to hand code simple shapes: more here. https://codepen.io/mikeK/pen/jONRJmM Happy tweening ... Mikel
  43. 1 point
    Try putting the transform to center it in GSAP as well. That way GSAP knows its there: https://codepen.io/GreenSock/pen/XWrQLgz
  44. 1 point
    If you have the demo working like you said you did, you can simply change out the plane for a circle. Like I said in the past, it would be helpful to have a demo of your issue(s) because right now we have nothing to help with. The below thread can provide more information about how to do so:
  45. 1 point
    Hello @kresogalic, could you post a codepen from your replica attempt? But if it is animation with text, I believe that the demonstration below will give you an idea,} there are several ways to do it, that was the one I found easier. Using the GSAP SplitText Plugin. Look: Hope this helps you. 😊
  46. 1 point
    Interesting approach, but it's pretty easy to do an isometric projection. It's even easier to do a diametric projection. You draw stuff at 26.565 degrees instead of 30 degrees. Why would you use a weird angle like that? Simplicity. Don't think in angles. It's a 2:1 ratio. If a tile is 100 wide, then its height would be 50. That's how isometric computer graphics are usually drawn. https://en.wikipedia.org/wiki/Isometric_computer_graphics You define positions as row and column values in a grid. Getting the projected coordinates is done like so, where x would be the column, and y would be the row. var xCoord = (x - y) * tileWidth / 2; var yCoord = (x + y) * tileHeight / 2;
  47. 1 point
    Good news: Google pushed GSAP 2.0 to their CDN recently (for use with DoubleClick and AdWords ads): TweenMax (most popular): https://s0.2mdn.net/ads/studio/cached_libs/tweenmax_2.0.1_min.js Everything else: https://s0.2mdn.net/ads/studio/cached_libs/timelinelite_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/timelinemax_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/tweenlite_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/scrolltoplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/cssplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/easelplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/raphaelplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/bezierplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/cssruleplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/roundpropsplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/modifiersplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/directionalrotationplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/pixiplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/colorpropsplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/textplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/attrplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/endarrayplugin_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/easepack_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/draggable_2.0.1_min.js https://s0.2mdn.net/ads/studio/cached_libs/jquery.gsap_2.0.1_min.js Notice they removed the MD5 hashes that made the old 1.18.0 links so cumbersome. Yay Google! Codepen also updated their "Quick Add" menu to point to 2.0.1. If you get news of other ad networks that have similar news to share, feel free to post here. Enjoy!
  48. 1 point
    Yeah, sorry about that - I put that 1000-second limit on GSDevTools to avoid situations where crazy long (like infinite) timelines couldn't really be controlled intuitively (imagine dragging 5 pixels and that making the timeline shoot ahead by thousands of seconds). I didn't really think folks would intentionally go beyond 1000. You should be able to simply set a "maxDuration" vars property to override that if you'd like, like GSDevTools.create({..., maxDuration:5000}); Does that help?
  49. 1 point
    Hi reubenlara Welcome to the GreenSock forum. You can add a function using the add() method, but it doesn't take parameters. Please use the call() method like this: // change this .add(insertBG("01.png",".testcard"), "scene01") // to this .call(insertBG, ["01.png",".testcard"], this, "scene01") That should get you working correctly. Here's some more info about call() https://greensock.com/docs/#/HTML5/Animation/TimelineMax/call/ If you have other questions, it's usually best to start a new topic. When you post on the end of a thread that is marked answered your question could get overlooked and we want to get you the best answers possible. Hopefully that helps. Happy tweening.
  50. 1 point
    Have you ever wanted to bring the 3RD dimension into your project with the DrawSVG plugin? Using a series of masks we can simulate an SVG stroked path navigating around or through a subject in a photo. This path can be solid, dashed, dotted or whatever you like. My new demo uses some things from my post above about animating dashed strokes with masks, but goes a bit further. Get wrapped up in the swirling 3D lines of the DrawSVG plugin: http://codepen.io/PointC/full/ZWEqdK/ If you want to use this technique, here’s a bit of info: Start with the photo you’re using at the maximum size you think you’ll need. (Note: You can responsively swap to smaller versions as long as you maintain the same aspect ratio.) Create a new AI file the exact same size as you biggest photo. Import the photo for use as the background while designing your SVG. (Be sure to also create a plain rectangle that’s the same size as the SVG so everything lines up at export time) Draw the stroke that will be wrapping around/through the subject to your liking. Duplicate that path and make it #fff – this copy will be the mask. Unlike my earlier post where I mentioned making the mask path wider than the original, this time it needs to be the exact width as the underlying path. If it’s wider, you’ll inadvertently be showing extra parts of the original path at perpendicular intersections. (Note: making a duplicate path for a mask reveal is only necessary if you want to use dashed strokes. If you’re using solid strokes only, you can simply animate them directly with the DrawSVG plugin.) At all points where the stroke should be going behind the subject, draw a polygon over the subject with a color of #000. All these polys will be a part of your SVG mask along with the stroke mask that will animate. The polygons will be static but will scale perfectly. For my demo, I used three separate strokes to create a simple tube effect as it draws and you can see a bit of the perpendicular intersection reveal problem if you watch for it. It’s not too bad, but something to keep in mind. As mentioned above, if you’re using a solid stroke and don’t need dashes, no mask path will be necessary and this isn’t going to be an issue for you. You would just need your subject masking polygons. Finally, I put the image into a containing div and let the image drive the size of it. Place your SVG into the div with absolute positioning and a width of 100% so it can scale along with the image and containing div. All that’s left after that is to control the mask reveal and animate any changes in the stroke that you like. Note: the demo uses the DrawSVG plugin which is a Club GreenSock perk at the Simply Green membership level. I highly recommend it. Happy tweening everyone.
×