Jump to content
Search Community

bdrtsky

Members
  • Posts

    81
  • Joined

  • Last visited

Posts posted by bdrtsky

  1. Following my previous question about looping. After I tryed to modify it a little bit to add overlaping (so the next animation trigger not after previous completely ends, but slightly earlier) I have issue that I can't solve.

     

    First I tried to use simple setInterval. Works fine on first sight, until I switch browser tabs. After that looks like asynchronisation is happens. 

     

    My question is, how do I loop animation, but add some shift on next animation start? delay is not helping in this case -  

     

    What I need is both elements start to animate in the same time (one leaving, the other entering). Is there some native API for this? because setInterval is not working.

    See the Pen EJReev by bdrtsky (@bdrtsky) on CodePen

  2. Hello again everyone on this great forum.

     

    I started to play with DrawSVG and have a question. I bet it was asked thousand times before, I read some answers, still confused about the sythax and principle of work.

     

     

     

    Here, checkbox animated from left to right and then from right to left. But how to make second (exit animation) animation also move from left to right? 

    See the Pen ZZxVgx by bdrtsky (@bdrtsky) on CodePen

  3. OK, I ended up like this, case closed :D

     

    const rem = parseFloat(getComputedStyle(document.documentElement).fontSize)
    TweenMax.to(circle, 0.5, {
      x: e.clientX - rem/2,
      y: e.clientY - rem/2
    })

     

    I assume there's like a zillion different units in CSS that needs to be implemented so calc could work smoothly, so it's bettter to do that in JS.

    • Like 1
  4. Good day, everyone.

     

    I am trying to do so

     

    TweenMax.to(circle, 0.5, {
      x: `calc(${e.clientX}px - 0.5rem)`,
      y: `calc(${e.clientY}px - 0.5rem)`
    })

     

    But it's not working. Can I do that? Tryed to google, saw a bunch of bug reports, but looks like people using it? How?

  5. Yes, this is super helpful, thank you @Dipscom

    I will play with original anime.js animation more, to understand each step.

     

    From what I can see right now, it is animating from z 0, to z 8 ( 8 = 0*8 + 8) (and this is only the `from` part), and then to z index*20 + 20 and at the end of `to` it resets to 0 again! Am I getting this right, to solve this with GSAP I will need Timeline with at least 3 animations instead of one simple animation (without timeline) with anime.js?

     

    1. from 0 to z 0, to z 8 ( 8 = 0*8 + 8)

    2. from z 8 ( 8 = 0*8 + 8) to  index*20 + 20

    3. from  index*20 + 20 to 0

  6. Hello, guys. 

     

    Trying to port beautiful anime.js effect to GSAP and have troubles.

     

    The effect itself is here (the first one) - https://tympanus.net/Development/StackMotionHoverEffects/

    The code is here - https://github.com/codrops/StackMotionHoverEffects/blob/master/js/main.js#L63

     

    I made a Codepen to show my issue - 

    See the Pen oVqBEX by bdrtsky (@bdrtsky) on CodePen

     

     

    1.  The anime.js code have this piece 
      translateZ: [
          { 
              value: function(target, index) {
                  return index*8 + 8;
              },
              duration: 200 ,
              easing: [0.42,0,1,1]
          },
          { 
              value: function(target, index) {
                  return index*20 + 20;
              },
              duration: 700,
              easing: [0.2,1,0.3,1]
          }
      ]

      This is fromTo values. But GSAP doesn't have API to set from and to duration and easing separately, right? What should I do then? And I don'treally can't image how this separate values are applied. Any ideas how this work, on what stage?

    2. Why my animation have initial jerking?

    3. Why my elements doesn't moves up?

     

    How to port it properly? 

    See the Pen oVqBEX by bdrtsky (@bdrtsky) on CodePen

×
×
  • Create New...