SlideShare a Scribd company logo
1 of 16
CSS Animations &
Transitions
Refresh Hilo 2/10/15
What’s going to be covered
● What are Transitions & Animations
● Pros and Cons
● Performance
Transitions
div {
color:black;
transition: color 1s linear 500ms;
transition-property: color;
transition-duration: 1s;
transition-timing-function: linear;
transition-delay: 500ms; }
div:hover {color:red;}
Transitions
● Transition property - what will change
● Transition duration - animation time
● Transition timing function - animation speed curve
● Transition delay - time before animation
Must have a property and duration set for transition
animations to work!
Transitions
Changes transition property from one state to another.
● Set animation in current state, modify state with pseudo
classes (:hover,:focus) or classes (.active)
● Multiple properties can be animated
● Animation properties can be changed (Javascript &
:pseudo)
● JS listeners on transition end: ‘transitionend’
● Properties List
● Demo
Questions?
Animations
div { animation: GoAnimate 2s;}
@keyframes GoAnimate {
from { color: black;}
to { color: red;}
}
Animations
div {
animation-name: GoAnimate;
animation-duration: 1s;
animation-timing-function: linear;
animation-delay: 500ms;
animation-iteration-count: infinite;
animation-direction: normal;
animation-play-state: running;
animation-fill-mode: forward;
}
@keyframes GoAnimate {
0% { color: black;}
25% {color:pink;}
50% {color:orange;}
75% {color:blue;}
100% { color: red;}
}
Animations
● Animation name - name of defined animation
● Animation duration, timing function, delay same as
transition
● Animation iteration count - how many times it will loop
● Animation direction - direction and alternate cycles
● Animation play state - running or paused (can toggle)
● Animation fill mode - sets end state after animation
Must have a name and duration set for animations to
work!
Animations
● Once an animation is applied it can’t be changed, only
paused (animation-play-state) - can be changed with
JS, but resets the animation
● JS listeners on start, iteration, end of animation (not
paused) - event object is useful, ‘elapsedTime’
o ‘animationstart’, ‘animationiteration’, ‘animationend’
● Don’t forget animation-fill-mode
● Properties List
● Demo Swing, Demo Play State
Questions?
Pros & Cons
Transitions Pros
● Good for :pseudo-classes
(:hover,:active)
● Does not require JS
● Reversible - easy state change
● Easy to use
Transitions Cons
● Simple only
● Browser prefixes (-webkit)
● Sometimes requires JS
assistance - change the height of
something
Animations Pros
● Complex Animations with
multiple keyframes (0%, 1%,
5%)
● JS listeners
● Defined Animations - modular
Animations Cons
● Can’t change without JS - no
easy reverse
● Browser prefixes
● Complex interactions require JS
Performance
How do you measure performance?
Chrome dev tools > timeline
Record Animation and review results.
Goal > 30fps - target is around 60fps
Performance
CPU vs GPU Animation: Most animation use the CPU,
animations that use transforms (sometimes) use the GPU.
● Use transform:translate() vs TRBL
o TRBL uses whole pixels - requires more paint time
o transform:translate uses subpixels and tweens
animation smoother - no stair stepping
● Low cost animations = position(transform), rotation,
scale, opacity
Performance
TRBL transform:translate
Scripting = JS events, functions, etc
Rendering = layout
Painting = pixels on screen
Idle = sipping Mai-Tai’s
Questions?
Edward Meehan - Refresh Hilo 2015

More Related Content

What's hot (20)

Css
CssCss
Css
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Css position
Css positionCss position
Css position
 
HTML5 Canvas
HTML5 CanvasHTML5 Canvas
HTML5 Canvas
 
CSS Dasar #1 : Intro
CSS Dasar #1 : IntroCSS Dasar #1 : Intro
CSS Dasar #1 : Intro
 
Dhtml ppt (2)
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)JavaScript - Chapter 13 - Browser Object Model(BOM)
JavaScript - Chapter 13 - Browser Object Model(BOM)
 
Html frames
Html framesHtml frames
Html frames
 
Html5 and-css3-overview
Html5 and-css3-overviewHtml5 and-css3-overview
Html5 and-css3-overview
 
Html 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally ChohanHtml 5 tutorial - By Bally Chohan
Html 5 tutorial - By Bally Chohan
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
 
New Elements & Features in HTML5
New Elements & Features in HTML5New Elements & Features in HTML5
New Elements & Features in HTML5
 
Css selectors
Css selectorsCss selectors
Css selectors
 
Java servlets
Java servletsJava servlets
Java servlets
 
html5.ppt
html5.ppthtml5.ppt
html5.ppt
 
HTML5 introduction for beginners
HTML5 introduction for beginnersHTML5 introduction for beginners
HTML5 introduction for beginners
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
CSS
CSSCSS
CSS
 
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic Elements
 

Viewers also liked

Honey con 2014
Honey con 2014Honey con 2014
Honey con 2014Ted Hsu
 
JS.Chi CSS Animations
JS.Chi CSS AnimationsJS.Chi CSS Animations
JS.Chi CSS AnimationsJustin Meyer
 
CSS3 filterとtransformをtransition, animationでアニメーション
CSS3 filterとtransformをtransition, animationでアニメーションCSS3 filterとtransformをtransition, animationでアニメーション
CSS3 filterとtransformをtransition, animationでアニメーションHiroaki Okubo
 
Dynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation BasicsDynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation BasicsBeth Soderberg
 
CSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsInayaili León
 
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016Rami Sayar
 
Introducing CSS Grid Layout
Introducing CSS Grid LayoutIntroducing CSS Grid Layout
Introducing CSS Grid LayoutRachel Andrew
 

Viewers also liked (20)

Css animation
Css animationCss animation
Css animation
 
Css3animation
Css3animationCss3animation
Css3animation
 
Honey con 2014
Honey con 2014Honey con 2014
Honey con 2014
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
 
JS.Chi CSS Animations
JS.Chi CSS AnimationsJS.Chi CSS Animations
JS.Chi CSS Animations
 
Ad 8
Ad 8Ad 8
Ad 8
 
CSS3 filterとtransformをtransition, animationでアニメーション
CSS3 filterとtransformをtransition, animationでアニメーションCSS3 filterとtransformをtransition, animationでアニメーション
CSS3 filterとtransformをtransition, animationでアニメーション
 
Session and cookies ,get and post methods
Session and cookies ,get and post methodsSession and cookies ,get and post methods
Session and cookies ,get and post methods
 
Dynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation BasicsDynamic CSS: Transforms, Transitions, and Animation Basics
Dynamic CSS: Transforms, Transitions, and Animation Basics
 
CSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and AnimationsCSS3 Transforms Transitions and Animations
CSS3 Transforms Transitions and Animations
 
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
 
Fundamental HTML5
Fundamental HTML5Fundamental HTML5
Fundamental HTML5
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
Introducing CSS Grid Layout
Introducing CSS Grid LayoutIntroducing CSS Grid Layout
Introducing CSS Grid Layout
 
Html forms
Html formsHtml forms
Html forms
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
reveal.js 3.0.0
reveal.js 3.0.0reveal.js 3.0.0
reveal.js 3.0.0
 

Similar to CSS Animations & Transitions - Refresh Hilo 2/10/15

Android App Development - 12 animations
Android App Development - 12 animationsAndroid App Development - 12 animations
Android App Development - 12 animationsDiego Grancini
 
Make your animations perform well
Make your animations perform wellMake your animations perform well
Make your animations perform wellAnna Migas
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular AnimationsGil Fink
 
Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017Codemotion
 
Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Anna Migas
 
HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well Anna Migas
 
CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)창석 한
 
Animation With Flutter.pptx
Animation With Flutter.pptxAnimation With Flutter.pptx
Animation With Flutter.pptxkhushbu thakker
 
Choosing your animation adventure - Generate NYC 2018
Choosing your animation adventure  - Generate NYC 2018Choosing your animation adventure  - Generate NYC 2018
Choosing your animation adventure - Generate NYC 2018Val Head
 
Basic Android Animation
Basic Android Animation Basic Android Animation
Basic Android Animation Shilu Shrestha
 
ios_summit_2016_korhan
ios_summit_2016_korhanios_summit_2016_korhan
ios_summit_2016_korhanKorhan Bircan
 
Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito
 
CSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGapCSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGapMark A R Smith
 
Workshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsWorkshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsVisual Engineering
 
Building animated UI with Core Animation
Building animated UI with Core AnimationBuilding animated UI with Core Animation
Building animated UI with Core AnimationMarco Zoffoli
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & HybridFITC
 

Similar to CSS Animations & Transitions - Refresh Hilo 2/10/15 (20)

Lesson 17
Lesson 17Lesson 17
Lesson 17
 
Lesson 17
Lesson 17Lesson 17
Lesson 17
 
Android App Development - 12 animations
Android App Development - 12 animationsAndroid App Development - 12 animations
Android App Development - 12 animations
 
Make your animations perform well
Make your animations perform wellMake your animations perform well
Make your animations perform well
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
 
Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017Make your animations perform well - Anna Migas - Codemotion Rome 2017
Make your animations perform well - Anna Migas - Codemotion Rome 2017
 
Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017 Make Your Animations Perform Well - JS Conf Budapest 2017
Make Your Animations Perform Well - JS Conf Budapest 2017
 
HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well HalfStack London - Make Your Animations Perform Well
HalfStack London - Make Your Animations Perform Well
 
CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)CSS3 TTA (Transform Transition Animation)
CSS3 TTA (Transform Transition Animation)
 
Animation With Flutter.pptx
Animation With Flutter.pptxAnimation With Flutter.pptx
Animation With Flutter.pptx
 
Choosing your animation adventure - Generate NYC 2018
Choosing your animation adventure  - Generate NYC 2018Choosing your animation adventure  - Generate NYC 2018
Choosing your animation adventure - Generate NYC 2018
 
Basic Android Animation
Basic Android Animation Basic Android Animation
Basic Android Animation
 
ios_summit_2016_korhan
ios_summit_2016_korhanios_summit_2016_korhan
ios_summit_2016_korhan
 
Day seven
Day sevenDay seven
Day seven
 
Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito — Animations in Angular 5
Neoito — Animations in Angular 5
 
animations
animationsanimations
animations
 
CSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGapCSS3 Animations & Transitions with PhoneGap
CSS3 Animations & Transitions with PhoneGap
 
Workshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effectsWorkshop 18: CSS Animations & cool effects
Workshop 18: CSS Animations & cool effects
 
Building animated UI with Core Animation
Building animated UI with Core AnimationBuilding animated UI with Core Animation
Building animated UI with Core Animation
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & Hybrid
 

More from Edward Meehan

Comps into pages 102
Comps into pages 102Comps into pages 102
Comps into pages 102Edward Meehan
 
Sketch - Refresh Hilo
Sketch - Refresh HiloSketch - Refresh Hilo
Sketch - Refresh HiloEdward Meehan
 
Comps into pages 101
Comps into pages 101Comps into pages 101
Comps into pages 101Edward Meehan
 
Refresh hilo 09/09/2014
Refresh hilo 09/09/2014Refresh hilo 09/09/2014
Refresh hilo 09/09/2014Edward Meehan
 
Drupal - Content Types, Views = No Query Headaches
Drupal - Content Types, Views = No Query HeadachesDrupal - Content Types, Views = No Query Headaches
Drupal - Content Types, Views = No Query HeadachesEdward Meehan
 
Refresh hilo-08122014
Refresh hilo-08122014Refresh hilo-08122014
Refresh hilo-08122014Edward Meehan
 
Rapid prototype demo
Rapid prototype demoRapid prototype demo
Rapid prototype demoEdward Meehan
 
Jekyll demo - Refresh Hilo
Jekyll demo - Refresh HiloJekyll demo - Refresh Hilo
Jekyll demo - Refresh HiloEdward Meehan
 

More from Edward Meehan (10)

Remote working
Remote workingRemote working
Remote working
 
Comps into pages 102
Comps into pages 102Comps into pages 102
Comps into pages 102
 
Sketch - Refresh Hilo
Sketch - Refresh HiloSketch - Refresh Hilo
Sketch - Refresh Hilo
 
Comps into pages 101
Comps into pages 101Comps into pages 101
Comps into pages 101
 
Capistrano demo
Capistrano demoCapistrano demo
Capistrano demo
 
