All Projects → jiayihu → Ng Animate

jiayihu / Ng Animate

Licence: mit
🌙 A collection of cool, reusable and flexible animations for Angular 9+

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Ng Animate

Progressview
🌊 A polished and flexible ProgressView, fully customizable with animations.
Stars: ✭ 425 (-32.22%)
Mutual labels:  animations
React Burger Menu
🍔 An off-canvas sidebar component with a collection of effects and styles using CSS transitions and SVG path animations
Stars: ✭ 4,544 (+624.72%)
Mutual labels:  animations
Reanimate
Haskell library for building declarative animations based on SVG graphics
Stars: ✭ 581 (-7.34%)
Mutual labels:  animations
Booksearch
A digital BookShelf for your reading progress.
Stars: ✭ 441 (-29.67%)
Mutual labels:  animations
Animatelo
Animatelo is a bunch of cool, fun, and cross-browser animations for you to use in your projects. This is a porting to Web Animation API of the fabulous animate.css project.
Stars: ✭ 453 (-27.75%)
Mutual labels:  animations
Transition X
{ } Declarative Kotlin DSL for choreographing Android transitions
Stars: ✭ 514 (-18.02%)
Mutual labels:  animations
Hamburger React
Animated hamburger menu icons for React (1.5 KB) 🍔
Stars: ✭ 391 (-37.64%)
Mutual labels:  animations
Badgehub
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
Stars: ✭ 592 (-5.58%)
Mutual labels:  animations
Trail Android
🚕 Simple, smooth animation for route / polylines on google maps using projections.
Stars: ✭ 465 (-25.84%)
Mutual labels:  animations
Awesome Design Tools
The best design tools and plugins for everything 👉
Stars: ✭ 23,754 (+3688.52%)
Mutual labels:  animations
React Native Animated Charts
Set of components and helpers for building complex and beautifully animated charts
Stars: ✭ 443 (-29.35%)
Mutual labels:  animations
Videobeautify
With this APP, you can do all kinds of professional optimising and beautifying to your videos
Stars: ✭ 450 (-28.23%)
Mutual labels:  animations
Force Js
The easy way to scroll and animate your page
Stars: ✭ 536 (-14.51%)
Mutual labels:  animations
Nextjs Page Transitions
Travel App, Native-like Page Transitions (:atom: with React & Next.js)
Stars: ✭ 424 (-32.38%)
Mutual labels:  animations
Htextview
Animation effects to text, not really textview
Stars: ✭ 5,309 (+746.73%)
Mutual labels:  animations
Flutter Examples
Personal collection of Flutter apps.
Stars: ✭ 394 (-37.16%)
Mutual labels:  animations
React Motion Layout
🦸 Beautiful immersive React hero animations.
Stars: ✭ 509 (-18.82%)
Mutual labels:  animations
Viewport Checker
Little utility to detect if elements are currently within the viewport 🔧
Stars: ✭ 596 (-4.94%)
Mutual labels:  animations
Flightanimator
Advanced Natural Motion Animations, Simple Blocks Based Syntax
Stars: ✭ 588 (-6.22%)
Mutual labels:  animations
Awesome Ios Animation
A curated list of awesome iOS animation, including Objective-C and Swift libraries
Stars: ✭ 4,983 (+694.74%)
Mutual labels:  animations

🌙 ng-animate

npm

ng-animate is a collection of cool, reusable and flexible animations for Angular. It implements all the animations in animate.css, but with the power and flexibility of Angular animations instead of CSS.

Demo

The demo of the animations is available at https://jiayihu.github.io/ng-animate/.

Usage

npm install ng-animate --save

Example

Import the animation from the package and pass it to your Angular component using useAnimation:

// my-component.component.ts
import { trigger, transition, useAnimation } from '@angular/animations';
import { bounce } from 'ng-animate';

