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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nav-animations): export default ios and md transitions #25243

Closed
3 tasks done
DwieDima opened this issue May 5, 2022 · 2 comments
Closed
3 tasks done

feat(nav-animations): export default ios and md transitions #25243

DwieDima opened this issue May 5, 2022 · 2 comments
Labels

Comments

@DwieDima
Copy link
Contributor

DwieDima commented May 5, 2022

Prerequisites

Describe the Feature Request

The default page transitions for ios and md should be exposed to the developers so we can use them to create custom animations.

Describe the Use Case

I have a page transition, where the forward animation is just a fade-in effect. The back navigation should stay as it is (on ios transition from right to left).
Currently i have to inspect the ionic core code and paste the code to my method where i apply the animation.

    const enterAnimation = (baseEl: HTMLElement, opts: any): Animation => {
      if (opts.direction === 'forward') {
        return this.animationController
          .create()
          .addElement(opts.enteringEl)
          .duration(1000)
          .easing('ease-in')
          .fromTo('opacity', '0', '1');
      }
      // default ios back transition
      return null;
    };

Describe Preferred Solution

the ability to import the default ios transition to my page

  import { ..., iosTransitionAnimation } from '@ionic/core'

  private async navigateToPage(): Promise<void> {
    const enterAnimation = (baseEl: HTMLElement, opts: any): Animation => {
      if (opts.direction === 'forward') {
        return this.animationController
          .create()
          .addElement(opts.enteringEl)
          .duration(1000)
          .easing('ease-in')
          .fromTo('opacity', '0', '1');
      }
      // default ios back transition
      return iosTransitionAnimation.direction('reverse');
    };

    await this.ionNav.push(TransferPointsPage, null, {
      animationBuilder: enterAnimation,
    });
  }

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label May 5, 2022
@sean-perkins
Copy link
Contributor

Hello @DwieDima thanks for opening this feature request! I think this has a lot of overlap with #24964 and would like to combine the two feature requests.

Can you upvote that feature request to let us know you want it?

I will close this request out, but will comment on the other request regarding details from this thread. Thanks!

@ionitron-bot
Copy link

ionitron-bot bot commented Jun 4, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants