- @include shake($x, $y, $rot, $name, $steps, $opacity);
- /* _mixins.sCSS */
- /* $x & $y: pixels to move on the X and Y axis,
- $rot: deg to rotate
- $name: the name assigned to those parameters
- $steps: adjust the animation loop (i.e 10 makes an animation in steps of 10%)
- $opacity: true/false to add opacity animation */
- @include shake(40px, 40px, 20deg, 'shake-crazy', 10, true);
- /* an example */
- @include animation($name, $dur, $iter, $tim, $del);
- /* _shake.scss */
- /* $name: animation-name,
- $dur: animation-duration,
- $iter: animation-iteration-count,
- $tim: animation-timing-function,
- $del: animation-delay */
- @include animation(shake - slow, 5s);
- /* an example */
注意:你需要使用
函数来编译 Sass 文件。{aa6aa}有如何实现的方法,或者参考 {aa5aa} 或{aa4aa}。
- random()
来源: http://www.webhek.com/post/css-shake.html