Skip to content

Commit 36e1969

Browse files
added animations for tiles
1 parent 62c1bf2 commit 36e1969

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/app/board/shared/task-card/task-card.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<md-card class="card" *ngIf="task.list == tileName" dnd-draggable [dragEnabled]="true" [dragData]="task">
1+
<md-card [@flyInOut]="'in'" class="card" *ngIf="task.list == tileName" dnd-draggable [dragEnabled]="true" [dragData]="task">
22
<md-card-header>
33
<md-card-title style="font-size:12px">Priority: {{task.priority}}</md-card-title>
44
<md-card-subtitle style="font-size:12px">Due date: {{ task.dueDate }}</md-card-subtitle>

src/app/board/shared/task-card/task-card.component.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
import { Component, OnInit, Input } from '@angular/core';
1+
import { Component, OnInit, Input, trigger, state, animate, keyframes, style, transition } from '@angular/core';
22

33
@Component({
44
selector: 'app-board-task-card',
55
templateUrl: './task-card.component.html',
6-
styleUrls: ['./task-card.component.css']
6+
styleUrls: ['./task-card.component.css'],
7+
animations: [
8+
trigger('flyInOut', [
9+
state('in', style({transform: 'translateY(0)'})),
10+
transition('void => *', [
11+
animate(700, keyframes([
12+
style({opacity: 0, transform: 'translateX(-100%)', offset: 0}),
13+
style({opacity: 1, transform: 'translateX(15px)', offset: 0.3}),
14+
style({opacity: 1, transform: 'translateX(0)', offset: 1.0})
15+
]))
16+
])
17+
])
18+
]
719
})
820
export class TaskCardComponent implements OnInit {
921
@Input() task;

0 commit comments

Comments
 (0)