SlideShare a Scribd company logo
1 of 31
Download to read offline
Demystifying Angular Animations
Gil Fink
CEO and Senior Consultant, sparXys
Why to bother with animations?
Better user experience (UX)
Indicating that something
happening/happened
Just because we want a cool and
shiny website!
But…
Web animation is HARD!
About Me
• sparXys CEO and senior consultant
• Microsoft MVP in the last 8 years
• Pro Single Page Application Development (Apress) co-author
• 4 Microsoft Official Courses (MOCs) co-author
• GDG Rishon and AngularUP co-organizer
Agenda
• Web animation
• Building our own Angular animation implementation
• Angular animation in a nutshell
Web Animation Options
• Use JavaScript animation library
• Use CSS3 modules
• CSS3 Animations
• CSS3 2D and 3D Transform
• CSS3 Transitions
Welcome Web Animation API
Web Animation API
• Enables you to hook into the browser’s animation engine
• Implemented on top of CSS3 animation and transitions
• Enables the ability to change animations during runtime
Web Animation API in a Nutshell
• Use the new animate function
• Pass Keyframes array and AnimationEffectTimingProperties object
document.getElementById("myPic").animate(
[
{transform: 'translate3D(0%, 0%, 0)', backgroundColor: '#000'},
{transform: 'translate3D(10%, 10%, 0)', backgroundColor: '#ff0000'},
{ transform: 'translate3D(0%, 0%, 0)', backgroundColor: '#000' }
], {
duration: 3000,
iterations: Infinity
}
);
Web Animation API
Demo
Web Animation API Support
Taken from “Can I Use…” website
• Use polyfill –
https://github.com/web-animations/web-animations-js
How can we use Web Animation
API with Angular?
Building our own Angular
animation decorator
Demo
@angular/animations
• Based on Web Animation API
• Animations are separated from Angular core
• Totally refactored
• Fully dynamic
Angular Animation Module Setup
• Import the BrowserAnimationsModule to your ngModule
import {BrowserAnimationsModule} from "@angular/platform-
browser/animations";
@NgModule({imports: [BrowserAnimationsModule]})
How to Use Animation?
• Create animation trigger in the component template
• Describe the trigger in the component decorator
<div [@fade]="active ? 'in' : 'out'">hello there</div>
import {trigger, ...} from '@angular/animatons';
@Component({
animations: [trigger('fade', [ /*...*/ ])]
})
How to Use Animation? – Cont.
• In the trigger you set
• Transitions
• States
trigger('fadeIn', [
transition('out => in', [ style({ opacity: 0 }),
animate(1000, style({ opacity: 1 })) ])
])
Basic Angular Animation
Demystified
Demo
States and Transitions
• Named states define styling of an element in state
• Transitions defines what happens when we move from one state to
another (use =>)
state('state name', style({…}))
transition('* => in', [ style({…}), animate(1000, style({…})) ])
Working with keyframes
• keyframes enables the creation of intricate animation
• Defined using the keyframes function and keyframe array
transition('void => *', [
animate(300, keyframes([
style({…, offset: 0}),
style({…, offset: 0.4}),
style({…, offset: 1.0})
]))
])
Animation Groups
• Run animations in parallel using grouping
• Use the group function
transition('void => *', [
style({…}),
group([
animate('0.3s 0.1s ease', style({…})),
animate('0.3s ease', style({…}))
])
])
Animation Callbacks
• You can wire to animation start and end callbacks
• Use the trigger start and done handlers
<li *ngFor="…"
(@fade.start)="animationStarted($event)"
(@fade.done)="animationDone($event)"
[@fade]="'in'">
…
</li>
Adding Angular Animation to an
App
Demo
Summary
• Embrace the new Web Animation API
• Decorate components with animation in Angular apps
• Make your users happy!
Resources
• Animations in Angular website - http://bit.ly/2ppuxsM
• ng-conf Animation video - http://bit.ly/2pSbhqe
• My Website – http://www.gilfink.net
• Follow me on Twitter – @gilfink
Thank You!

More Related Content

What's hot

Angular directives and pipes
Angular directives and pipesAngular directives and pipes
Angular directives and pipesKnoldus Inc.
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes WorkshopNir Kaufman
 
Angular data binding
Angular data binding Angular data binding
Angular data binding Sultan Ahmed
 
Unit Testing in Angular
Unit Testing in AngularUnit Testing in Angular
Unit Testing in AngularKnoldus Inc.
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectJadson Santos
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariSurekha Gadkari
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data BindingDuy Khanh
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesWebStackAcademy
 
Angular components
Angular componentsAngular components
Angular componentsSultan Ahmed
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationWebStackAcademy
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced RoutingLaurent Duveau
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular ComponentsSquash Apps Pvt Ltd
 

What's hot (20)

Angular directives and pipes
Angular directives and pipesAngular directives and pipes
Angular directives and pipes
 
Angular Pipes Workshop
Angular Pipes WorkshopAngular Pipes Workshop
Angular Pipes Workshop
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
Angular data binding
Angular data binding Angular data binding
Angular data binding
 
Unit Testing in Angular
Unit Testing in AngularUnit Testing in Angular
Unit Testing in Angular
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Angular
AngularAngular
Angular
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Android volley
Android volleyAndroid volley
Android volley
 
Angular components
Angular componentsAngular components
Angular components
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and Authorization
 
NestJS
NestJSNestJS
NestJS
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing
 
Angular overview
Angular overviewAngular overview
Angular overview
 
Angular Observables & RxJS Introduction
Angular Observables & RxJS IntroductionAngular Observables & RxJS Introduction
Angular Observables & RxJS Introduction
 
Sharing Data Between Angular Components
Sharing Data Between Angular ComponentsSharing Data Between Angular Components
Sharing Data Between Angular Components
 
Angular Lifecycle Hooks
Angular Lifecycle HooksAngular Lifecycle Hooks
Angular Lifecycle Hooks
 

Similar to Demystifying Angular Animations

SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...Sébastien Levert
 
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...Sébastien Levert
 
Motion design in FIori
Motion design in FIoriMotion design in FIori
Motion design in FIoriRoman Rommel
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSébastien Levert
 
Building a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesBuilding a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesDavid Giard
 
Ilya Ivanov - Advanced React-Native
Ilya Ivanov - Advanced React-NativeIlya Ivanov - Advanced React-Native
Ilya Ivanov - Advanced React-NativeOdessaJS Conf
 
Switch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGSwitch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGExove
 
Сергій Міськів, «SwiftUI: Animations»
Сергій Міськів, «SwiftUI: Animations»Сергій Міськів, «SwiftUI: Animations»
Сергій Міськів, «SwiftUI: Animations»Sigma Software
 
SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSébastien Levert
 
Assignment D
Assignment DAssignment D
Assignment DSongyo
 
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure FunctionsEuropean Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure FunctionsSébastien Levert
 
Introduction to A-Frame
Introduction to A-FrameIntroduction to A-Frame
Introduction to A-FrameDaosheng Mu
 
Make your animations perform well
Make your animations perform wellMake your animations perform well
Make your animations perform wellAnna Migas
 
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil TayarVisual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil TayarApplitools
 
Tailwind Animation: How to Make Eye-Catching Websites
Tailwind Animation: How to Make Eye-Catching WebsitesTailwind Animation: How to Make Eye-Catching Websites
Tailwind Animation: How to Make Eye-Catching WebsitesRonDosh
 
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Joseph Labrecque
 
Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)Kasper Reijnders
 

Similar to Demystifying Angular Animations (20)

Animation in iOS
Animation in iOSAnimation in iOS
Animation in iOS
 
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
 
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
 
Motion design in FIori
Motion design in FIoriMotion design in FIori
Motion design in FIori
 
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
 
Building a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesBuilding a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web Services
 
Ilya Ivanov - Advanced React-Native
Ilya Ivanov - Advanced React-NativeIlya Ivanov - Advanced React-Native
Ilya Ivanov - Advanced React-Native
 
