Giter Site home page Giter Site logo

angular-hero's Introduction

Angular-Hero

Create hero transitions with Angular, similar to those implemented by Google's Material Design and Polymer's core-animated-pages.

##Example

Example project here: Angular-Hero-Sample

###Install with Bower

bower install angular-hero

##Usage

  1. Include alAngularHero as a dependency in your Angular app.

    angular.module('app', ['alAngularHero'])
  2. Include the supplied CSS file or add the .hero-animating style to your own.

  3. Declare the page transitions to use on the ng-view element, including hero-transition:

    <div ng-view class="page-transition hero-transition"></div>
  4. Identify hero elements with the hero class and hero-id attribute:

    <div class="name hero" hero-id="name">{{contact.name}}</div>

    The hero-id attribute should be the same on both pages to trigger a hero animation from one to the other.

Note that for the element styles to animate correctly, hero elements should be styled by a directly applied class. For example, styling the contact name in the above example with this CSS won't work:

.screen1 .name { color: red; }

The hero element is moved out of .screen1 during the animation, so will lose its colour. Instead, add a class to the element and style directly. e.g.

.screen1-name { color: red; }

This also means that CSS styles will be animated during the transition. For example, if the target element is blue, then we'll see an animated transition from red to blue. You can also animate other styles in the same way, such as corner-radius and borders etc...

angular-hero's People

Contributors

adam8810 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.