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: dynamic route animation #646

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

stefanholzapfel
Copy link

@stefanholzapfel stefanholzapfel commented Jun 23, 2021

Description

I needed different behaviour for my route animations, depending on the route the app is going to. E.g. components should leave to the left when going deeper in the routing tree, leaving right when going "back". The simplest way was to enable the router to accept a factory function for the "animate" property that would be evaluated on every route change.

The "animation" property now also accepts a function that returns the animation object:

animate: boolean | { enter: string, leave: string} | (from: HTMLElement, to: HTMLElement) => { enter: string, leave: string }

closes #845

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

dependabot bot and others added 7 commits June 21, 2021 06:04
Bumps [rollup](https://github.com/rollup/rollup) from 2.35.1 to 2.52.2.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.35.1...v2.52.2)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
… function returning a class string instead of string directly
… function returning a class string instead of string directly
… function returning a class string instead of string directly
… function returning a class string instead of string directly
… function returning a class string instead of string directly
# Conflicts:
#	src/router.js
@CLAassistant
Copy link

CLAassistant commented Jun 23, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ stefanholzapfel
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@stefanholzapfel stefanholzapfel changed the title Feature: Dynamic route animation feat: Dynamic route animation Jun 24, 2021
@stefanholzapfel stefanholzapfel changed the title feat: Dynamic route animation feat: dynamic route animation Jun 24, 2021
@stefanholzapfel
Copy link
Author

Hi @emarc @pdurbin!
Any chance we can merge this? Thanks!

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

Successfully merging this pull request may close these issues.

Different route animation behaviour depending on from/to routes
2 participants