Thanks for reply Zach.
To make sure I not mix anything, this is what I run:
ng new testprj
npm install --save gsap
ng serve.
this is the code:
import 'gsap';
ngOnInit(): void {
gsap.set(".ball", {xPercent: -50, yPercent: -50});
const ball = document.querySelector(".ball");
const pos = { x: window.innerWidth / 2, y: window.innerHeight / 2 };
const mouse = { x: pos.x, y: pos.y };
const speed = 0.1;
const xSet = gsap.quickSetter(ball, "x", "px");
const ySet = gsap.quickSetter(ball, "y", "px");
window.addEventListener("mousemove", e => {
mouse.x = e.x;
mouse.y = e.y;
});
gsap.ticker.add(() => {
pos.x += (mouse.x - pos.x) * speed;
pos.y += (mouse.y - pos.y) * speed;
xSet(pos.x);
ySet(pos.y);
});
}
but I still get the same output:
Property 'quickSetter' does not exist on type 'typeof gsap'.
for both xSet and ySet.
Any opinions,please?