All Projects → waseemdev → ng-ionic-connectedanim

waseemdev / ng-ionic-connectedanim

Licence: MIT License
Connected Animation (Shared Element Transition) for Ionic Framework.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to ng-ionic-connectedanim

cordova-plugin-today-widget
Add a today widget app extension target to your cordova project.
Stars: ✭ 51 (+325%)
Mutual labels:  ionic, ionic2
ionicfirebaseauth
Exemplo de alguns tipos de autenticação com Ionic 2 e Firebase
Stars: ✭ 18 (+50%)
Mutual labels:  ionic, ionic2
Ioniclub
❤️ Ioniclub is hybird mobile app of https://cnodejs.org
Stars: ✭ 35 (+191.67%)
Mutual labels:  ionic, ionic2
build ionic2 app chinese
this is the chinese version of <build ionic2 app chinese>
Stars: ✭ 16 (+33.33%)
Mutual labels:  ionic, ionic2
fireblogger
Ionic 2 social media microblogging platform built with firebase 3 as backend
Stars: ✭ 54 (+350%)
Mutual labels:  ionic, ionic2
ionicfirebasecrud
An example of crud with Firebase and Ionic
Stars: ✭ 15 (+25%)
Mutual labels:  ionic, ionic2
ionic3-awesome
😃 ionic3自定义组件及常用例子 演示地址
Stars: ✭ 95 (+691.67%)
Mutual labels:  ionic, ionic2
sm-coal-app
这是一个使用Ionic2开发的集数据展示,交易,交流于一体的APP
Stars: ✭ 21 (+75%)
Mutual labels:  ionic, ionic2
ionic-uber-clone
Ionic 4 Taxi Booking script
Stars: ✭ 34 (+183.33%)
Mutual labels:  ionic, ionic2
ionic-uuchat
基于ionic3,angular4的实时聊天app,兼容web端。该项目只是前端部分,所有数据需要请求后端服务器,需要配套express-uuchat-api使用。
Stars: ✭ 14 (+16.67%)
Mutual labels:  ionic, ionic2
ionic-video-chat-support
Ionic 3 Video and Group Text Chat
Stars: ✭ 19 (+58.33%)
Mutual labels:  ionic, ionic2
ionic-tags-input
A ionic tags input component
Stars: ✭ 73 (+508.33%)
Mutual labels:  ionic, ionic2
ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (+58.33%)
Mutual labels:  ionic, ionic2
gl-ionic2-env-configuration
An Ionic2 Service to load an environment specific configuration before everything else
Stars: ✭ 23 (+91.67%)
Mutual labels:  ionic, ionic2
ionic-socialsharing-with-deeplinking-example
Ionic Social Sharing and Deep Linking example app. Complete Ionic Tutorial with free example app! Built for Ionic 3.
Stars: ✭ 16 (+33.33%)
Mutual labels:  ionic, ionic2
ionic-3D-card-carousel
DEPRECATED Sample project that shows an experimental 3D card carousel in Ionic.
Stars: ✭ 29 (+141.67%)
Mutual labels:  ionic, ionic2
Dianoia-app
Mobile (Ionic 3 - Angular 4) app about non-pharmaceutical activities and information for people with dementia.
Stars: ✭ 13 (+8.33%)
Mutual labels:  ionic, ionic2
ionic3-image-handling
In this ionic tutorial you will learn how to access the image gallery and take pictures from an ionic app. Also we will show you how to add a image cropper. This ionic tutorial includes a working ionic app example you can reuse for your needs.
Stars: ✭ 35 (+191.67%)
Mutual labels:  ionic, ionic2
ionic-3-video-calling-using-webrtc
This is demo code of how to implement video calling in ionic 3 using webrtc
Stars: ✭ 58 (+383.33%)
Mutual labels:  ionic, ionic2
todo-list
TodoList using Ionic2/3 & Firebase: * PWA * SSO Google plus. * Share list via QRcode. * Upload image from Camera or Storage. * Speech Recognition.
Stars: ✭ 18 (+50%)
Mutual labels:  ionic, ionic2

Connected Animation for Ionic Framework

Easily add Connected Animation (in UWP) or Shared Element Transition (in Android) to your elements.

Example Project

Here is an example

Setup

  1. install via npm:
npm i ng-ionic-connectedanim@latest --save
  1. Import ConnectedAnimationModule in you module
import { ConnectedAnimationModule } from "ng-ionic-connectedanim";

@NgModule({
    imports: [
        ConnectedAnimationModule.forRoot(),
        ....
    ]
})
export class AppModule { }

Usage

1. Basic example. as easy as:

In Page1.html:

<img [src]="image" [animStart]="'animation-cover'">
<button (click)="push()">Push page2</button>

Page1.ts:

    push() {
        this.navCtrl.push('Page2');
    }

Page2.html:

<img [src]="image" [animEnd]="'animation-cover'">

2. Multiple connected animation

Page1.html:

<img [src]="image" [animStart]="'anim-image'">
<p class="title" [animStart]="'anim-title'">
<button (click)="push()">Push page2</button>

Page1.ts:

    push() {
        this.navCtrl.push('Page2');
    }

Page2.html:

<img [src]="image" [animEnd]="'anim-image'">
<p class="title" [animEnd]="'anim-title'">

Note: If you want to use any element other than img, the animStart element and animEnd must be identical in font-*, width, height and text-align, otherwise the animation will not work well.

Example 1

3. Multiple Items as 'animStart'

When you have a list of items in the first page, it is important to pass the element index before navigate to the second page, so animation can be played correctly. Also add animItem attribute to animated element.

Page1.html:

<div *ngFor="let item of items; let i = index" (click)="pushPage(i)">
    <img [src]="item.image" [animStart]="'animation-image'" animItem>
</div>

Pgae1.ts:

import {ConnectedAnimationService} from 'ng-ionic-connectedanim';
export class Page1 {
    constructor(private navCtrl: NavController,
                private connectedAnimationService: ConnectedAnimationService) {
    }

    pushPage(itemIndex) {
        // pass item index
        this.connectedAnimationService.setItemIndex(itemIndex, this);
        // then push page2
        this.navCtrl.push('Page2');
    }
}

Page2.html:

<img [src]="image" [animEnd]="'animation-image'">

4. Manually play animation:

This is useful for elements in the same page. set autoFire to false in animOptions:

<img [src]="image" [animStart]="'animation1'" [animOptions]="{ autoFire: false }">
<button (click)="openModal()">Open</button>

<div class="my-modal">
    <img [src]="image" [animEnd]="'animation1'">
    <button (click)="closeModal()">Close</button>
</div>
export class Page {
    constructor(private animationService: ConnectedAnimationService) {
    }

    openModal() {
        // first show your modal 
        // Make sure its 'style.display' is not 'none' before playing animation.


        //let itemIndex = 0; /* Send element index if you are using ngFor */
        this.animationService.playAnimations(this/*, itemIndex*/);
        // or play a specific animation by its name
        //this.animationService.playAnimation('animation1'/*, itemIndex*/);
    }

    closeModal() {
        this.animationService.playAnimationBack(this);
        // then hide the modal...
    }
}

Example 2

Options

You can pass animation options to `animStart' element.

<img [animStart]="'animation1'" [animOptions]="options">

Options:

Option Desc.
autoFire Set autoFire to false to manually play the animation by calling animationService.playAnimation(), default is true.
type Animation type, e.g.: 'ease', 'ease-in'...
delay Animation delay.
duration Animation duration.
targetRect Target element ('animEnd' element) position or offset.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].