Jump to content
Search Community

w-ap

Premium
  • Posts

    5
  • Joined

  • Last visited

About w-ap

w-ap's Achievements

  • One Year In
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Hello, Thank it's works : gsap.to(".dots", <any>{ physics2D: { velocity: 'random(200, 350)', angle: 'random(80, 100)', } }); I just noticed something with WebStorm. This doesn't work : // @ts-ignore gsap.to(".dots", { physics2D: { velocity: 'random(200, 350)', angle: 'random(80, 100)', } }); but this work : // @ts-ignore gsap.to(".dots", { physics2D: { velocity: 'random(200, 350)', angle: 'random(80, 100)', } }, '<'); I don't understand why. But nevermind and thank for the support.
  2. More information about : // @ts-ignore It works for this code : const angle = gsap.utils.random(80, 100); //ts-ignore gsap.to(".dots", { physics2D: { velocity: 'random(200, 350)', angle: angle, } }); But if there are more than one 'random()', it doesn't work : //ts-ignore gsap.to(".dots", { physics2D: { velocity: 'random(200, 350)', angle: 'random(80, 100)', } });
  3. Hello, Yes, you right. This : velocity: gsap.utils.random(200, 650, true) Throw this error (from WebStorm) : This is my current solution if this can help : function myFunction() { const velocity = gsap.utils.random(200, 350); const angle = gsap.utils.random(80, 100); const delay = gsap.utils.random(0.6, 4.5); const tl = gsap.timeline(); tl.to(".dots", { duration: 2.8, physics2D: { velocity, //Shorthand : equals to : velocity: velocity angle, gravity: -300 }, opacity: 0, delay }, '<-' + ((delay) - 0.02)); } (Sorry about the strange indentation, I don't successed to fix it) Thank you for you support. Have a nice day.
  4. Hello, This is not a big deal but there is a problem when I try to use Physics2DPlugin : gsap.timelime().to(dots, { duration: 2.5, physics2D: { velocity: 'random(200, 650)', angle: 'random(250, 290)', gravity: -500 }, delay: 'random(0, 2.5)' }); With Angular 10 this code send this error : > Type 'string' is not assignable to type 'number | undefined'. velocity: 'random(200, 650)' And when i take a look at the code (node_modules/gsap/types/physics-2d-plugin.d.ts) declare namespace Physics2DPlugin { interface Vars { acceleration?: number; accelerationAngle?: number; angle?: number; friction?: number; gravity?: number; velocity?: number; xProp?: string; yProp?: string; } } For velocity and angle, this should not be a TweenValue instead of ? Thank for you help. Best regards.
×
×
  • Create New...