Peachpit Press www.peachpit.com
by Julian Shapiro
Book Details
Price
|
3.00 |
---|---|
Pages
| 402 p |
File Size
|
5,509 KB |
File Type
|
PDF format |
ISBN-13 ISBN-10
| 978-0-134-09666-7 0-134-09666-5 |
Copyright©
| 2015 by Julian Shapiro |
In the early days of the web, animation was primarily used by novice developers as a
last-ditch effort to call attention to important parts of a page. And even if they wanted
animation to transcend its niche, it couldn’t: browsers (and computers) were simply too
slow to deliver smooth web-based animation.
We’ve come a long way since the days of flashing banner ads, scrolling news tickers,
and Flash intro videos. Today, the stunning motion design of iOS and Android
dramatically improves the user experience—instead of detracting from it. Developers of
the best sites and apps leverage animation to improve the feel and intuitiveness of their
user interfaces. Animation’s rise to relevancy isn’t just a by-product of improved
processing power; it reflects a better appreciation for best practices within the web
development community. The tools you use to make a website are now considered less
important than the quality of the resulting user experience. As obvious as this seems, it
wasn’t always the case.
So, what makes animation in particular so useful? Whether it’s transitioning between
chunks of content, designing intricate loading sequences, or alerting the user what to do
next, animation complements text and layout to reinforce your site’s intended behavior,
personality, and visual sophistication. Does your content bounce into view in a friendly
way, or does it whip across the screen? This is the domain of motion design, and the
decisions you make will establish the transcendent feeling of your app.
When users recommend your app to others, they’ll often try to describe it with words
like “sleek” or “polished.” What they don’t realize is that they’re mostly referring to the
motion design work that’s gone into the interface. This inability of the layman to make the
distinction is precisely what great user interface (UI) designers strive for: animations that
reinforce the interface’s objectives but don’t otherwise divert the user’s attention.
This book provides you with the foundation necessary to implement animation
confidently and in a way that’s both technically maintainable and visually impactful.
Throughout, it considers the balance between enriching a page with motion design and
avoiding unnecessary flourishes.
Why is all of this so important? Why is it worth your time to perfect your transitions
and easing combinations? For the same reason that designers spend hours perfecting their
font and color combinations: refined products simply feel superior. They leave users
whispering to themselves, “Wow, this is cool,” right before they turn to a friend and
exclaim, “You gotta see this!”
Table of Contents
Foreword
Introduction
CHAPTER 1 ADVANTAGES OF JAVASCRIPT ANIMATION
JavaScript vs. CSS animation
Great performance
Features
Page scrolling
Animation reversal
Physics-based motion
Maintainable workflows
Wrapping up
CHAPTER 2 ANIMATING WITH VELOCITY.JS
Types of JavaScript animation libraries
Installing jQuery and Velocity
Using Velocity: Basics
Velocity and jQuery
Arguments
Properties
Values
Chaining
Using Velocity: Options
Duration
Easing
Begin and Complete
Loop
Delay
Display and Visibility
Using Velocity: Additional features
Reverse Command
Scrolling
Colors
Transforms
Using Velocity: Without jQuery (intermediate)
Wrapping up
CHAPTER 3 MOTION DESIGN THEORY
Motion design improves the user experience
Utility
Borrow conventions
Preview outcomes
Distraction over boredom
Leverage primal instincts
Make interactions visceral
Reflect gravitas
Reduce concurrency
Reduce variety
Mirror animations
Limit durations
Limit animations
Elegance
Don’t be frivolous
Your one opportunity to be frivolous
Consider personality
Go beyond opacity
Break animations into steps
Stagger animations
Flow from the triggering element
Use graphics
Wrapping up
CHAPTER 4 ANIMATION WORKFLOW
CSS animation workflow
Issues with CSS
When CSS makes sense
Code technique: Separate styling from logic
Standard approach
Optimized approach
Code technique: Organize sequenced animations
Standard approach
Optimized approach
Code technique: Package your effects
Standard approach
Optimized approach
Design techniques
Timing multipliers
Use Velocity Motion Designer
Wrapping up
CHAPTER 5 ANIMATING TEXT
The standard approach to text animation
Preparing text elements for animation with Blast.js
How Blast.js works
Installation
Option: Delimiter
Option: customClass
Option: generateValueClass
Option: Tag
Command: Reverse
Transitioning text into or out of view
Replacing existing text
Staggering
Transitioning text out of view
Transitioning individual text parts
Transitioning text fancifully
Textual flourishes
Wrapping up
CHAPTER 6 SCALABLE VECTOR GRAPHICS PRIMER
Creating images through code
SVG markup
SVG styling
Support for SVG
SVG animation
Passing in properties
Presentational attributes
Positional attributes vs. transforms
Implementation example: Animated logos
Wrapping up
CHAPTER 7 ANIMATION PERFORMANCE
The reality of web performance
Technique: Remove layout thrashing
Problem
Solution
jQuery Element Objects
Force-feeding
Technique: Batch DOM additions
Problem
Solution
Technique: Avoid affecting neighboring elements
Problem
Solution
Technique: Reduce concurrent load
Problem
Solution
Technique: Don’t continuously react to scroll and resize events
Problem
Solution
Technique: Reduce image rendering
Problem
Solution
Sneaky images
Technique: Degrade animations on older browsers
Problem
Solution
Find your performance threshold early on
Wrapping up
CHAPTER 8 ANIMATION DEMO
Behavior
Code structure
Code section: Animation setup
Code section: Circle creation
Code section: Container animation
3D CSS primer
Properties
Options
Code section: Circle animation
Value functions
Opacity animation
Translation animation
Reverse command
Wrapping up
Index