Leaderboard


Popular Content

Showing most liked content since 03/12/2012 in all areas

  1. 9 points
    You can't animate most flexbox values because they're words, e.g. flex-start, space-around, column-reverse. You can't say, animate to column reverse. The browser has to do the layout. But that's actually a good thing as that's one less thing you have to calculate. To do a flexbox animations, start off by recording the position of your element in it's current state. Now change its flexbox style and let the browser reposition it. Now record the new position of your element. You now know where the element was, and where its supposed to be. Now move your element back to it's old position and animate it to it's new position. This all takes place in between animation frames, so you won't see the jump. This technique will work for every flexbox property. It will actually work for any type of layout that the browser handles, like the new CSS grid. For more information, check out these threads.
  2. 9 points
    There is this big, big tree. Uuuuh, that's high. I always wanted to climb it. Can I? First touch. The peeling is thick, and itchy, but warm and inspiring confidence. I lay my arms around it, starting to rub up. Hmm? Aaha– Okay– That's how– Nice! It's working. That's all I wanted. No need to leave this robust stem. But wait. What's that? There's a branch! And another? I'm curious– The more I climb this tree –body pressed tight onto it– the fear of these little branches slowly fades. I finally, gently step on one. Sometimes they crackle, but never break! My tight grip loosens up; Cheeks stop scratching as I lift my head– Oh boy! So many branches. And look how high I am! Wait what? There's a bird! And anoter one? I start talking to the birds. More birds. I felt like a king just walking the branches. The birds taught me how to jump on them! And soon I'll fly. Soon. I have never experienced anything similar. Such an easy entrance, .. well .. once you accept the word Tween as a thingy describing an animation One can work with GSAP without knowing anything more but .to, .set, and .from. Easy to learn, hard to master. You decide how far you go. When you are part of this special breed of developers/designers, be careful! Because GSAP will suck you in, won't let loose and change the way you see and work the web. That's what I love most. Thank you guys for that. 4 hour research until 1:30am in my freetime, and still burning so much inside that I had to write this. That's how awesome GSAP is.
  3. 8 points
    Hi alessio, Just use transformOrigin. TweenMax.fromTo('.test', 0.6, {scale: 1}, {scale: 1.1, repeat: -1, repeatDelay:0, yoyo: true, transformOrigin: 'center center'});
  4. 8 points
    That's because when a tween is defined it is rendered immediately to the start position, usually only noticed in the case of 'from tweens'. Because you are using set at the start of timeline, it is behaving same. You can set immediateRender to false on first tween and it will behave as expected. Well and you can use just fromTo tween to same thing. // To tween tl.set(".slide", { opacity: 1, immediateRender: false }); tl.to(".slide", 1, { x: 300, opacity: 0 }); // fromTo tween tl.fromTo(".slide", 1, { opacity: 1, immediateRender: false }, { x: 300, opacity: 0 });
  5. 8 points
    Hello dear friends, No doubt Christmas is coming ... Hi @Jonathan - sorry, when I saw your new portrait, I just felt the need to redecorate my tree to dedicate it to the GreenSock community. I coded my first Christmas tree inspired by the work of Petr Tichy (here) Dec 2015. It was one of my first exercises. Kind regards Mikel
  6. 8 points
    Hi, For last few days I wanted to start making few video tutorials, I got this idea when I was responding to a thread where somebody wanted to recreate simple carousel effect. This is my first tutorial ever, I plan to make more tutorials mostly based on questions that I answer here. If you feel like you can learn from me, feel free to request any tutorials. I will try to do it depending on the topic and if I can solve it myself. Most of my tutorials will be for those who are just getting started with GSAP. Following is the very first tutorial I made today.
  7. 8 points
    I've made a few games using GSAP: Nevergrind - Single-Player RPG Firmament Wars - Realtime Multiplayer Strategy Game I have no regrets using GSAP. It's my favorite tool and as far as I'm concerned it hasn't limited me in any way and I feel very productive with it. I plan to make a 3rd game, a multiplayer co-operative rogue-like follow-up to Nevergrind. Developing games with GSAP is a pure joy. If needed you can even pause the game, as long as you don't use setTimeout or setInterval. As long as every timer and animation is created using GSAP (TweenMax, TimelineMax, TweenMax.delayedCall), you can just do TweenMax.pauseAll() to pause the game (this can be done in Nevergrind by hitting ESC). Since GSAP can tween any object value using any ease, it's simple to Tween using the set method, onUpdate, over time, or whatever kind of animating you need to do. Hope that helps. Discovering GSAP was like finding the holy grail for me because I was seriously using JQuery's .animate before that.
  8. 8 points
    Hi @menschies ! Welcome to the forums! Always remember: With Great Powers, Comes Great Responsibilities. Use them wisely, use them to make things a little bit nicer. A few comments: You can use images instead of inlining the whole SVG if you are not changing the inside of it. The solution to your question is about nesting the separating the elements and nesting them based on your needs. I'm super busy these days but I wouldn't mind lending a hand whenever possible for your landing page - within limits. I can't take any responsibility at the moment.
  9. 8 points
    So you can imagine, it's Saturday night and there's another deadline looming on Monday. I'm just about to settle in to what I reckon is about 2 hours of work animating "a magical trail randomly jumping around the screen". I got some ideas so just need to crack on. Before I do I just check the "ease-visualizer" and low and behold I find "rough", which I'd forgotten about. Give it a go and that's kinda what I needed, 20 mins later I have finished the job. This keeps happening Jack you have thought of everything and now I don't have any work to do so can enjoy my Saturday evening. So inconsiderate, I mean there's nothing good on TV!! Realised I bought TweenMax 8 years ago, people thought I was mad spending that much money on a tween engine (for Flash). I've used TweenMax in every project I've worked on since buying it and can't imaging developing without it. So just a quick thanks and I'm off to get a beer.
  10. 8 points
    Hi dear community! I know you missed new releases with HERO banners. Today I present 3 of them! Please give us feedback if you like them. 1. World Of Tanks — Take Control Animation here 2. World Of Tanks — Video 360° Animation here 3. World Of Warships — Dunkirk Collaboration Animation here Thank you!
  11. 7 points
    Hi @Raistlin That's a nice effect. Are you asking if that website uses GSAP or just how to make something like it in general? As far as I can tell, they're using CSS transitions. This would normally fall outside the scope of GSAP support, but coincidentally I'm in the middle of creating something quite similar for some interactive infographics so I'll show you what I'm doing. I'm using SVGs in my project, but you can do it with some plain old divs too. The secret is setting the origin point for the divs so they go around the circle correctly. That website is using a pretty big parent circle (3000px) so they set the origin point of the divs to the center of that circle (1500px) and then rotate them. The fade at the top and bottom is accomplished with an additional div over the top of everything with a gradient background image that's transparent in the middle. Here's a basic example of what you could do: I'm manually setting the start rotation of each box with a set() tween, but if you had a lot of elements, you could get them to their starting positions with a loop too. To get the infinite part to work, I simply set() the rotation of each box back to the beginning as it drops down out of view. I just use a simple counter to pick which box is set back to the beginning and when the counter reaches 1, I reset it back to 6. Again, the fade-out at the top and bottom is created with a gradient div over the top of everything. There would be other ways to approach this, but this is how I'd do it. Hopefully it gives you a starting point. Happy tweening and good luck with your project.
  12. 7 points
    I'd definitely echo @GreenSock's advice and convert that to a path. I've fought with many circle animations and that is the easiest approach. (You can also convert it to a path before exporting from your vector software if you like.) I started a thread last year about SVG circle fun in the various browsers. It may be of interest to you. Happy tweening.
  13. 7 points
    Hi and welcome to the GreenSock forums. The way I normally attack this situation is using React's lifecycle methods, most specific the componentDidMount method. With that you know for sure that all the child have been rendered before making the animation. This is a sample that uses a code similar to that. Unfortunately I don't have any samples around with the specific behavior you need but hopefully you'll get the gist of it: Basically when creating each child (which in this case come as a hardcoded array, but getting the data via props shouldn't be much different) you give it a unique ref attribute to each which then you can use to loop and create the timeline or the stagger instance if you like (to create a stagger instance just reach to the array in the props and that should do it), then create the timeline and finally play it. I'll try to whip something during the afternoon that matches what you need. This is another sample but it uses a different approach, since it uses Transition Group since the elements are mounted and unmounted depending on the user interaction. It doesn't use a timeline or stagger, just a simple delay. This relies in the fact that the code is executed very fast (for larger apps you could consider server side rendering or perhaps another approach, once all the elements are rendered, perhaps pagination to render a small chunk of elements) and that the components are rendered in the sequence they exist in the app's data (again hardcoded in an array). But considering the fact that in a real app React will render all those child components at once so we can rely on that delay to create the stagger effect. Pay no attention to the code that's commented out, that's there in case someone needs to use CSS Transitions. The only catch is that the duration const used in the <Transition> component has to be the same that the one used in the GSAP instance, otherwise the component mount/unmount will be out of sync with the animation. https://codesandbox.io/s/7Lp1Q8WBA Hope this helps. Happy Tweening!!!
  14. 7 points
    Hello dear friends, Kind regards Mikel
  15. 7 points
    I think I see what the problem is - GSAP doesn't natively interpolate "vw" or "vh" units (though it likely will when 2.0.0 is released, but that won't be for a few months most likely). It can set() them directly, but interpolating is different. In this case, the inbetween values are converted to px. So here's a solution that gives you the same result but just does the conversion for you at the right time: Is that what you're after?
  16. 7 points
  17. 7 points
    Hi @ericshew The most noticeable problem is line 19. //Switch this tl.reversed() ? tl.play() : tl.reversed(); //to this tl.reversed() ? tl.play() : tl.reverse(); That should get everything working for you. It can certainly work with playing and reversing the timelines like that, but you'll see some harsh morph jumps when hovering on/off quickly between <li> tags. You could get some smoother morphs with rapid hovering like this: Just my two cents worth. Hopefully that helps. Happy tweening.
  18. 7 points
    yPercent is the easiest, but the slowest because it has to calculate more stuff because it's based on the size of the element. And the reason for the translate and matrix transform is so that you can animate yPercent and y separately. TweenLite.to(box, 1, { yPercent: -50, // translate value y: 100 // matrix value }) GSAP has some performance stuff built in. Inspect your middle box (box2). GSAP switches from 3d to 2d at the end. However, if you set force3D to true, it will only use 3d. But really, your best bet is to just test and see what works best for what you're doing. Performance will vary a lot depending on what you're animating, and the browser. Setting will-change: transform in your CSS might provide the best performance for Chrome, but if you try that in Firefox and the element is too big, you might get a warning in your console saying that the surface area is too big, and will-change has been canceled. It's definitely frustrating figuring out what works best for everything.
  19. 7 points
    Hi @DD77 pls check these out : and the second one: are these what you looking for?
  20. 7 points
    Hi @kaliel Since you're not animating anything that would require an element to be redrawn, converting this over to PixiJS would be pretty easy. You're SVG could be used like a sprite sheet, which is good. 1 graphic is much better than 400+ graphics. I can show how to do that later, but you'll be able to animate 10,000 objects without skipping a beat. Press down to add more bees. That's running without using a particle container, which would make it even faster.
  21. 7 points
    Hey Blake, About 30 seconds into your previous post (exaggerated demos of waapi vs gsap) I had pulled out the Ban Hammer and was giving it a nice polish;) Great job debunking the myths of the gurus! I can't help but laugh and cry a little when I hear people say "you should only animate transforms and opacity". Normal person: "I'd like to animate the width of this.." Guru: NOOOOO, STOP! It will cause a repaint! Your site could crash, especially on mobile devices! Normal person: "I just ran an augmented reality demo on my phone where a horde of zombies exploded in front of me" Guru: You don't understand, laying out a grid with different sized fonts is EXTREMELY processor intensive.
  22. 7 points
    I don't think so. About the only thing a WAAPI timeline has in common with a GSAP timeline is the name. All I can say is that you should give it a test drive. If you like creating CSS animations keyframes, and are familiar with CSS animation terminology and properties, you'll like WAAPI. Now don't get me wrong, I would actually like to see @GreenSock add something like keyframes to GSAP, I've just never asked for it. It would be really helpful for situations that otherwise might require you tween the progress of a timeline with another animation, but I certainly wouldn't want to use keyframes as the basis for all my animations. Weren't you the one that brought up cargo cult programming? As WAAPI becomes more widespread, it's going to be like 2013 all over again. But instead of people saying that CSS animations are better than JS animations, the mantra will be that CSS and WAAPI animations are better than JS animations. Why? Because that's what some performance gurus over at Google said, and they know what they're talking about. And some of the stuff I've read on Twitter and Medium is also pretty convincing. I mean, just look at this comparison. This is what happens when the browser is busy, which apparently happens all the time. The JS animation on the left is all jank, while the WAAPI animation on the right doesn't skip a beat. Amazing! Don't believe me? See for yourself. I spent a lot of time coming up with an algorithm that accurately simulates how a normal site behaves. That demo says all that needs to said. WAAPI is clearly better. No further testing is required. Oh wait... a challenger appears. It's called "Something other than transforms or alpha". Oh how the tables have turned! Turns out that WAAPI is indeed susceptible to jank. Not only that, but the jank can be magnified if the animation gets out of sync, looking like a video game with really bad collision detection, glitching through walls and stuff. So locking the browser up to show how jank affects JavaScript animations is just stupid, and can actually disprove what you're were trying to prove. Besides, if your site really has that much jank, then one or more of the following must be true. You're not a good developer or just starting out. You're scroll jacking the interface. See previous point. You're creating a WordPress site and just discovered themes and plugins. See first point. You're viewing a demo showing how JavaScript animations are affected by jank. You're using IE6 with 40 different custom search bars while running BonziBuddy. So all those demos and articles that talk about the performance benefit of WAAPI are not entirely true. WAAPI only performs better when it's being demonstrated using cherry picked conditions. There are like several hundred different CSS properties that can be animated. To say that you should only animate transforms, alpha, and a couple filters is crazy! That's sounds more like a coding challenge. And what about SVG? Should we just ignore that all together? I think not.
  23. 7 points
    Hi lennco, Welcome to the forums. Thanks for the demo. Sorry to hear you hit a snag. I was able to confirm (via watching the elements in dev tools) that when you reverse to the beginning, the display value is sometimes staying on inherit and not changing back to display:none. Although it is rare, there is an inconsistency we have to look into further. Putting a set() at the beginning of a timeline (time(0)) is very tricky because a set() is a tween with no duration. Since it has no duration it has to technically complete as soon as it is created on first run. And even though it has no duration (the start time and end times are both 0) it still has to record a start value and end value, or in your case a "before the timeline plays forward values" and a "after the timeline plays forward value". Where things get super tricky is when you consider what happens when the timeline is reversed? When you reverse back to a time of 0 should the value you set() at a time of 0 be rendered (in your case:display:inherit)? Or the value that existed BEFORE the timeline was played be rendered (display:none). Although it could be argued both ways it appeared the more desired behavior was that if you REVERSE back to 0 then the user would want to see things as they were BEFORE the timeline first played. There is logic in the engine that detects this condition and will render the value before the "set" occurred. That is why you see things mostly working correctly when display:none is set after reversing. However, their is also logic in place that accounts for the situation where a timeline has played forward and then the user wants to do pause(0). What should happen then? At a time of 0 you are specifically using a set to set a value so at a time of 0 in this case we render the "end / completed" state of the set. I forked your demo to snap the menu close by using pause(0) instead of reverse(). If you look at dev tools you will see that the inline style stays as display:inherit because at a time of 0 you have a set that dictates that must happen at a time of 0. You can see that behavior here: https://jsfiddle.net/wp7qb448/ All that to say, dealing with 0-duration sets() at the beginning of a timeline is very difficult under the hood. As we look into this further, there is a solution that I believe will give you the desired results. Don't put your set at a time of 0, add it just a little bit into the future like: tl.set(allSub, { display:'inherit' }, 0.0001); This will ensure that when you reverse the playhead always goes backwards beyond this point and will render the beginning state of the set (display:none) See it here: https://jsfiddle.net/zh54cr7u/
  24. 7 points
    So what is the edit at the bottom about? What kind of solutions are they looking at, or possibly thinking about? Right now I'm just not seeing a lot of value in WAAPI from an animator's perspective. The performance is nice, but it's not a game changer. And there will be other ways to improve GSAP performance in the future. Have you looked at Houdini? The cornerstone of Houdini is the CSS Typed Object Model. It's CSS with types e.g. number, length, matrix, keyword, color. The current CSS object model is string-based. To animate the DOM, the browser and GSAP have to spend a lot of time parsing, converting, and building string values, which is dumb. A matrix should not be a string. With Typed OM, that process will be mostly eliminated. .box { height: 30%; } // What's the height? console.log(getComputedStyle(box).getPropertyValue("height")); // "259.5px" console.log(getComputedStyleMap(box).get("height")); // CSSUnitValue {value: 30, unit: "percent", type: "percent"} That can provide a HUGE performance boost. I don't remember what talk I heard this from, but somebody benchmarked animating transforms on 1000 elements using rAF. They found that the browser was spending about two-thirds of the frame budget just parsing the transform strings. When benchmarked using Typed OM, the parsing time was virtually eliminated. The goal of Houdini is to make looking at caniuse.com a thing of the past. You will no longer need to wait around for a browser to implement a feature. Just copy and paste the raw code that makes it tick! One part of that raw code might be paint worklets using the Custom CSS Painting API. It allows you to draw stuff directly to an element's background, border, content, mask, etc. Paint worklets run in a separate thread, so it could be used to improve performance. I was looking at how GSAP could be leveraged inside a separate thread, but some changes would need to be made to the library. A worklet has no access to the window or document, and there are no timing mechanisms like requestAnimationFrame or setTimeout. An animation would have to be manually stepped setting something like a time or progress value. And a paint worklet is stateless, so you can't save/store values. You can create instances of stuff, but the painting has to behave almost like a pure function. One reason for that is because the browser can create the same worklet multiple times, and will kill them as it sees fit. Another reason is the same paint worklet can be called multiple times for different properties or different elements. I know that sounds like using GSAP would be pointless, but it could still be leveraged. On the DOM side, GSAP can tween something like a progress or time value, and in the worklet we can take that value, and plug it into a tween or timeline to interpolate values on some objects. We can then use those values to paint stuff on the element. It's works just like a canvas animation. Here's a demo that animates Google's logo. Yeah, I copied most of it, but look at the paint code. It's calling an interpolate function everywhere. That could obviously be replaced with a tween or timeline. Even better, using the MorphSVG plugin with canvas Path2D objects which can draw SVG paths. On the DOM side, I'm using GSAP to tween a simple --scale property, which is what drives the morphing animation. Well, there's also a --total-time property, but that is being updated by a rAF call. It's used to animate the balls up and down when the --scale is at 0. Note that in order to view this demo, you must use Chrome or Opera, and enable the Experimental Web Platform feature. You can always disable it afterwards if having it enabled scares you. You can copy and paste this into your address/search bar to jump directly to the flag. about://flags/#enable-experimental-web-platform-features And once you have that flag set, be sure to check out some of the Houdini demos here. https://lab.iamvdo.me/houdini/ripple Houdini is still evolving, so there's lots of room to make suggestions and get something incorporated into the spec. Getting the WAAPI spec to change will much harder as that's more mature. Houdini does have a draft for an animation worklet, but right now it seems to be geared towards doing scrolling animations with WAAPI. I would much rather have a general purpose JavaScript animation worklet that doesn't depend on WAAPI or DOM elements.
  25. 7 points
  26. 7 points
    Hi and welcome to the GreenSock forums, Regardless of what the effect is, the main thing GSAP is going to handle for you is the sequencing of animations. What it boils down to is taking a fullscreen element, introducing a column on the right that is split vertically, and then introducing another column on the right that is split vertically. I would start with trying to do the css layout for the final state: http://prntscr.com/hdrf3p Just try to get a few different colored divs to fill the screen like that. And then use TimelineMax to sequence each element coming in and resizing as necessary. 90% of the challenge is going to be in building the HTML and CSS the right way. I'm guessing the GSAP code is going to literally be 3 or 4 lines for that transition. If you don't know TimelineLite/Max, put this project to the side and experiment with the basics. https://greensock.com/sequence-video https://greensock.com/position-parameter
  27. 7 points
    Thanks for the illustrations and demo. I had to relearn a technique I illustrated in Flash tutorial 6 years ago http://www.snorkl.tv/2011/08/tile-transitions-for-grid-building-and-masking/ (select diagonal top and click toggle) If you add each box's row number to column number you will get values the increase across the grid in a diagonal. You can use these numbers to generate the offset of each animation in a timeline. In the demo below I put the sum of column and row in each grid. Since you don't want a delay of 36 or 49 seconds we multiply that by 0.03 to shrink it down. Try using (c*r) for a nice curve instead of diagonal
  28. 7 points
    Hi all, one mask - two rects - one timeline - the help of use that simple it can be
  29. 7 points
    Results may vary, but <use> elements are not static, so the browser has to track changes across every instance. https://stackoverflow.com/questions/8604999/does-reusing-symbols-improve-svg-performance This slide show reveals really poor performance. http://slides.com/rovolutionary/tuning-svg-performance-in-a-production-app#/ Performance issues aside, the real issue when working with the <use> tag is that everything is hidden inside a shadow-root, which you can't access. That might be ok for static icons, but not for animations.
  30. 7 points
    Believe it or not, the trick here is the easing! I did something similar to kind of give a "slot machine" rolling aesthetic to the end of a sentence here What you'd want to focus on is the ease: Elastic.easeInOut.config(8, 0) For your case, "8" might be too much ... so modify that to get the right feel for your project.
  31. 7 points
    Hi @Nineve Use scale instead of zoom. Problem solved. Serializing and deserializing the position and rotation of draggables should be real easy. In that demo, you can loop through the array of draggables like this. draggables.forEach(function(draggable, index) { var target = draggable.target; var transform = target._gsTransform; console.log("Rotation", transform.rotation); console.log("X", transform.x); console.log("Y", transform.y); });
  32. 7 points
    A couple quick things ... you have a lot of variable names/selectors going on ... learnmore $learnMore '#learnMore' First and foremost, your first line needs to be capital `M` in the id `learnMore` because that is how the ID is assigned in the html, and you don't use the # when get an element by id. var learnmore = document.getElementById("learnMore") Then ... use your variable 'learnmore' ... not other misspellings; e.g. $learnMore. Technically you can use the '#learnMore' selector as GSAP has a built selector engine. But, for consistency, I would use the variable that is already created. Lastly, use event listeners to call the functions wrapping each Tween
  33. 7 points
    Hello @timdtand welcome to the GreenSock forum! This is happening due to not returning your timeline in your timelineone function. GSAP add() method expects a timeline being returned when you have a function. So your missing this inside timelineone() fucntion return tl; And all together function timelineone(){ var tl = new TimelineMax(); tl.from(".tekst1",1,{x:250}) .to(".tekst1",1,{scale:0.1,autoAlpha:0}); return tl; // your missing this line } And now you can see your animation run Checkout this CSS Tricks Article by the Mighty @Carl on how to write smarter animation code: https://css-tricks.com/writing-smarter-animation-code/ And this: Happy Tweening!
  34. 7 points
    onCompleteAll is different than onComplete callback. Following is syntax for it.
  35. 7 points
    Hi @RuizBox Welcome to the forum and thank you for joining Club GreenSock. @Sahil is exactly right, drawSVG only works with strokes. The problem you'll encounter with your design is the gradients in the stroke of your logo. There are ways around this and we've had some discussions about animating gradients in strokes, but I think there's a much easier approach for you. If it were me, I'd add a mask over the top of the logo and use drawSVG to animate the mask and reveal the logo. Like this: If you have additional questions, a CodePen demo is the best way to get answers as we can easily edit your code to find a solution for you. Here's some info about that. Hopefully this helps with your project. Happy tweening and welcome aboard.
  36. 7 points
    Hello! I've been meaning to drop a pen here but it took me forever to find some spare time and then another eternity to conceptualize the bits needed for the animation.
  37. 7 points
    I guess my question would be "why?". GSAP is great at manipulating element properties over time and managing those timelines. The pen above illustrates something a bit outside of that scope. While I'm sure something could be whipped up with GSAP ... why when the solution in the pen handles it perfectly?
  38. 7 points
    In that case, more people will be willing to help you if you provide your code. Just post new question and attach codepen with your current code so we can help you out or guide in right direction.
  39. 7 points
    Hi @alan0buchanan It really depends on where you look. On this forum, and places like CodePen, you're not gong to find a lot of people using ES6. Look around a place like HTML5 Game Devs, and it's a completely different story. I think most people start using ES6 because of some library/framework they are using. If a person is using React, there's a good chance they are also using ES6 because it's used in all the examples. But I've noticed that a lot of people still live in a jQuery world. The only code they are exposed to is what they see in jQuery's documentation and 10 year old answers on Stackoverflow. So I would have to say that the reason you don't see a lot of ES6 is just plain ignorance. A lot of people have never heard of it, or are misinformed. You'd be surprised by how many times people have asked me how to convert Babel into JavaScript. If you want to see more ES6 examples, people need to be informed, so help spread the word. What is ES6? It's the 6th version of JavaScript, and is also known as ECMAScript 2015. ES5 was the previous version, and came out in 2009. Why should I use it? Because it's JavaScript. There's a lot of new features that can help you write code that is cleaner, smaller, and more concise e.g. arrow functions, string templates, destructuring assignment, computed property names, classes. What is Babel? It's a tool to convert modern JavaScript (ES6) into code that can be used in older browsers. What about performance? There are some new features that haven't been optimized by browsers yet or need a polyfill. This will of course change over time, but if something is too slow, don't use that feature. Most of the features are syntactic sugar, so there should be no difference in performance.
  40. 7 points
    Hi @madfatter Looks like they're using a SVG with some png graphics for that effect. I'm not sure why they have pngs. I'd probably make the whole thing a SVG. The animation itself is pretty easy. You rotate the entire graphic, but each smaller piece rotates an equal amount in the opposite direction so they stay upright. You could then animate the text opacity at each stop. I made a similar rotation of planets as an answer to another forum question. Maybe it will give you some ideas. If you're just getting started with the JavaScript version of GSAP, I'd recommend: https://greensock.com/jump-start-js https://greensock.com/get-started-js Once you have something started, we'd be happy to assist you with any GSAP related problems or questions. For the best possible answers, please provide a demo with any questions. Here's some info about that: Hopefully this helps. Happy tweening.
  41. 7 points
    Hey @kvnmcwebn! I think you are overcomplicating things here. There's a simple way around it with minimal code. Try changing the following: From this: <div id="head" style=" margin-bottom:-100px; z-index: 9999; top:50; left: 100; "> <h1 style="color: #ffffff;"> Some Text Here<h1> </div> <svg>...</svg> To this: <svg>...</svg> <div id="head" style="top:50px; left: 100px; position:absolute"> <h1 style="color: #ffffff;">Some Text Here<h1> </div> The browser reads and parses the code from top to bottom so, if you want to have something sitting on top of something else, you should always first have the relevant code doing so. There's no need to have z-index involved if you can get the same result by just altering the order of you HTML. And since you are making things responsive, I would also recommend wrapping those two elements in another tag and having its position set as relative. That is because absolutely and fixed positioned elements are always aligned to the first parent element with a position:relative which, might not always produce the desired effects if you do not set one yourself. <div style="position:relative"> <svg>...</svg> <div id="head" style="top:5%; left:10%; position:absolute"> <h1 style="color: #ffffff;">Some Text Here<h1> </div> </div> Note that I have changed the top and left to percentages. And that you forgot to add the unit (px) in your original code. I've also seen that you are trying to tween a boolean value somewhere in your code as you have the following error in the console: 'invalid randomize tween value: true'. You might want to check that out. Other than that, good job, this project of yours is shaping up quite nicely. Happy Tweening!
  42. 7 points
    Hi @kvnmcwebn Have you seen these pens by @chrisgannon ? He's creating those speed lines in a loop with the drawSVG plugin. That plugin is a Club GreenSock bonus, but you can experiment with it on CodePen. Here's some more info about the Club. https://greensock.com/club Hopefully that helps a bit. Happy tweening.
  43. 7 points
    You can usually find whitespace in between words.
  44. 7 points
    Thanks for the demo, very helpful. I think smoothChildTiming:true will help. Docs for smoothChildTiming: https://greensock.com/docs/#/HTML5/GSAP/TimelineLite/smoothChildTiming/
  45. 6 points
    Hi @Annika Providing a simple demo is always the best way to get help, even if it doesn't work. You only have 1 object, demos, but you need 2 objects. The best way to go about what you're doing is to create an array of objects. You can add more animations later by adding another loop, but this should help you get started.
  46. 6 points
    Hi rgfx Your section's width is bigger than its child and content doesn't overflow, try to remove section's width in your CSS or set to smaller value
  47. 6 points
    Are you talking about this line of code? tl.to('.header', 3, { opacity: 0, onUpdate: moveDown() }) When referencing a function, don't put the parentheses at the end. That will immediately call the function. So try this. tl.to('.header', 3, { opacity: 0, onComplete: moveDown })
  48. 6 points
    You had missing parentheses on line 35. hoverTwoTL.reversed() ? hoverTwoTL.play() : hoverTwoTL.reverse();
  49. 6 points
    Hi @wrongholt Welcome to the forum. Just a couple changes and you'll be good to go. Your selector should change: // switch this var thumbs = document.querySelectorAll('#redBox', "blueBox"); //to this var thumbs = document.querySelectorAll( "#blueBox, #redBox"); Then you can clearProps of the zIndex when you hover off the element. Here's a fork of your pen: Hopefully that helps. Happy tweening.
  50. 6 points
    Hello @pauljohnknight and Welcome to the GreenSock Forum! Sorry your having this issue This is happening due to the way you have your positional offsets (top, right, bottom, left .. and the use of position absolute with no relative) for your span elements and their parent <div>'s. Even before you start animating.. as a rule of thumb and to enforce cross browser layouts. It's best to always remember to have your parent element have position relative which acts like a main stage anchor point for any children that are position absolute, like your span tags. Without using position relative the browser has no way to know what parent are the absolutely positioned elements positioned relative to, this is very important. Otherwise you will get crazy positional layouts when introducing CSS transforms which will make things worse if the proper foundation of CSS position isn't there. Once you have your elements layout properly using position relative and absolute, then you know the underlying HTML and CSS layout will be positioned the same cross browser. Then you can start animating the elements Do you mean something like this? What i did: first i make sure the #wrapper is filling up the entire viewport, since by default height is not inherited and is default auto. This has to be done in either two ways. Either make the root and body element have height 100% or you must use viewport units for the #wrapper to make the height stretch to fit. As well as adding position: relative, very important give your absolutely positioned elements parent, which in this case is .leftblock have a defined width and height which is the same as its children so the browser knows what your bounding box is for that element and its children. for the CSS rule .leftblock span i comment out your transform rotate and let GSAP set() that rotation. And gave .leftblock span a defined height (even though when rotated it looks like its the width) I used the position parameter (see below youtube video) in your to() tween to offset the tween by a relative negative 100th of a second ("-=0.1") removed CSS property bottom from span#digital and placed on it's parent .leftblock I removed DIGITAL DESIGN text and from span#digital and placed it in a new <span> called span#digital-text that will also get rotated. (this is so when span.underline1 is animated it does not cause bad blurry anti-alias webkit bug) after that you notice that it doesn't shift to render your text on each line animation Resources: CSS position: https://developer.mozilla.org/en-US/docs/Web/CSS/position Happy Tweening!