// POSITION – Clean left-to-right with subtle bounce

Screenshot 2025-08-16 at 09.58.54.png

duration = 0.28;                 // main move time
offset = [-80, 0];               // start 80px left
freq = 2.5;                      // bounce oscillations
decay = 9;                       // higher = cleaner stop
amp = 0.14;                      // bounce amplitude relative to move
stagger = textIndex * thisComp.frameDuration * 0.85;

t = time - (inPoint + stagger);
endVal = [0, 0];                 // final position offset (rest)
startVal = offset;
w = Math.PI * 2 * freq;

if (t <= 0) {
    startVal;
} else if (t < duration) {
    // Ease in smoothly
    u = t / duration;
    s = u * u * (3 - 2 * u);     // smoothstep easing
    startVal + (endVal - startVal) * s;
} else {
    // Bounce after main move
    dt = t - duration;
    endVal + (endVal - startVal) * amp * Math.sin(w * dt) * Math.exp(-decay * dt);
}

// POSITION – Clean left-to-right Transition OUT

// Position Bounce-IN (from left) + Clean OUT (to right)
duration = 0.28;                 // main move time
offsetIn = [-80, 0];             // IN from left
offsetOut = [80, 0];             // OUT to right
freq = 2.5;                      // bounce oscillations
decay = 9;                       // higher = cleaner stop
amp = 0.14;                      // bounce amplitude relative to move
stagger = textIndex * thisComp.frameDuration * 0.85;

// OUT timing
outDur = 0.25;                   // exit duration
holdTime = 1.5;                  // time to stay visible before exit

t = time - (inPoint + stagger);
endVal = [0, 0];                 // final rest position
w = Math.PI * 2 * freq;

if (t <= 0) {
    offsetIn;
} else if (t < duration) {
    // Ease in smoothly
    u = t / duration;
    s = u * u * (3 - 2 * u);     // smoothstep easing
    offsetIn + (endVal - offsetIn) * s;
} else if (t < duration + holdTime) {
    // Bounce settle
    dt = t - duration;
    endVal + (endVal - offsetIn) * amp * Math.sin(w * dt) * Math.exp(-decay * dt);
} else if (t < duration + holdTime + outDur) {
    // Smooth OUT (to right)
    u = (t - (duration + holdTime)) / outDur;
    s = u*u*(3 - 2*u);
    linear(s, 0, 1, endVal, offsetOut);
} else {
    offsetOut; // fully out to the right
}


// POSITION v1 – Slide up with extra bounce

Screenshot 2025-08-16 at 10.01.07.png

// POSITION v1 – Slide up with extra bounce
duration = 0.22;
offset = [0, 40]; // starts 40px below, slides up
stagger = textIndex * thisComp.frameDuration * 0.9;

t = time - (inPoint + stagger);
endVal = [0, 0];
startVal = offset;

// Bounce settings
freq = 3.0;     // oscillations after main move
decay = 8.0;    // higher = cleaner bounce
amp   = 0.12;   // bounce height relative to total move

if (t <= 0) {
  startVal;
} else if (t < duration) {
  // Ease into the final spot
  u = t/duration;
  s = u*u*(3-2*u);
  startVal + (endVal - startVal)*s;
} else {
  // Add bounce after duration
  dt = t - duration;
  w = Math.PI*2*freq;
  endVal + (endVal - startVal) * amp * Math.sin(w*dt) * Math.exp(-decay*dt);
}

// POSITION v1 – Slide up with bounce Transition UP

// POSITION v1 – Slide up with extra bounce + OUT upwards
duration = 0.22;               
offset = [0, 40];              // starts 40px below, slides up
stagger = textIndex * thisComp.frameDuration * 0.9;

t = time - (inPoint + stagger);
endVal = [0, 0];               // final rest position
startVal = offset;

// Bounce settings
freq = 3.0;     // oscillations after main move
decay = 8.0;    // higher = cleaner bounce
amp   = 0.12;   // bounce height relative to total move

// OUT timing
outDur = 0.25;   // exit duration
holdTime = 1.5;  // time to stay visible before exit

if (t <= 0) {
  startVal;
} else if (t < duration) {
  // Ease into the final spot
  u = t/duration;
  s = u*u*(3-2*u);
  startVal + (endVal - startVal)*s;
} else if (t < duration + holdTime) {
  // Add bounce after duration
  dt = t - duration;
  w = Math.PI*2*freq;
  endVal + (endVal - startVal) * amp * Math.sin(w*dt) * Math.exp(-decay*dt);
} else if (t < duration + holdTime + outDur) {
  // OUT upwards
  u = (t - (duration + holdTime)) / outDur;
  s = u*u*(3 - 2*u); // smoothstep
  linear(s, 0, 1, endVal, [0, -60]); // slide up 60px
} else {
  [0, -60]; // fully out upwards
}


// SCALE with Extra Bounce

Screenshot 2025-08-16 at 10.03.36.png

freq = 2;              // bounce speed
decay = 6;             // lower = longer lasting bounce (was 9)
duration = 0.15;
shoota = textIndex * thisComp.frameDuration * 1;
t = time - (inPoint + shoota);

startVal = [100, 100, 100];  // starting overscale
endVal = [0, 0, 0];          // final resting scale

if (t < duration) {
linear(t, 0, duration, startVal, endVal);
} else {
amp = (endVal - startVal) / duration;
w = freq * Math.PI * 2;

// Added multiplier for more dramatic bounce
bounceAmp = 1.8;  // increase to 2.0+ for even stronger bounce

endVal + amp * bounceAmp * (Math.sin((t - duration) * w) / Math.exp(decay * (t - duration)) / w);
}

// SCALE with Extra Bounce Transition OUT

// SCALE with Extra Bounce + OUT (shrink left)
freq = 2;                // bounce speed
decay = 6;               // lower = longer lasting bounce
duration = 0.15;
shoota = textIndex * thisComp.frameDuration * 1;
t = time - (inPoint + shoota);

startVal = [100, 100, 100];  // overscale at start
endVal   = [0, 0, 0];        // normal size (rest)

// OUT timing
holdTime = 1.2;   // time to stay before exit
outDur   = 0.3;   // duration of exit

if (t < duration) {
    // Bounce IN
    linear(t, 0, duration, startVal, endVal);
} else if (t < duration + holdTime) {
    // Bounce settle
    amp = (endVal - startVal) / duration;
    w = freq * Math.PI * 2;
    bounceAmp = 1.8;
    endVal + amp * bounceAmp * (Math.sin((t - duration) * w) / Math.exp(decay * (t - duration)) / w);
} else if (t < duration + holdTime + outDur) {
    // Scale OUT (shrink away)
    u = (t - (duration + holdTime)) / outDur;
    s = u*u*(3 - 2*u); // smoothstep ease
    linear(s, 0, 1, endVal, [100, 100, 100]); // back to "hidden"
} else {
    [100, 100, 100]; // fully gone (scaled down)
}