Jump to content
Search Community

Petr Mucha

Members
  • Posts

    7
  • Joined

  • Last visited

Petr Mucha's Achievements

1

Reputation

  1. I guess ticker is what I was looking for. It seems like the most proper way to combo raf and gsap. The quickSetter I've already discovered examining the .set() method :) And once again, thanks a lot!
  2. Hmm I think it comes from working with three.js where You just need raf to make things moving (render scene) I'll do the testing on how it would work with direct animation of css. Thanks a bunch for Your time Have a good one!
  3. My question was more general like if it is a totally wrong idea to use gsap to animate a variable rather than css property. The combination of requestAnimationFrame and gsap tween for changing the value of a variable. It's in the whole code not just a line or two. I use this key function to make it move: move_the_cube(){ /* * MAIN LOOP EVERY ANIMATION FRAME */ if(this._y >= 360) this._y = 0; window.requestAnimationFrame(()=>{ this.cube_el.style.transform = 'rotateY('+this._y+'deg)'; this.cube_rotator_el.style.transform = ' rotatex('+this._x+'deg)'; this.move_the_cube(); }); } }
  4. Oh You just need to click the grey boxes on the left and right to see it moving.
  5. Thanks for the reply! I want the requestAnimationFrame to be watching a variable simple because there are more factors influencing it during the Life Cycle of the app. It'll be increased over time automatically and different types of interactions will take place so I was considering this hack of tweening, increasing, decreasing and resetting the variable rather than the css property. Just for simplifying things in coding. I am fine with it. The only thing is whether it would influence the performance in a bad way or no. https://codepen.io/mindfulness/pen/povzgjL I suck in Codepening but here's the example. The thing is that the cube shall have various ways of interaction like swiping, automove and such so the idea of having one variable changing and the rest done by every frame loop seems quite nice to me, but...
  6. Petr Mucha

    Animating CSS

    Hi, I was wondering whether it is a good practice to use gsap to tween an integer and than asign this integer to an css property with requestAnimationFrame function, or it'is a nonsense and is always better to tween the css property with gsap css plugin. And if so, than why?. Thanks for any answers P
×
×
  • Create New...