tl.timeScale() for GSAP Timeline Events

Maybe we (aka you) could add a field to enter a timescale when crating a timeline event.

Example use case:

Rn I’m working on a site using fullpage.js. Using its callbacks, I reverse a timeline before scrolling to the next section. In the event created, I simply select my timeline and choose to reverse it, perfect :smiley:
But if I want the reverse to be faster, I’d have to duplicate my initial timeline, adjust all the timings and if there are any changes, fix up both timelines.
Adding a timescale option would make it cleaner and less confusing to work with imo.

Docs for timeScale → Docs - GreenSock

Or I guess I could just do it in JS using the timeline ID but a lil input would be neat :slight_smile:

EDIT:
So I was just trying to get this to work in JS and I’m feeling a lil confused haha.

if I try n get the timeline like so:

const tlHero = getTimeline('db2f2332-5261-da37-f96d-f7b504643543');

it returns the promise instead of the timeline object.

Right now I got it working like this:

const tlHero = getTimeline('db2f2332-5261-da37-f96d-f7b504643543');
// console.log(tlHero);
tlHero
  .then((value) => {
    value.tl.timeScale(3);
    value.tl.reverse();
  })
  .catch((err) => {
    console.log(err); 
  });

Is this the way or am I missing something? I mean it works but somehow I feel there might be a better way or I’m just overthinking it.

1 Like

Hey @manc! Jup, have .timescale() on my list for the next update :slight_smile:

2 Likes