js-plugin icon indicating copy to clipboard operation
js-plugin copied to clipboard

[Feature Request]: Rethink what should happen if no animation was matched

Open hirasso opened this issue 1 year ago • 0 comments

Describe the problem 🧐

Currently, the fallback for the case where a route matches no animation seems to be incoherent.

  • The readme says that a default "proceed immediately" animation will be used: "This is also the fallback animation in case no other matching animations were found."
  • The implementation seemingly uses the first defined animation instead as a fallback

Describe the propsed solution 😎

I'd like to

  • apply the default animation as mentioned in the docs as a fallback
  • warn the user that the fallback animation was used

Alternatives considered 🤔

I also thought about letting the user animate routes without a match in JS plugin via CSS – simple CSS animation for every page transition, except this one where I need more control. But I can imagine this would come with quite some complexity.

  • Is it possible to fallback to the default handler for animation:in:await and animation:out:await if no animation matched?
  • Is there a way to prevent CSS animations on the main transition-* class if there is a matching JS animation found?
  • .... surely some other things I can't think of right now

How important is this feature to you? 🧭

Nice to have

Checked all these? 📚

hirasso avatar Apr 05 '24 17:04 hirasso