sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.42k stars 4.11k forks source link

Unclear what a custom easing function should return #5595

Open teggno opened 3 years ago

teggno commented 3 years ago

This is about the docs.

While I was trying to implement a particular transition in my site I've tried to implement a custom easing function. I've had difficulties because I could not figure out what my custom easing function was supposed to return based on the t parameter. And also the meaning of the t parameter is not totally clear. Although t is probably a fraction of the point of time we're in within the transition as a value between 0 and 1.

Questions that come to my mind about the return value:

When looking at the API docs (e.g. in https://svelte.dev/docs#svelte_easing) I couldn't find anything.

ankarhem commented 3 years ago

There is a section discussing this in the tutorial.

The t value is 0 at the beginning of an intro or the end of an outro, and 1 at the end of an intro or beginning of an outro.

teggno commented 3 years ago

Thank you, @JAnken123. I still think it would be good to document this a little more thoroughly. Especially a the part about what to return from the function. A good place might be the API docs.

ankarhem commented 3 years ago

Maybe adding a link to this part of the docs would suffice? https://svelte.dev/docs#Custom_transition_functions

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.