May 30, 2014
[caption id="" align=“alignnone” width=“548.0”] This week: make a face look like it’s chewing. I got well acquainted with animation functions, to swap two SVGs (one wide mouthed, one narrow).It’s animating the color:
@keyframes chew 0% color: inherit 100% color: transparent
And the SVG classes get the animation, with opposing directions:
.wide-mouth animation-name: chew animation-duration: 0.28s animation-iteration-count: infinite animation-direction: forwards animation-timing-function: steps(2, start) .narrow-mouth # same as above… animation-direction: backwards
Since the color became halved, there was some manual color matching instead of inheriting the normal color:
color: adjust-color(adjust-color($active_blue, $saturation: 61, $lightness: -24), $blue: 20, $green: 20)
And that’s why I’m glad the project’s using SASS. [/caption]
Hey, I'm Ian. I build websites and write about what I learn as I go. Follow me on Twitter.