@Component({
  selector: 'my-component',
  templateUrl: 'my-component.component.html',
  animations: [
    trigger('bounce', [transition('* => *', useAnimation(bounce))])
  ],
})
export class MyComponent {
  bounce: any;
}
<!-- my-component.component.html -->
<div [@bounce]="bounce"></div>

Note: Make sure to have included BrowserAnimationsModule in your AppModule and the web-animation.js polyfill.

It's also possible to import only a subset of the animations:

import { bounce } from 'ng-animate/lib/bouncing';

Animation params

All the animations provided by ng-animate support at least two optional params timing and delay to specify the animation duration and delay. Default value for timing is usually 1s and 0s for delay.
You can pass the params object using the Javascript API or within the component template:

@Component({
  selector: 'my-component',
  templateUrl: 'my-component.component.html',
  animations: [
    trigger('bounce', [transition('* => *', useAnimation(bounce, {
      // Set the duration to 5seconds and delay to 2seconds
      params: { timing: 5, delay: 2 }
    }))])
  ],
})
export class MyComponent {}

Using a template can achieve the same result, but you'll have access to the component context:

<div [@bounce]="{ value: bounce, params: { timing: myTiming || 5, delay: myDelay || 2 } }"></div>

Animations

All the animations are organized by their group. Many of them have additional params other than timing/delay: refer to Advanced Usage for more details. Nevertheless you can probably ignore them if you're happy with how they are by default.

Attention seekers

  • bounce
  • flash
  • pulse
  • rubberBand
  • shake
  • swing
  • tada
  • wobble
  • jello

Bouncing

  • bounceIn
  • bouceOut. Additional param: scale

The following bouncing animations have additional params a, b, c, d for translate

  • bounceInDown
  • bounceInLeft
  • bounceInRight
  • bounceInUp
  • bounceOutDown
  • bounceOutLeft
  • bounceOutRight
  • bounceOutUp

Fading

All fading animations have additional params fromOpacity, toOpacity for opacity transition and a, b for translate.

  • fadeIn
  • fadeInDown
  • fadeInLeft
  • fadeInRight
  • fadeInUp
  • fadeOut
  • fadeOutDown
  • fadeOutLeft
  • fadeOutRight
  • fadeOutUp

Sliding

Sliding animations are basically fading animations without a change of opacity. They can also receive the same params.

  • slideInDown
  • slideInLeft
  • slideInRight
  • slideInUp
  • slideOutDown
  • slideOutLeft
  • slideOutRight
  • slideOutUp

Flippers

  • flip
  • flipInX
  • flipInY
  • flipOutX
  • flipOutY

LightSpeed

  • lightSpeedIn
  • lightSpeedOut

Rotating

All rotating animations have additional params fromOpacity, toOpacity for opacity transition, origin for transform-origin and degrees for rotate3d.

  • rotateIn
  • rotateInDownLeft
  • rotateInDownRight
  • rotateInUpLeft
  • rotateInUpRight
  • rotateOut
  • rotateOutDownLeft
  • rotateOutDownRight
  • rotateOutUpLeft
  • rotateOutUpRight

Specials

  • jackInTheBox
  • hinge
  • rollIn
  • rollOut

Zooming

  • zoomIn
  • zoomOut

The following zooming animations have additional params a, b for translate

  • zoomInDown
  • zoomInLeft
  • zoomInRight
  • zoomInUp
  • zoomOutDown
  • zoomOutLeft
  • zoomOutRight
  • zoomOutUp

Advanced params

Many of the animations support also other params like scale, fromOpacity, toOpacity and much more, allowing extremely flexible usage and customisation if you're not happy with default values.

Single letters like a, b, c, d are used for the steps of some animations: a is the starting value, d is the ending.
The animated property they refer to depends on the animation and the direction: usually translate on axis Y from -Down/-Up, axis X for -Left/-Right.

useAnimation(bounceInDown, {
  params: {
    timing: 5,

    // Specify granular values for `translate` on axis Y during 'bounceInDown' 
    a: '-3000px',
    b: '25px',
    c: '-10px',
    d: '5px',
  }
})
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].