Refresh hilo 09/09/2014
Refresh hilo 09/09/2014Refresh hilo 09/09/2014
Refresh hilo 09/09/2014
 
Drupal - Content Types, Views = No Query Headaches
Drupal - Content Types, Views = No Query HeadachesDrupal - Content Types, Views = No Query Headaches
Drupal - Content Types, Views = No Query Headaches
 
Refresh hilo-08122014
Refresh hilo-08122014Refresh hilo-08122014
Refresh hilo-08122014
 
Rapid prototype demo
Rapid prototype demoRapid prototype demo
Rapid prototype demo
 
Jekyll demo - Refresh Hilo
Jekyll demo - Refresh HiloJekyll demo - Refresh Hilo
Jekyll demo - Refresh Hilo
 

Recently uploaded

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

CSS Animations & Transitions - Refresh Hilo 2/10/15

  • 2. What’s going to be covered ● What are Transitions & Animations ● Pros and Cons ● Performance
  • 3. Transitions div { color:black; transition: color 1s linear 500ms; transition-property: color; transition-duration: 1s; transition-timing-function: linear; transition-delay: 500ms; } div:hover {color:red;}
  • 4. Transitions ● Transition property - what will change ● Transition duration - animation time ● Transition timing function - animation speed curve ● Transition delay - time before animation Must have a property and duration set for transition animations to work!
  • 5. Transitions Changes transition property from one state to another. ● Set animation in current state, modify state with pseudo classes (:hover,:focus) or classes (.active) ● Multiple properties can be animated ● Animation properties can be changed (Javascript & :pseudo) ● JS listeners on transition end: ‘transitionend’ ● Properties List ● Demo
  • 7. Animations div { animation: GoAnimate 2s;} @keyframes GoAnimate { from { color: black;} to { color: red;} }
  • 8. Animations div { animation-name: GoAnimate; animation-duration: 1s; animation-timing-function: linear; animation-delay: 500ms; animation-iteration-count: infinite; animation-direction: normal; animation-play-state: running; animation-fill-mode: forward; } @keyframes GoAnimate { 0% { color: black;} 25% {color:pink;} 50% {color:orange;} 75% {color:blue;} 100% { color: red;} }
  • 9. Animations ● Animation name - name of defined animation ● Animation duration, timing function, delay same as transition ● Animation iteration count - how many times it will loop ● Animation direction - direction and alternate cycles ● Animation play state - running or paused (can toggle) ● Animation fill mode - sets end state after animation Must have a name and duration set for animations to work!
  • 10. Animations ● Once an animation is applied it can’t be changed, only paused (animation-play-state) - can be changed with JS, but resets the animation ● JS listeners on start, iteration, end of animation (not paused) - event object is useful, ‘elapsedTime’ o ‘animationstart’, ‘animationiteration’, ‘animationend’ ● Don’t forget animation-fill-mode ● Properties List ● Demo Swing, Demo Play State
  • 12. Pros & Cons Transitions Pros ● Good for :pseudo-classes (:hover,:active) ● Does not require JS ● Reversible - easy state change ● Easy to use Transitions Cons ● Simple only ● Browser prefixes (-webkit) ● Sometimes requires JS assistance - change the height of something Animations Pros ● Complex Animations with multiple keyframes (0%, 1%, 5%) ● JS listeners ● Defined Animations - modular Animations Cons ● Can’t change without JS - no easy reverse ● Browser prefixes ● Complex interactions require JS
  • 13. Performance How do you measure performance? Chrome dev tools > timeline Record Animation and review results. Goal > 30fps - target is around 60fps
  • 14. Performance CPU vs GPU Animation: Most animation use the CPU, animations that use transforms (sometimes) use the GPU. ● Use transform:translate() vs TRBL o TRBL uses whole pixels - requires more paint time o transform:translate uses subpixels and tweens animation smoother - no stair stepping ● Low cost animations = position(transform), rotation, scale, opacity
  • 15. Performance TRBL transform:translate Scripting = JS events, functions, etc Rendering = layout Painting = pixels on screen Idle = sipping Mai-Tai’s
  • 16. Questions? Edward Meehan - Refresh Hilo 2015