Jump to content
Search Community

jesper.landberg last won the day on January 6 2019

jesper.landberg had the most liked content!

jesper.landberg

Premium
  • Posts

    127
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by jesper.landberg

  1. So If I have a timeline like this random example: const tl = new TimelineMax() tl .from(el, 1, { yPercent: 100 }) .addCallback(someFunction, 0.5) .to(el, 1, { xPercent: 100 }) But need to change the progress initially like: tl.progress(1).progress(0) How would u do this without calling the callback? I tried removing it from the timeline, and add it like below, but doesn't seem to work as I want? const tl = new TimelineMax({ paused: true ) tl .from(el, 1, { yPercent: 100 }) .to(el, 1, { xPercent: 100 }) tl .progress(1) .progress(0) .addCallback(someFunction, 0.5) .play()
  2. Can I force matrix transforms? I find those smoother then the "translate(XX, XX) translate3d(0, 0,0)" ones.. or am I just imagining this?
  3. Hi, What I want to do: Repeat part of a timeline infinite, until a window.onload callback, after which the timeline should play out fully. Any tips how to do?
  4. Am I the first one here to say u shouldn't animate backgroundPosition, but instead try to stick to transforms?
  5. You probs solved this already but the problem is in your prev() function, ur just setting this.data.next. It should/could look like this: prev() { if (this.data.animating) return this.data.direction = "back" this.data.next = this.data.current this.data.current = this.data.current == 0 ? 2 : this.data.current - 1 this.slideIt() } Then u could just check the direction in slideIt() for example like this: const translateX = this.data.direction === 'back' ? -100 : 100
  6. @TEQQED What I would do is create a GSAP timeline, then increase the progress of it tied to scroll. Here I created a quick demo, it doesnt have the perspective/angle, but u get the point.
  7. I need to update those demos to some fresher/better ones:P Between the other code in those demos the actual logic for the effect is pretty straight forward. You just lerp the scroll value, check the diff between the new and old value... and apply that value to anything.. like a skew in this case. Something like the below (not tested). let scrollTarget = 0 let scrollCurrent = 0 let ease = 0.1 const skewTarget = someElement window.addEventListener('scroll', () => { scrollTarget = window.scrollY }) function render() { scrollCurrent += (scrollTarget - scrollCurrent) * ease const diff = scrollTarget - scrollCurrent const vel =+ diff skewTarget.style.transform = `skewY(${vel}deg)` requestAnimationFrame(render) } requestAnimationFrame(render)
  8. Hi, I updated my gsap version, no other changes done. Now my transitions doesn't "immediaterender", instead the elements show in the regular state before the timeline and tweens start. Did 2.1 change the default behaviour of this?
  9. Yeah, got it to work with some if isActive() kill thing:P
  10. Hi, Any tips on preventing the blue layer to get "stuck" if hovering in/out very fast for a bit?
  11. Hi, I made this site, the image is rendered with three.js, and the effect is made in a shader distorting the UV values with some sin and cos math.
  12. Yeah, i can just restart unfortunaly. Ohhh, I didn't even know about that plugin hah. Thanks.
  13. Hi, I have done a super simple typewriter effect, which works as intended, excerpt when u interrupt and restart it. The width of each char will just be correct until the previous reset point. Check the Pen to understand. If you let the whole timeline run before clicking the button, everything is fine, however, clicking it in the middle of the animation, messes up the next.
  14. @OSUblake Im animating tweens tied to scroll, and when doing an Y transform, the progress reaches 1 before the element of the tween is out of view. I reckon this is because in my this.elems array i'm only storing the start bounds of the elements, when I would need the end bounds. Take a look at the first animated element in this demo below, and u can see what I mean. So i was thinking that in my getElems method, maybe I should put the timeline progress to 1, set the bounds, then put it back to progress 0 ? .
  15. Hi, What would be the best way to get the end boundingRect of a tween? If I tween yPercent: 0 to yPercent: 200 for example. Would it be to store the rect in a variable in an onComplete callback or is there any better way?
  16. Hi, I'm trying to create a personal little mini lib/class to handle timelines tied to scroll. Could use ScrollMagic, but wouldn't learn much from that would I? Any feedback on what is done so far? Thinking about how I would play more advanced timelines, rather than just simple fromTo's. I guess those would be best of defined in the javascript, but trying to think of an elegant solution to that, any tips? Currently I define animations through data attribute, as valid json. Also, is it possible to get the end bounds/rect of a timeline/tween element in advance? Or would I need to put progress(1) .. get new rect... put back to progress(0) ?
  17. Thanks, appreciate it:) If you like those stuff i will probs like my next prod that is going live within a week or so, pretty proud of it:) Smoother than ever!:P
  18. Hi, Im trying to build out some timelines based on props and values from data-attributes. However it doesn't seem to work, and it's throwing no errors or doing nothing when i try to play or build it. What am I missing? Looks like this: <figure class="c-photos__img c-photos__img--1"> <div data-from="yPercent: 0, rotation: 0" data-to="yPercent: -100, rotation: 5, ease: Expo.easeOut"> <img src="/static/images/photo-1.jpg"> </div> </figure> <figure class="c-photos__img c-photos__img--2"> <div data-from="yPercent: 0, rotation: 0" data-to="yPercent: -100, rotation: 5, ease: Expo.easeOut"> <img src="/static/images/photo-3.jpg"> </div> </figure> <figure class="c-photos__img c-photos__img--3"> <div data-from="yPercent: 0, rotation: 0" data-to="yPercent: -100, rotation: 5, ease: Expo.easeOut"> <img src="/static/images/photo-3.jpg"> </div> </figure> <figure class="c-photos__img c-photos__img--4"> <div data-from="yPercent: 0, rotation: 0" data-to="yPercent: -100, rotation: 5, ease: Expo.easeOut"> <img src="/static/images/photo-4.jpg"> </div> </figure> <figure class="c-photos__img c-photos__img--5"> <div data-from="yPercent: 0, rotation: 0" data-to="yPercent: -100, rotation: 5, ease: Expo.easeOut"> <img src="/static/images/photo-5.jpg"> </div> </figure> this.dom.elems.forEach(el => { const tl = new TimelineLite({ paused: true }) const from = el.dataset.from const to = el.dataset.to tl.fromTo(el, 1, { from }, { to }) tl.play() // Example, this won't play or throw any error this.elems.push({ tl: tl }) })
  19. Hi @Noturnoo ! Sorry I just saw this thread now, did you archive your goal? It was me who developed the Asaro site including the slider ur referring to.
  20. Cool thanks, would it be possible to reverser the order of the stagger also? 0.075 -> -0.075 I think maybe this is more of an issue with the first tween/timeline getting overwritten? Is there any way to interupt, but not kill the other tween so it can be played again?
  21. Well yeah kind off... but what I dont like when doing reverse() is the reversing of the easing functions. I would want easeOut both directions, not easeIn which it is when doing reverse. Thats why I'm doing two timelines. Do you understand?:)
  22. Hmm. But I revert the splittext, and clear all styles from the title. And also when i switch page the title is removed from the dom, and then inserted again. I also to a fromTo, but it only sets the from values, just won't animate. I will see if I can get a simple demo up.
  23. Hi, See my attached PEN. I want the in/out timelines to interup each other seemingly. If I do mouseup before the tlGrab is finished, I want tlRelease to play from the current position. Currently it gets messy and then basically doesnt work at all. Tips, solutions?
×
×
  • Create New...