How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • export const slideInAnimation = trigger("routeAnimations", [
      transition("HomePage <=> AboutPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("300ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
      transition("* <=> FilterPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("200ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
    ]);
    
    Docs
    0
  • query(':enter', [
        style({ left: '-100%' })
      ]),
      query(':leave', animateChild()),
      group([
        query(':leave', [
          animate('300ms ease-out', style({ left: '100%' }))
        ]),
        query(':enter', [
          animate('300ms ease-out', style({ left: '0%' }))
        ])
      ]),
      query(':enter', animateChild()),
    ]),
    transition('* <=> FilterPage', [
      style({ position: 'relative' }),
      query(':enter, :leave', [
        style({
          position: 'absolute',
          top: 0,
          left: 0,
          width: '100%'
        })
      ]),
      query(':enter', [
        style({ left: '-100%' })
      ]),
      query(':leave', animateChild()),
      group([
        query(':leave', [
          animate('200ms ease-out', style({ left: '100%' }))
        ]),
        query(':enter', [
          animate('300ms ease-out', style({ left: '0%' }))
        ])
      ]),
      query(':enter', animateChild()),
    ])
    Docs
    0
  • animations: [
      trigger("flyInOut", [
        state(
          "in",
          style({
            width: 120,
            transform: "translateX(0)",
            opacity: 1,
          })
        ),
        transition("void => *", [
          style({
            width: 10,
            transform: "translateX(50px)",
            opacity: 0,
          }),
          group([
            animate(
              "0.3s 0.1s ease",
              style({
                transform: "translateX(0)",
                width: 120,
              })
            ),
            animate(
              "0.3s ease",
              style({
                opacity: 1,
              })
            ),
          ]),
        ]),
        transition("* => void", [
          group([
            animate(
              "0.3s ease",
              style({
                transform: "translateX(50px)",
                width: 10,
              })
            ),
            animate(
              "0.3s 0.2s ease",
              style({
                opacity: 0,
              })
            ),
          ]),
        ]),
      ]),
    ];
    
    Docs
    0
  • export const slideInAnimation = trigger("routeAnimations", [
      transition("HomePage <=> AboutPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("300ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
      transition("* <=> FilterPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("200ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
    ]);
    
    Docs
    0
  • query(':enter', [
        style({ left: '-100%' })
      ]),
      query(':leave', animateChild()),
      group([
        query(':leave', [
          animate('300ms ease-out', style({ left: '100%' }))
        ]),
        query(':enter', [
          animate('300ms ease-out', style({ left: '0%' }))
        ])
      ]),
      query(':enter', animateChild()),
    ]),
    transition('* <=> FilterPage', [
      style({ position: 'relative' }),
      query(':enter, :leave', [
        style({
          position: 'absolute',
          top: 0,
          left: 0,
          width: '100%'
        })
      ]),
      query(':enter', [
        style({ left: '-100%' })
      ]),
      query(':leave', animateChild()),
      group([
        query(':leave', [
          animate('200ms ease-out', style({ left: '100%' }))
        ]),
        query(':enter', [
          animate('300ms ease-out', style({ left: '0%' }))
        ])
      ]),
      query(':enter', animateChild()),
    ])
    Docs
    0
  • trigger('routeAnimations', [
      transition('HomePage <=> AboutPage', [
        style({ position: 'relative' }),
        query(':enter, :leave', [
          style({
            position: 'absolute',
            top: 0,
            left: 0,
            width: '100%'
          })
        ]),
    Docs
    0
  • animations: [
        trigger('pageAnimations', [
          transition(':enter', [
            query('.hero, form', [
              style({opacity: 0, transform: 'translateY(-100px)'}),
              stagger(-30, [
                animate('500ms cubic-bezier(0.35, 0, 0.25, 1)', style({ opacity: 1, transform: 'none' }))
              ])
            ])
          ])
        ]),
      ]
    })
    export class HeroListPageComponent implements OnInit {
      @HostBinding('@pageAnimations')
      public animatePage = true;
    
      heroTotal = -1;
      get heroes() { return this._heroes; }
      private _heroes: Hero[] = [];
    
      ngOnInit() {
        this._heroes = HEROES;
      }
    
      updateCriteria(criteria: string) {
        criteria = criteria ? criteria.trim() : '';
    
        this._heroes = HEROES.filter(hero => hero.name.toLowerCase().includes(criteria.toLowerCase()));
        const newTotal = this.heroes.length;
    
        if (this.heroTotal !== newTotal) {
          this.heroTotal = newTotal;
        } else if (!criteria) {
          this.heroTotal = -1;
        }
      }
    }
    Docs
    0
  • trigger('filterAnimation', [
      transition(':enter, * => 0, * => -1', []),
      transition(':increment', [
        query(':enter', [
          style({ opacity: 0, width: '0px' }),
          stagger(50, [
            animate('300ms ease-out', style({ opacity: 1, width: '*' })),
          ]),
        ], { optional: true })
      ]),
      transition(':decrement', [
        query(':leave', [
          stagger(50, [
            animate('300ms ease-out', style({ opacity: 0, width: '0px' })),
          ]),
        ])
      ]),
    ]),
    Docs
    0
  • @Component({
      animations: [
        trigger("filterAnimation", [
          transition(":enter, * => 0, * => -1", []),
          transition(":increment", [
            query(
              ":enter",
              [
                style({ opacity: 0, width: "0px" }),
                stagger(50, [
                  animate(
                    "300ms ease-out",
                    style({ opacity: 1, width: "*" })
                  ),
                ]),
              ],
              { optional: true }
            ),
          ]),
          transition(":decrement", [
            query(":leave", [
              stagger(50, [
                animate(
                  "300ms ease-out",
                  style({ opacity: 0, width: "0px" })
                ),
              ]),
            ]),
          ]),
        ]),
      ],
    })
    export class HeroListPageComponent implements OnInit {
      heroTotal = -1;
    }
    
    Docs
    0
  • trigger("openClose", [
      state(
        "open",
        style({
          height: "200px",
          opacity: 1,
          backgroundColor: "yellow",
        })
      ),
      state(
        "close",
        style({
          height: "100px",
          opacity: 0.5,
          backgroundColor: "green",
        })
      ),
      // ...
      transition("* => *", [
        animate(
          "1s",
          keyframes([
            style({ opacity: 0.1, offset: 0.1 }),
            style({ opacity: 0.6, offset: 0.2 }),
            style({ opacity: 1, offset: 0.5 }),
            style({ opacity: 0.2, offset: 0.7 }),
          ])
        ),
      ]),
    ]);
    
    Docs
    0
  • animations: [
      trigger("flyInOut", [
        state("in", style({ transform: "translateX(0)" })),
        transition("void => *", [
          style({ transform: "translateX(-100%)" }),
          animate(100),
        ]),
        transition("* => void", [
          animate(
            100,
            style({ transform: "translateX(100%)" })
          ),
        ]),
      ]),
    ];
    
    Docs
    0
  • animations: [
      trigger("shrinkOut", [
        state("in", style({ height: "*" })),
        transition("* => void", [
          style({ height: "*" }),
          animate(250, style({ height: 0 })),
        ]),
      ]),
    ];
    
    Docs
    0
  • animations: [
      trigger("flyInOut", [
        state(
          "in",
          style({
            width: 120,
            transform: "translateX(0)",
            opacity: 1,
          })
        ),
        transition("void => *", [
          style({
            width: 10,
            transform: "translateX(50px)",
            opacity: 0,
          }),
          group([
            animate(
              "0.3s 0.1s ease",
              style({
                transform: "translateX(0)",
                width: 120,
              })
            ),
            animate(
              "0.3s ease",
              style({
                opacity: 1,
              })
            ),
          ]),
        ]),
        transition("* => void", [
          group([
            animate(
              "0.3s ease",
              style({
                transform: "translateX(50px)",
                width: 10,
              })
            ),
            animate(
              "0.3s 0.2s ease",
              style({
                opacity: 0,
              })
            ),
          ]),
        ]),
      ]),
    ];
    
    Docs
    0
  • animations: [
      trigger('openClose', [
        // ...
        state('open', style({
          height: '200px',
          opacity: 1,
          backgroundColor: 'yellow'
        })),
        state('closed', style({
          height: '100px',
          opacity: 0.8,
          backgroundColor: '#c6ecff'
        })),
        transition('* => closed', [
          animate('1s')
        ]),
        transition('* => open', [
          animate('0.5s')
        ]),
      ]),
    ],
    Docs
    0
  • import {
      Component,
      EventEmitter,
      HostBinding,
      Input,
      Output,
    } from "@angular/core";
    import {
      animate,
      state,
      style,
      transition,
      trigger,
    } from "@angular/animations";
    
    @Component({
      selector: "my-popup",
      template: `
        Popup: {{ message }}
        
      `,
      animations: [
        trigger("state", [
          state(
            "opened",
            style({ transform: "translateY(0%)" })
          ),
          state(
            "void, closed",
            style({ transform: "translateY(100%)", opacity: 0 })
          ),
          transition("* => *", animate("100ms ease-in")),
        ]),
      ],
      styles: [
        `
          :host {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: #009cff;
            height: 48px;
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid black;
            font-size: 24px;
          }
    
          button {
            border-radius: 50%;
          }
        `,
      ],
    })
    export class PopupComponent {
      @HostBinding("@state")
      state: "opened" | "closed" = "closed";
    
      @Input()
      get message(): string {
        return this._message;
      }
      set message(message: string) {
        this._message = message;
        this.state = "opened";
      }
      private _message = "";
    
      @Output()
      closed = new EventEmitter();
    }
    
    Docs
    0
  • animations: [
      trigger('openClose', [
        // ...
        state('open', style({
          height: '200px',
          opacity: 1,
          backgroundColor: 'yellow'
        })),
        state('closed', style({
          height: '100px',
          opacity: 0.8,
          backgroundColor: '#c6ecff'
        })),
        transition('open => closed', [
          animate('1s')
        ]),
        transition('closed => open', [
          animate('0.5s')
        ]),
        transition('* => closed', [
          animate('1s')
        ]),
        transition('* => open', [
          animate('0.5s')
        ]),
        transition('open <=> closed', [
          animate('0.5s')
        ]),
        transition ('* => open', [
          animate ('1s',
            style ({ opacity: '*' }),
          ),
        ]),
        transition('* => *', [
          animate('1s')
        ]),
    Docs
    0
  • animations: [
      trigger('openClose', [
        state('true', style({ height: '*' })),
        state('false', style({ height: '0px' })),
        transition('false <=> true', animate(500))
      ])
    ],
    Docs
    0
  • export const slideInAnimation = trigger("routeAnimations", [
      transition("HomePage <=> AboutPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("300ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
      transition("* <=> FilterPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("200ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
    ]);
    
    Docs
    0
  • trigger("openClose", [
      state(
        "open",
        style({
          height: "200px",
          opacity: 1,
          backgroundColor: "yellow",
        })
      ),
      state(
        "close",
        style({
          height: "100px",
          opacity: 0.5,
          backgroundColor: "green",
        })
      ),
      // ...
      transition("* => *", [
        animate(
          "1s",
          keyframes([
            style({ opacity: 0.1, offset: 0.1 }),
            style({ opacity: 0.6, offset: 0.2 }),
            style({ opacity: 1, offset: 0.5 }),
            style({ opacity: 0.2, offset: 0.7 }),
          ])
        ),
      ]),
    ]);
    
    Docs
    0
  • animations: [
      trigger("flyInOut", [
        state("in", style({ transform: "translateX(0)" })),
        transition("void => *", [
          style({ transform: "translateX(-100%)" }),
          animate(100),
        ]),
        transition("* => void", [
          animate(
            100,
            style({ transform: "translateX(100%)" })
          ),
        ]),
      ]),
    ];
    
    Docs
    0
  • animations: [
      trigger("shrinkOut", [
        state("in", style({ height: "*" })),
        transition("* => void", [
          style({ height: "*" }),
          animate(250, style({ height: 0 })),
        ]),
      ]),
    ];
    
    Docs
    0
  • @Component({
      selector: "app-open-close",
      animations: [
        trigger("openClose", [
          // ...
        ]),
      ],
      templateUrl: "open-close.component.html",
      styleUrls: ["open-close.component.css"],
    })
    export class OpenCloseComponent {
      onAnimationEvent(event: AnimationEvent) {}
    }
    
    Docs
    0
  • animations: [
      trigger("flyInOut", [
        state(
          "in",
          style({
            width: 120,
            transform: "translateX(0)",
            opacity: 1,
          })
        ),
        transition("void => *", [
          style({
            width: 10,
            transform: "translateX(50px)",
            opacity: 0,
          }),
          group([
            animate(
              "0.3s 0.1s ease",
              style({
                transform: "translateX(0)",
                width: 120,
              })
            ),
            animate(
              "0.3s ease",
              style({
                opacity: 1,
              })
            ),
          ]),
        ]),
        transition("* => void", [
          group([
            animate(
              "0.3s ease",
              style({
                transform: "translateX(50px)",
                width: 10,
              })
            ),
            animate(
              "0.3s 0.2s ease",
              style({
                opacity: 0,
              })
            ),
          ]),
        ]),
      ]),
    ];
    
    Docs
    0
  • animations: [
      trigger('openClose', [
        // ...
        state('open', style({
          height: '200px',
          opacity: 1,
          backgroundColor: 'yellow'
        })),
        state('closed', style({
          height: '100px',
          opacity: 0.8,
          backgroundColor: '#c6ecff'
        })),
        transition('* => closed', [
          animate('1s')
        ]),
        transition('* => open', [
          animate('0.5s')
        ]),
      ]),
    ],
    Docs
    0
  • import {
      Component,
      EventEmitter,
      HostBinding,
      Input,
      Output,
    } from "@angular/core";
    import {
      animate,
      state,
      style,
      transition,
      trigger,
    } from "@angular/animations";
    
    @Component({
      selector: "my-popup",
      template: `
        Popup: {{ message }}
        
      `,
      animations: [
        trigger("state", [
          state(
            "opened",
            style({ transform: "translateY(0%)" })
          ),
          state(
            "void, closed",
            style({ transform: "translateY(100%)", opacity: 0 })
          ),
          transition("* => *", animate("100ms ease-in")),
        ]),
      ],
      styles: [
        `
          :host {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: #009cff;
            height: 48px;
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid black;
            font-size: 24px;
          }
    
          button {
            border-radius: 50%;
          }
        `,
      ],
    })
    export class PopupComponent {
      @HostBinding("@state")
      state: "opened" | "closed" = "closed";
    
      @Input()
      get message(): string {
        return this._message;
      }
      set message(message: string) {
        this._message = message;
        this.state = "opened";
      }
      private _message = "";
    
      @Output()
      closed = new EventEmitter();
    }
    
    Docs
    0
  • animations: [
        trigger('pageAnimations', [
          transition(':enter', [
            query('.hero, form', [
              style({opacity: 0, transform: 'translateY(-100px)'}),
              stagger(-30, [
                animate('500ms cubic-bezier(0.35, 0, 0.25, 1)', style({ opacity: 1, transform: 'none' }))
              ])
            ])
          ])
        ]),
      ]
    })
    export class HeroListPageComponent implements OnInit {
      @HostBinding('@pageAnimations')
      public animatePage = true;
    
      heroTotal = -1;
      get heroes() { return this._heroes; }
      private _heroes: Hero[] = [];
    
      ngOnInit() {
        this._heroes = HEROES;
      }
    
      updateCriteria(criteria: string) {
        criteria = criteria ? criteria.trim() : '';
    
        this._heroes = HEROES.filter(hero => hero.name.toLowerCase().includes(criteria.toLowerCase()));
        const newTotal = this.heroes.length;
    
        if (this.heroTotal !== newTotal) {
          this.heroTotal = newTotal;
        } else if (!criteria) {
          this.heroTotal = -1;
        }
      }
    }
    Docs
    0
  • trigger('filterAnimation', [
      transition(':enter, * => 0, * => -1', []),
      transition(':increment', [
        query(':enter', [
          style({ opacity: 0, width: '0px' }),
          stagger(50, [
            animate('300ms ease-out', style({ opacity: 1, width: '*' })),
          ]),
        ], { optional: true })
      ]),
      transition(':decrement', [
        query(':leave', [
          stagger(50, [
            animate('300ms ease-out', style({ opacity: 0, width: '0px' })),
          ]),
        ])
      ]),
    ]),
    Docs
    0
  • @Component({
      animations: [
        trigger("filterAnimation", [
          transition(":enter, * => 0, * => -1", []),
          transition(":increment", [
            query(
              ":enter",
              [
                style({ opacity: 0, width: "0px" }),
                stagger(50, [
                  animate(
                    "300ms ease-out",
                    style({ opacity: 1, width: "*" })
                  ),
                ]),
              ],
              { optional: true }
            ),
          ]),
          transition(":decrement", [
            query(":leave", [
              stagger(50, [
                animate(
                  "300ms ease-out",
                  style({ opacity: 0, width: "0px" })
                ),
              ]),
            ]),
          ]),
        ]),
      ],
    })
    export class HeroListPageComponent implements OnInit {
      heroTotal = -1;
    }
    
    Docs
    0
  • trigger('myInsertRemoveTrigger', [
      transition(':enter', [
        style({ opacity: 0 }),
        animate('100ms', style({ opacity: 1 })),
      ]),
      transition(':leave', [
        animate('100ms', style({ opacity: 0 }))
      ])
    ]),
    Docs
    0
  • animations: [
      trigger('openClose', [
        state('true', style({ height: '*' })),
        state('false', style({ height: '0px' })),
        transition('false <=> true', animate(500))
      ])
    ],
    Docs
    0
  • export const slideInAnimation = trigger("routeAnimations", [
      transition("HomePage <=> AboutPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("300ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
      transition("* <=> FilterPage", [
        style({ position: "relative" }),
        query(":enter, :leave", [
          style({
            position: "absolute",
            top: 0,
            left: 0,
            width: "100%",
          }),
        ]),
        query(":enter", [style({ left: "-100%" })]),
        query(":leave", animateChild()),
        group([
          query(":leave", [
            animate("200ms ease-out", style({ left: "100%" })),
          ]),
          query(":enter", [
            animate("300ms ease-out", style({ left: "0%" })),
          ]),
        ]),
        query(":enter", animateChild()),
      ]),
    ]);
    
    Docs
    0
  • trigger("openClose", [
      state(
        "open",
        style({
          height: "200px",
          opacity: 1,
          backgroundColor: "yellow",
        })
      ),
      state(
        "close",
        style({
          height: "100px",
          opacity: 0.5,
          backgroundColor: "green",
        })
      ),
      // ...
      transition("* => *", [
        animate(
          "1s",
          keyframes([
            style({ opacity: 0.1, offset: 0.1 }),
            style({ opacity: 0.6, offset: 0.2 }),
            style({ opacity: 1, offset: 0.5 }),
            style({ opacity: 0.2, offset: 0.7 }),
          ])
        ),
      ]),
    ]);
    
    Docs
    0
  • transition ('* => open', [
      animate ('1s',
        style ({ opacity: '*' }),
      ),
    ]),
    Docs
    0
  • animations: [
      trigger("flyInOut", [
        state("in", style({ transform: "translateX(0)" })),
        transition("void => *", [
          style({ transform: "translateX(-100%)" }),
          animate(100),
        ]),
        transition("* => void", [
          animate(
            100,
            style({ transform: "translateX(100%)" })
          ),
        ]),
      ]),
    ];
    
    Docs
    0
  • animations: [
      trigger("shrinkOut", [
        state("in", style({ height: "*" })),
        transition("* => void", [
          style({ height: "*" }),
          animate(250, style({ height: 0 })),
        ]),
      ]),
    ];
    
    Docs
    0
  • transition('* => active', [
      animate('2s', keyframes([
        style({ backgroundColor: 'blue' }),
        style({ backgroundColor: 'red' }),
        style({ backgroundColor: 'orange' })
      ]))
    Docs
    0
  • query(':enter', [
        style({ left: '-100%' })
      ]),
      query(':leave', animateChild()),
      group([
        query(':leave', [
          animate('300ms ease-out', style({ left: '100%' }))
        ]),
        query(':enter', [
          animate('300ms ease-out', style({ left: '0%' }))
        ])
      ]),
      query(':enter', animateChild()),
    ]),
    transition('* <=> FilterPage', [
      style({ position: 'relative' }),
      query(':enter, :leave', [
        style({
          position: 'absolute',
          top: 0,
          left: 0,
          width: '100%'
        })
      ]),
      query(':enter', [
        style({ left: '-100%' })
      ]),
      query(':leave', animateChild()),
      group([
        query(':leave', [
          animate('200ms ease-out', style({ left: '100%' }))
        ]),
        query(':enter', [
          animate('300ms ease-out', style({ left: '0%' }))
        ])
      ]),
      query(':enter', animateChild()),
    ])
    Docs
    0
  • trigger('routeAnimations', [
      transition('HomePage <=> AboutPage', [
        style({ position: 'relative' }),
        query(':enter, :leave', [
          style({
            position: 'absolute',
            top: 0,
            left: 0,
            width: '100%'
          })
        ]),
    Docs
    0
  • animations: [
      trigger("flyInOut", [
        state(
          "in",
          style({
            width: 120,
            transform: "translateX(0)",
            opacity: 1,
          })
        ),
        transition("void => *", [
          style({
            width: 10,
            transform: "translateX(50px)",
            opacity: 0,
          }),
          group([
            animate(
              "0.3s 0.1s ease",
              style({
                transform: "translateX(0)",
                width: 120,
              })
            ),
            animate(
              "0.3s ease",
              style({
                opacity: 1,
              })
            ),
          ]),
        ]),
        transition("* => void", [
          group([
            animate(
              "0.3s ease",
              style({
                transform: "translateX(50px)",
                width: 10,
              })
            ),
            animate(
              "0.3s 0.2s ease",
              style({
                opacity: 0,
              })
            ),
          ]),
        ]),
      ]),
    ];
    
    Docs
    0
  • animations: [
      trigger('openClose', [
        // ...
        state('open', style({
          height: '200px',
          opacity: 1,
          backgroundColor: 'yellow'
        })),
        state('closed', style({
          height: '100px',
          opacity: 0.8,
          backgroundColor: '#c6ecff'
        })),
        transition('* => closed', [
          animate('1s')
        ]),
        transition('* => open', [
          animate('0.5s')
        ]),
      ]),
    ],
    Docs
    0
  • import {
      Component,
      EventEmitter,
      HostBinding,
      Input,
      Output,
    } from "@angular/core";
    import {
      animate,
      state,
      style,
      transition,
      trigger,
    } from "@angular/animations";
    
    @Component({
      selector: "my-popup",
      template: `
        Popup: {{ message }}
        
      `,
      animations: [
        trigger("state", [
          state(
            "opened",
            style({ transform: "translateY(0%)" })
          ),
          state(
            "void, closed",
            style({ transform: "translateY(100%)", opacity: 0 })
          ),
          transition("* => *", animate("100ms ease-in")),
        ]),
      ],
      styles: [
        `
          :host {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: #009cff;
            height: 48px;
            padding: 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid black;
            font-size: 24px;
          }
    
          button {
            border-radius: 50%;
          }
        `,
      ],
    })
    export class PopupComponent {
      @HostBinding("@state")
      state: "opened" | "closed" = "closed";
    
      @Input()
      get message(): string {
        return this._message;
      }
      set message(message: string) {
        this._message = message;
        this.state = "opened";
      }
      private _message = "";
    
      @Output()
      closed = new EventEmitter();
    }
    
    Docs
    0
  • animations: [
        trigger('pageAnimations', [
          transition(':enter', [
            query('.hero, form', [
              style({opacity: 0, transform: 'translateY(-100px)'}),
              stagger(-30, [
                animate('500ms cubic-bezier(0.35, 0, 0.25, 1)', style({ opacity: 1, transform: 'none' }))
              ])
            ])
          ])
        ]),
      ]
    })
    export class HeroListPageComponent implements OnInit {
      @HostBinding('@pageAnimations')
      public animatePage = true;
    
      heroTotal = -1;
      get heroes() { return this._heroes; }
      private _heroes: Hero[] = [];
    
      ngOnInit() {
        this._heroes = HEROES;
      }
    
      updateCriteria(criteria: string) {
        criteria = criteria ? criteria.trim() : '';
    
        this._heroes = HEROES.filter(hero => hero.name.toLowerCase().includes(criteria.toLowerCase()));
        const newTotal = this.heroes.length;
    
        if (this.heroTotal !== newTotal) {
          this.heroTotal = newTotal;
        } else if (!criteria) {
          this.heroTotal = -1;
        }
      }
    }
    Docs
    0
  • trigger('filterAnimation', [
      transition(':enter, * => 0, * => -1', []),
      transition(':increment', [
        query(':enter', [
          style({ opacity: 0, width: '0px' }),
          stagger(50, [
            animate('300ms ease-out', style({ opacity: 1, width: '*' })),
          ]),
        ], { optional: true })
      ]),
      transition(':decrement', [
        query(':leave', [
          stagger(50, [
            animate('300ms ease-out', style({ opacity: 0, width: '0px' })),
          ]),
        ])
      ]),
    ]),
    Docs
    0
  • @Component({
      animations: [
        trigger("filterAnimation", [
          transition(":enter, * => 0, * => -1", []),
          transition(":increment", [
            query(
              ":enter",
              [
                style({ opacity: 0, width: "0px" }),
                stagger(50, [
                  animate(
                    "300ms ease-out",
                    style({ opacity: 1, width: "*" })
                  ),
                ]),
              ],
              { optional: true }
            ),
          ]),
          transition(":decrement", [
            query(":leave", [
              stagger(50, [
                animate(
                  "300ms ease-out",
                  style({ opacity: 0, width: "0px" })
                ),
              ]),
            ]),
          ]),
        ]),
      ],
    })
    export class HeroListPageComponent implements OnInit {
      heroTotal = -1;
    }
    
    Docs
    0
  • animations: [
      trigger('openClose', [
        // ...
        state('open', style({
          height: '200px',
          opacity: 1,
          backgroundColor: 'yellow'
        })),
        state('closed', style({
          height: '100px',
          opacity: 0.8,
          backgroundColor: '#c6ecff'
        })),
        transition('open => closed', [
          animate('1s')
        ]),
        transition('closed => open', [
          animate('0.5s')
        ]),
        transition('* => closed', [
          animate('1s')
        ]),
        transition('* => open', [
          animate('0.5s')
        ]),
        transition('open <=> closed', [
          animate('0.5s')
        ]),
        transition ('* => open', [
          animate ('1s',
            style ({ opacity: '*' }),
          ),
        ]),
        transition('* => *', [
          animate('1s')
        ]),
    Docs
    0
  • trigger('myInsertRemoveTrigger', [
      transition(':enter', [
        style({ opacity: 0 }),
        animate('100ms', style({ opacity: 1 })),
      ]),
      transition(':leave', [
        animate('100ms', style({ opacity: 0 }))
      ])
    ]),
    Docs
    0
  • animations: [
      trigger('openClose', [
        state('true', style({ height: '*' })),
        state('false', style({ height: '0px' })),
        transition('false <=> true', animate(500))
      ])
    ],
    Docs
    0
  • transition('* => active', [
      animate('2s', keyframes([
        style({ backgroundColor: 'blue', offset: 0}),
        style({ backgroundColor: 'red', offset: 0.8}),
        style({ backgroundColor: '#754600', offset: 1.0})
      ])),
    ]),
    transition('* => inactive', [
      animate('2s', keyframes([
        style({ backgroundColor: '#754600', offset: 0}),
        style({ backgroundColor: 'red', offset: 0.2}),
        style({ backgroundColor: 'blue', offset: 1.0})
      ]))
    ]),
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples