From 2e5530179b9632a61e9d195a58b11664c3272785 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 23 Mar 2018 22:12:34 -0600 Subject: [PATCH] Add some animation to the iboxes --- web/app/app.animations.ts | 13 +++++++++++++ web/app/elements/ibox/ibox.component.html | 2 +- web/app/elements/ibox/ibox.component.ts | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 web/app/app.animations.ts diff --git a/web/app/app.animations.ts b/web/app/app.animations.ts new file mode 100644 index 0000000..26ff967 --- /dev/null +++ b/web/app/app.animations.ts @@ -0,0 +1,13 @@ +import { animate, style, transition, trigger } from "@angular/animations"; + +export const ANIMATION_FADE_IN_NOT_OUT = + trigger('fadeInNotOutAnimation', [ + transition(':enter', [ + style({opacity: 0}), + animate('200ms', style({opacity: 1})), + ]), + // transition(':leave', [ + // style({opacity: 1}), + // animate('100ms', style({opacity: 0})), + // ]), + ]); \ No newline at end of file diff --git a/web/app/elements/ibox/ibox.component.html b/web/app/elements/ibox/ibox.component.html index 93d6b83..1fe77fd 100644 --- a/web/app/elements/ibox/ibox.component.html +++ b/web/app/elements/ibox/ibox.component.html @@ -9,7 +9,7 @@ -
+
\ No newline at end of file diff --git a/web/app/elements/ibox/ibox.component.ts b/web/app/elements/ibox/ibox.component.ts index ce310bd..e37fb5c 100644 --- a/web/app/elements/ibox/ibox.component.ts +++ b/web/app/elements/ibox/ibox.component.ts @@ -1,9 +1,11 @@ import { Component, Input, OnInit } from "@angular/core"; +import { ANIMATION_FADE_IN_NOT_OUT } from "../../app.animations"; @Component({ selector: "my-ibox", templateUrl: "./ibox.component.html", styleUrls: ["./ibox.component.scss"], + animations: [ANIMATION_FADE_IN_NOT_OUT], }) export class IboxComponent implements OnInit { @Input() title: string;