Manager, UX Design and Engineering
at Trulia (Zillow Group)
@sarah_edo : twitter || @sdras : codepen
Generate Conf, New York 2016
what happens when you visit a website?
Creating Spatial Awareness
We already use this information
Right tool for the right job
Use appropriately
Helps with spatial awareness
From this CSS-Tricks Article
modals suck!
it's not them, it's their typical UX pattern!
Adhering to your branding means motion solves the problem for your users.
Do you hate animation?
this pen.
This pen.
this pen.
Viget did an experiment and found that despite some individual variation, novel loaders as a whole had a higher wait time and lower abandon rate than generic ones
This pen.
CSS/SCSS
GSAP (GreenSock)
React-Motion
Very easy to implement. SVG stays a consistent size.
Bad transform origin bug on rotation, soon to be solved in Firefox.
More in this CSS-Tricks article.
Chrome
IE
Firefox
Safari (zoomed)
The issue with longer CSS animations:
This pen.
This pen courtesy of GreenSock.
This pen.
//variable declaration for the global repeated animations
var gear = $("#gear1, #gear2, #gear3");
...
//animation that's repeated for all of the sections
function revolve() {
var tl = new TimelineMax();
tl.add("begin");
tl.to(gear, 4, {
transformOrigin: "50% 50%",
rotation: 360,
ease: Linear.easeNone
}, "begin");
...
return tl;
}
var repeat = new TimelineMax({repeat:-1});
repeat.add(revolve());
function paintPanda() {
var tl = new TimelineMax();
tl.to(lh, 1, {
scaleY: 1.2,
rotation: -5,
transformOrigin: "50% 0",
ease: Circ.easeOut
}, "paintIt+=1");
...
return tl;
}
//create a timeline but initially pause it so that we can control it via click
var triggerPaint = new TimelineMax({
paused: true
});
triggerPaint.add(paintPanda());
//this button kicks off the panda painting timeline
$("#button").on("click", function(e) {
e.preventDefault();
triggerPaint.restart();
});
...
(one source example, The Whole Brain Group)
This pen.
Change the viewBox in JavaScript:
Media queries for layout, and fallback with Modernizr:
/* media query example element, mobile first */
@media (max-width: 825px) {
container {
width: 100%;
}
}
@media (min-width: 826px) {
.container {
width: 825px;
}
}
/* fallback */
.inlinesvg .fallback {
display: none;
}
.no-inlinesvg .fallback {
width: 500px;
height: 500px;
display: block;
}
Title and associative aria tags: (WIP)
<svg aria-labelledby="title" id="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 765 587">
<title id="title" lang="en">Circle of icons that illustrate Global Warming Solutions</title>
You can also add a title for elements in the SVG DOM
This resource, with support charts.
Also, this article by Dudley Storey.
Fun. Remember fun?
(I don't work for them and they don't pay me)
Designing Interface Animations- Val Head
Web Animation Weekly
@sarah_edo on twitter
@sdras on codepen
These Slides: