Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Smooth JavaScript Tweened Transitions #197

Open
niklasgrewe opened this issue Nov 3, 2022 · 1 comment
Open

[FEAT] Smooth JavaScript Tweened Transitions #197

niklasgrewe opened this issue Nov 3, 2022 · 1 comment

Comments

@niklasgrewe
Copy link

Hi,
thank you very much for this library, i love it, really useful 馃憤 But i wonder, why cupertino-panes using css transitions and not tweened animation with the tween.js library for example. Is there a particular reason for this? perhaps for performance reasons?

The reason I ask is because I recently found a similar Svelte Component. The transition seemed even more smooth to me there. I don't know the exact technical differences, but I think it's related to the fact that the svelte component uses a svelte tweened store for the transition and cupertino-panes rely on css transition.

A demo of the svelte component can be found here:
https://svelte.dev/repl/9116699f10ac42668e7b58d120c4bc8c?version=3.52.0

@roman-rr roman-rr changed the title [Question] Is there a reason why cupertino panes use css transitions instead of tweened animation? [FEAT] Supporting smooth tweened animation by tween.js Nov 3, 2022
@roman-rr roman-rr changed the title [FEAT] Supporting smooth tweened animation by tween.js [FEAT] Supporting smooth tweened animation Nov 3, 2022
@roman-rr
Copy link
Collaborator

roman-rr commented Nov 3, 2022

@niklasgrewe Thank you for this topic.

Component you are linked to, in example, doesn't using tween.js, but using svelte tweened sub-function and cubicOut animation function:

export function cubicOut(t: number) {
	const f = t - 1.0;
	return f * f * f + 1.0;
}

Doesn't rely on css transitions, but manipulate with top, left, right, bottom css properties and percentages, based on function above.
Which is really looks pretty smooth on horizontal swipes with 400ms duration.

Seems like a good point for new Module

Some road map for this issue:

  1. Research web to identify a good proves that JS Tweens is better than CSS transitions (example)
  2. Create new module to play with JS Tween transitions
  3. Check performance and common feelings across devices/web/cordova apps
  4. Implement basic timing functions into new Module or decide to using tween.js library
  5. Merge to core and replace with css transitions

Any helps welcome 馃檹

@roman-rr roman-rr changed the title [FEAT] Supporting smooth tweened animation [FEAT] Smooth JavaScript Tweened Transitions Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants