Ikuro1o Posted October 11, 2021 Share Posted October 11, 2021 Hello, I'm a new user in the world of GSAP. For one reason, I'd like to know for the gsap.to() equals in pure css/ javascript. I's rather to learn the basic properties that gsap.to() uses to animate it. This is an example from Chris Course in Youtube: class Enemy { constructor(x,y,rad,color,velocity){ this.x = x; this.y = y; this.rad =rad; this.color = color; this.velocity = velocity; } create() { c.beginPath(); c.arc(this.x, this.y, this.rad, 0, Math.PI *2, false); c.fillStyle = this.color; c.fill(); } update() { this.create(); this.x += this.velocity.x; this.y += this.velocity.y; } } //When a bullet reach a big enemy gsap.to(Enemy, { rad: Enemy.rad -11 }); //... Is there any pure css or javascript equal for the gsap.to() in the example? Thank you in advance Link to comment Share on other sites More sharing options...
Solution OSUblake Posted October 11, 2021 Solution Share Posted October 11, 2021 Welcome to the forums @Ikuro1o There's no real CSS equivalent in the example code you just gave as CSS only works with DOM elements. If you'd like to know how GSAP works, I'd suggest checking out some of the Coding Math videos on tweening and easing (episodes 27-31). He even mentions GSAP. 😁 https://www.youtube.com/user/codingmath/videos 3 Link to comment Share on other sites More sharing options...
Ikuro1o Posted October 11, 2021 Author Share Posted October 11, 2021 Thank you for the welcome and the reply @OSUblake It's a bit disappointing though, no js/ css alternative for the gsap.to, but at least I got some valuable sources to learn. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now