StevenJPx2 / nugget

Democratize premium animations ✨
https://nugget.stevenjohn.co
MIT License
11 stars 1 forks source link

Add custom baked presets #2

Closed StevenJPx2 closed 4 months ago

StevenJPx2 commented 8 months ago

Currently baked presets are built in, (see link).

But because of its very scalable nature and how every animate composable has a baked version, there should be a module option for adding custom presets. They'll then be able to be used in a lot of contexts without an issue.

This could be added to ModuleOptions:

{
  baked?: {
    extra?: Record<
      string,
      Omit<
        {
          [x: string]: { from: StrongTweenVars; to: StrongTweenVars } | string;
        },
        "DEFAULT"
      > & { DEFAULT: string }
    >;
  };
}

Use type templates to add to the type declaration for AnimationOptions to include the new presets.

StevenJPx2 commented 4 months ago

Closed with v1.0.0-beta.0.