Switch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGSwitch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVG
 
Сергій Міськів, «SwiftUI: Animations»
Сергій Міськів, «SwiftUI: Animations»Сергій Міськів, «SwiftUI: Animations»
Сергій Міськів, «SwiftUI: Animations»
 
SharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure FunctionsSharePoint Framework, Angular and Azure Functions
SharePoint Framework, Angular and Azure Functions
 
Assignment D
Assignment DAssignment D
Assignment D
 
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure FunctionsEuropean Collaboration Summit - SharePoint Framework Angular & Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
 
Introduction to A-Frame
Introduction to A-FrameIntroduction to A-Frame
Introduction to A-Frame
 
Make your animations perform well
Make your animations perform wellMake your animations perform well
Make your animations perform well
 
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil TayarVisual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
Visual Testing: The Missing Piece of the Puzzle -- presentation by Gil Tayar
 
mean stack
mean stackmean stack
mean stack
 
Tailwind Animation: How to Make Eye-Catching Websites
Tailwind Animation: How to Make Eye-Catching WebsitesTailwind Animation: How to Make Eye-Catching Websites
Tailwind Animation: How to Make Eye-Catching Websites
 
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
 
Angular IO
Angular IOAngular IO
Angular IO
 
Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)
 

More from Gil Fink

Becoming a Tech Speaker
Becoming a Tech SpeakerBecoming a Tech Speaker
Becoming a Tech SpeakerGil Fink
 
Web animation on steroids web animation api
Web animation on steroids web animation api Web animation on steroids web animation api
Web animation on steroids web animation api Gil Fink
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedGil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedGil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedGil Fink
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedGil Fink
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedGil Fink
 
Being a tech speaker
Being a tech speakerBeing a tech speaker
Being a tech speakerGil Fink
 
Working with Data in Service Workers
Working with Data in Service WorkersWorking with Data in Service Workers
Working with Data in Service WorkersGil Fink
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angularGil Fink
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angularGil Fink
 
Who's afraid of front end databases?
Who's afraid of front end databases?Who's afraid of front end databases?
Who's afraid of front end databases?Gil Fink
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type scriptGil Fink
 
End to-end apps with type script
End to-end apps with type scriptEnd to-end apps with type script
End to-end apps with type scriptGil Fink
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven developmentGil Fink
 
Web components
Web componentsWeb components
Web componentsGil Fink
 
Redux data flow with angular 2
Redux data flow with angular 2Redux data flow with angular 2
Redux data flow with angular 2Gil Fink
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSGil Fink
 
Who's afraid of front end databases
Who's afraid of front end databasesWho's afraid of front end databases
Who's afraid of front end databasesGil Fink
 
Biological modeling, powered by angular js
Biological modeling, powered by angular jsBiological modeling, powered by angular js
Biological modeling, powered by angular jsGil Fink
 

More from Gil Fink (20)

Becoming a Tech Speaker
Becoming a Tech SpeakerBecoming a Tech Speaker
Becoming a Tech Speaker
 
Web animation on steroids web animation api
Web animation on steroids web animation api Web animation on steroids web animation api
Web animation on steroids web animation api
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has Arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has Arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Being a tech speaker
Being a tech speakerBeing a tech speaker
Being a tech speaker
 
Working with Data in Service Workers
Working with Data in Service WorkersWorking with Data in Service Workers
Working with Data in Service Workers
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
 
Who's afraid of front end databases?
Who's afraid of front end databases?Who's afraid of front end databases?
Who's afraid of front end databases?
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
 
End to-end apps with type script
End to-end apps with type scriptEnd to-end apps with type script
End to-end apps with type script
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Web components
Web componentsWeb components
Web components
 
Redux data flow with angular 2
Redux data flow with angular 2Redux data flow with angular 2
Redux data flow with angular 2
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJS
 
Who's afraid of front end databases
Who's afraid of front end databasesWho's afraid of front end databases
Who's afraid of front end databases
 
Biological modeling, powered by angular js
Biological modeling, powered by angular jsBiological modeling, powered by angular js
Biological modeling, powered by angular js
 

Recently uploaded

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 

Recently uploaded (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 

Demystifying Angular Animations

  • 1. Demystifying Angular Animations Gil Fink CEO and Senior Consultant, sparXys
  • 2. Why to bother with animations?
  • 5. Just because we want a cool and shiny website!
  • 7. About Me • sparXys CEO and senior consultant • Microsoft MVP in the last 8 years • Pro Single Page Application Development (Apress) co-author • 4 Microsoft Official Courses (MOCs) co-author • GDG Rishon and AngularUP co-organizer
  • 8. Agenda • Web animation • Building our own Angular animation implementation • Angular animation in a nutshell
  • 9. Web Animation Options • Use JavaScript animation library • Use CSS3 modules • CSS3 Animations • CSS3 2D and 3D Transform • CSS3 Transitions
  • 11. Web Animation API • Enables you to hook into the browser’s animation engine • Implemented on top of CSS3 animation and transitions • Enables the ability to change animations during runtime
  • 12. Web Animation API in a Nutshell • Use the new animate function • Pass Keyframes array and AnimationEffectTimingProperties object document.getElementById("myPic").animate( [ {transform: 'translate3D(0%, 0%, 0)', backgroundColor: '#000'}, {transform: 'translate3D(10%, 10%, 0)', backgroundColor: '#ff0000'}, { transform: 'translate3D(0%, 0%, 0)', backgroundColor: '#000' } ], { duration: 3000, iterations: Infinity } );
  • 14. Web Animation API Support Taken from “Can I Use…” website • Use polyfill – https://github.com/web-animations/web-animations-js
  • 15. How can we use Web Animation API with Angular?
  • 16. Building our own Angular animation decorator Demo
  • 17.
  • 18.
  • 19. @angular/animations • Based on Web Animation API • Animations are separated from Angular core • Totally refactored • Fully dynamic
  • 20. Angular Animation Module Setup • Import the BrowserAnimationsModule to your ngModule import {BrowserAnimationsModule} from "@angular/platform- browser/animations"; @NgModule({imports: [BrowserAnimationsModule]})
  • 21. How to Use Animation? • Create animation trigger in the component template • Describe the trigger in the component decorator <div [@fade]="active ? 'in' : 'out'">hello there</div> import {trigger, ...} from '@angular/animatons'; @Component({ animations: [trigger('fade', [ /*...*/ ])] })
  • 22. How to Use Animation? – Cont. • In the trigger you set • Transitions • States trigger('fadeIn', [ transition('out => in', [ style({ opacity: 0 }), animate(1000, style({ opacity: 1 })) ]) ])
  • 24. States and Transitions • Named states define styling of an element in state • Transitions defines what happens when we move from one state to another (use =>) state('state name', style({…})) transition('* => in', [ style({…}), animate(1000, style({…})) ])
  • 25. Working with keyframes • keyframes enables the creation of intricate animation • Defined using the keyframes function and keyframe array transition('void => *', [ animate(300, keyframes([ style({…, offset: 0}), style({…, offset: 0.4}), style({…, offset: 1.0}) ])) ])
  • 26. Animation Groups • Run animations in parallel using grouping • Use the group function transition('void => *', [ style({…}), group([ animate('0.3s 0.1s ease', style({…})), animate('0.3s ease', style({…})) ]) ])
  • 27. Animation Callbacks • You can wire to animation start and end callbacks • Use the trigger start and done handlers <li *ngFor="…" (@fade.start)="animationStarted($event)" (@fade.done)="animationDone($event)" [@fade]="'in'"> … </li>
  • 28. Adding Angular Animation to an App Demo
  • 29. Summary • Embrace the new Web Animation API • Decorate components with animation in Angular apps • Make your users happy!
  • 30. Resources • Animations in Angular website - http://bit.ly/2ppuxsM • ng-conf Animation video - http://bit.ly/2pSbhqe • My Website – http://www.gilfink.net • Follow me on Twitter – @gilfink