Jump to content
Search Community

katerlouis last won the day on May 30 2017

katerlouis had the most liked content!

katerlouis

Members
  • Posts

    238
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by katerlouis

  1. So this error is gonna be gone, once you guys have prepared v3 for typescript? Do you have an ETA? the folks here are not toooo happy that I immediately introduced yet another library and this would make them feel even worse about it – but I don't want to use the "old syntax" much longer, since only using `gsap` is much easier to digest ?
  2. Yeah, this project uses typescript sporadically, and I still haven't found the time to look into it; But with the string "power3" the error's gone. I have another error, coming from typescript though– it's off topic, but maybe you can (well.. I know you can, but hope you will! :D) tell me how to fix it: the error: ERROR in /Users/.../src/animations/AnimSlideIn.ts 6:66 Argument of type '{ onComplete: Function; }' is not assignable to parameter of type 'tweenVars'. Types of property 'onComplete' are incompatible. Type 'Function' is not assignable to type 'callbackFn'. Type 'Function' provides no match for the signature '(...args: any): any' the code: (a colleague refactored it to typescript) import { gsap } from 'gsap'; const duration = 0.4; // in s const easing = 'power3'; const enter = (el: HTMLElement, done: Function) => gsap.timeline({ onComplete: done }) .from(el, duration, { xPercent: 100, ease: easing, clearProps: 'xPercent' }); const leave = (el: HTMLElement, done: Function) => gsap.timeline({ onComplete: done }) .to(el, duration, { xPercent: 100, ease: easing }); export default { duration, easing, enter, leave, }; Thanks!
  3. Thanks for the lightning quick reply! The console logs the following: ERROR in /Users/...../src/animations/AnimSlideIn.ts 1:16 Module '"gsap"' has no exported member 'Power3'. > 1 | import { gsap, Power3 } from 'gsap'; PS: Whyyy is the max total size sooo low – pasting screenshots would be lovely!
  4. Hey guys, looong time no read; just got the news of v3 and I'm excited as hell to get deeper into it! Since I'm fully living the npm/es6/webpack life with all the hate and love that comes with it, I'm wondering how to import easings under v3? Because my current method is not working anymore: import { gsap, Power3 } from 'gsap'; I'm also wondering if I can avoid to import easings explicitly; because I like to play around with lots of easings, but even if I import all of them, the linter doesn't like importing and then not using stuff. So I hoped with v3 I could just import `gsap` and have everything I need. I mean, wasn't that the idea behind not having to import TimelineMax or TweenMax separately? Thanks!
  5. Thank you very much! My way of scaling seems to work right now and is more convenient to work with, in my opinion. Are there any issues with scaling the context to fit the coordinates of the svg viewbox that I don't see? Can't wait to show you the final result! The line draw has been descoped, surprise suprise Thanks again, kater
  6. Why does saving and restoring make the thing more perform better?! When focusing on performance, would you still say drawing these svg strokes with canvas is the way to go? Remember: I will need to animate the drawing. (And I will switch out the lil mesh-device with a repeater, which lies right behind it :D)
  7. Very interesting! I didn't know canvas is also struggling with drawing multiple circles ... So– knowing that I won't need to draw more than 30-40 circles at a time, would you say this should work with actual canvas-arcs? If I used an image for that, it needs to be quite large, since we obviously want it to look crisp on 27'' retina iMacs. How does that look performance wise? And iiif I used an image, how would the color change work? It's important to hit these exact hex values. ––– but as for the scaling issue, I don't understand how your ball-and-image-example can help me and in your viewbox codepen (4x4 grid), only scale up and never draw outside of the canvas. I'm pretty sure the key advice is in these demos, but I just don't see it – the whole "canvas scale in a dom container trying to match the svg coordinate system" is too much for me css makes the canvas html element stretch to fit it's container then I need to tell canvas in JS to match the elements size (or larger for higher resolutions) then the canvas is Writing it down like this .. I'm wondering why the circles position correctly in my example... because in my pen the scaleFactor doesn't take the ratio into account, only the relation between the svgViewbox.width and the canvas.width– Hah! The ratio is already applied to the canvas.width, which makes it influence the scale aswell. Learning as I'm writing! Bam! Hmm, maybe it's better to not scale the canvas, but recalculate the x, y, and radius values on draw. It felt more convenient to just draw using values relative to the svg viewbox and scale the whole thing. It's tedious to recalculate all values for new elements. Would all these calculations impact performance negatively? -> Just tried the recalculation of values.. this would require to scale the clipping-path aswell. So I fixed the clearRect issue with "reversing the scale" when clearing, like so: `c.clearRect(0, 0, canvas.width / scaleFactor, canvas.height / scaleFactor)` https://codepen.io/katerlouis/pen/vwMdEx This still feels like a workaround, though ... Could you fork my pen and add what you meant with your demos? Thanks!
  8. I need to recreate this animation devices feeling the need to go to the moon (fans go crazy..) https://www.telekom.de/zuhause/heimvernetzung/mesh-technologie (disclaimer, I have nothing to do with the version you see there :D) Canvas should be way more performant, right? And I've always wanted to dive into canvas! Perfect opportunity How hard could it be? Place an inline SVG. Put the canvas below, and animate some growing circles. Well.. turns out there are quite some challanges, and I don't wanna bother you with all of them. Biggest problem so far is this: I need/want to place the circles with the same coordinates as in my delivered SVG, and of course it needs to be crisp on higher resolution screens, aaaand of couuurse has to handle viewport resizes properly. I ended scaling the entire canvas-context and was pretty happy with the result .. until I drew more than one frame and saw this. What happens is: I clear the entire canvas with `c.clearRect(0, 0, canvas.width, canvas.height)` – but because the context is scaled down, the circle would start at another position and extends beyond the canvas' boundaries. This means the circle doesn't get cleared completely, which makes a part of remain visible. Now I could just do `c.clearRect(0, 0, 99999, 99999)` or go `canvas.width * 100` .. but .. I'd like to find a clean solution for this issue. So my actual question is: How do I properly match a canvas with an overlaying svg coordinate system? Another question is: How would you guys get the best performance out of this? (Because an inline svg overlaying the canvas performs noticably worse than an overlaying img tag referencing the svg file .. which I can't have, because I will need to animate the lines with DrawSVG) I'm thrilled to hear your thoughts on that. Thanks!
  9. Yeah thanks, I've also stumbled upon luxy, but saw the whole page scrolling smoothly and went on – I'll see what I can do; unfortunately not today Hopefully I understand your logic behind it!
  10. Thanks for the thread! The thing is, that the "smoothness" is only applied to the parallax effect. The scrolling itself feels native to me. Responsive and snappy as expected. I'll look into the thread this evening; I probably can apply the "smoothness"-logic only to the parallax scene So thrilled to try this out
  11. I guess I‘ve seen this effect somewhere else already, but got reminded now that I saw it on the homepage after the WWDC 2019 so if you go to www.apple.com right now and play around with the scroll, you‘ll notice that the animations don‘t stop when you hardly interrupt the scroll. It feels like the velocity you created with your scroll is not lost. Another thing I noticed (or atleast imagine..) that the animation can get only so fast, which is amazing when you scroll like a mad man to the top. Thats not uncommon with such long pages these days. A library like scrollmagic only lets you couple a tween tightly to the scroll position or trigger it at a certain point. But the dynamic playhead behavior on the apple page is awesome! I fear there are already threads talking about that, and I‘m just too dumb to find them.. but anyhow: how would you approach that? Thanks! Louis
  12. Damn– deadline is pushing so hard, that this feature has been pushed to the next round. I'll can't wait to look into the lerp and mathematic coding stuff, thank you very much guys. Thanks for the pens; I'll look into this again when I get some air to breath– (looking forward to show you what we've done this time 8)) Grüße aus Köln diesmal René
  13. The image and code pen illustrates best what I need to achieve. Of course my designers want to animate the reveal with a parallax effect. I had one approach using scale and xPercent, but failed horribly Then I tried transformPerspective and actual z-translation, which worked pretty nice. The further the elements get away, the factor in which they get smaller increases and feels natural. Spreading the elements in one direction worked aswell. But my solution has the following problems: – it is not responsive; using x and y results in only one viewport width where the distance between the elements is perfect – visually the whole construct should feel centered, which probably will be the case when the first and last element have similar padding to the outside – the amount of elements that spread on in that range need to be flexible aswell (in my case 2-6 elements, but once a system is found it probably will be able to do more elements) I guess with some more math and optics knowledge this is rather easy, .. but I'm really struggling to get this right. Any ideas, fellas? Thank you guys! Greetings, René ❤️ PS: the max size of 32kb is quite inconvenient; :F
  14. http://svgator.com Unfortunately this tool produces CSS animations (eeewh, I know!), but looks promising in terms of user experience. Since this thread aged 6 more months I'd like to ask the Elders again, if there are any plans or considerations to either collaborating with existing GUI editors to produce GSAP timelines or maybe even make your very own one?
  15. Seriously, I'm not one of these lazy spammers! I used the forum search with both "GUI" and "Graphical User Interface" and got 0 results!
  16. Heyho guys, long time no read.. A seemingly never-ending hell-spiral of React, ES6, JSX, Webpack, and Wordpress new Gutenberg-editor are driving me insane... hate have neither time nor mental capacity to contribute here Anyways! My designers came up with "this mega crazy awesome new tool, you just have to check out, yoh!" http://svgator.com It's a GUI producing svg animations. Looks quite promising; but unfortunately spits out filthy css animations (maybe they are good for css animations, but.. you know.. still css :D) It got me thinking: – Is there a GUI which produces GSAP timelines? – (since I'm quite sure there isn't) Why isn't there? – Have you guys considered making your own? – Or maybe collaborate with existing tools like svgator? René
  17. I am also interested in accessing a repeat-counter. Surely GSAP has to keep track and using one under the hood, right? My use case: var tween = TweenMax({}, 1, { repeat: 10 }) .eventCallback("onRepeat", function() { // how can I access the repeat count of the tween? var repeatCount = ??? if (repeatCount < 5) // do this else // do that inBothCases("doThis"); });
  18. Sorry if I wasn't clear enough: TweenLite.ticker.fps(15) would set the FPS of ALL tweens to 15, right? But I wanna try out to set it lower solely on these 3 animations. Or could I do something like this: // my normal animations var tween = TweenMax.to(".foo", ...) var tl = new TimelineMax() ... // set fps only for the next animations TweenMax.ticker.fps(15) // or does this function affect the tweens above aswell? var slowerTl = new TimelineMax()... var anotherSlowTl = new TimleineMax() // how to reset it? TweenMax.ticker.fps(60); // Other normal animations var tween = TweenMax.to(".bar", ...) var tl = new TimelineMax() ... I better don't go that route if fps affects ALL my tweens
  19. I suppose you can't set ticker.fps() only for a few tweens, and let the rest play it the normal FPS?
  20. Thank you very much, Jack! In your statement you are mainly talking about the 3 hefty chpater intros with the mockups, I suppose? 1) Could performance alone cause the glitchy problem, which is still present in some places, the second chapter intro with the iPhone mockup, for instance? 2) Would it be possible to tell GSAP to lower the ticks for these three animations? Less fps would be better than this mess.. 3) How comes Chrome and Firefox make it work so smoothly? Are there any known "Don't Do"s with animations in Safari? Maybe some css property which is known to f*** things up? 4) How would force3D effect performance in this situation? So far the 3 mockups get matrix() and not matrix3d()
  21. I found something! * { -webkit-backface-visibility: hidden; } seems to eliminate atleast most glitches, but not all? The page still lags horrendously. Again, only the /airberlin page is affected... Can you confirm this on the updated version? I've tested multiple apple devices, and all have still the glitches to some degree...
  22. Thanks for your help! I do $(document).ready() before the whole thing starts. And the glitch seems to occur with normal text and background colors aswell. The setup for all pages is the same, so if you would be right about that, I guess the other pages would have the same issue, which they don't :'(
  23. I don't expect one tween it to adapt like magic. Defining multiple animations per breakpoint is exactly what I want, but all the code surrounding that is really expensive. That's why I am looking for an API. But I understand that you guys have other things with higher priority at the time. That being said, I'd like to hear more about that and how others deal with these problems. What I've come up with to tackle this is tweening css vars like `--progress` and let the css handle different layouts reacting to this `var(--progress)` But this approach gets you only so far.
×
×
  • Create New...