Skip to content

Implement a reverse prop for spring() #2210

@JonnyBurger

Description

@JonnyBurger

You can already reverse a spring function:

const spr: Partial<SpringConfig> = {
	damping: 200,
};

const duration = measureSpring({fps, config});

const two = spring({
	fps,
	frame: duration - frame,
	config,
});

But (even for me) it requires quite some mental gymnastics to figure that out.

Bounty

  • Should implement a reverse parameter for spring() that takes care of this calculation (default false)
    • Important: Take into account the durationInFrames option!
  • Should document in spring.md and label as available in the next Remotion version using <AvailableFrom>
  • Write 1-2 unit test assertions

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions