-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path_animate.sass
More file actions
188 lines (144 loc) · 3.72 KB
/
_animate.sass
File metadata and controls
188 lines (144 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// *************************************
//
// Animate
// -> Movement and effects
// CodePen: http://codepen.io/drewbarontini/pen/vErBjO
//
// -------------------------------------
// Template (Haml)
// -------------------------------------
//
// .animate[fadeIn|slideDown|... infinite 1|2|3...]
//
// *************************************
// -------------------------------------
// Variables
// -------------------------------------
// ----- Settings ----- //
$animate-duration: 1s !default
$animate-effects-basic: fadeIn, fadeOut, scaleDown, scaleUp, slideDown, slideUp !default
$animate-effects-fancy: bounce, fadeInDown, fadeInUp, flash, shake, tada !default
$animate-steps: 4 !default
// -------------------------------------
// Base
// -------------------------------------
.animate
animation-duration: $animate-duration
animation-fill-mode: both
// -------------------------------------
// Modifiers
// -------------------------------------
// ----- Effects ----- //
// Basic
@each $effect in $animate-effects-basic
.animate--#{$effect}
animation-name: $effect
// Fancy
@each $effect in $animate-effects-fancy
.animate--#{$effect}
animation-name: $effect
// ----- Infinite ----- //
.animate--infinite
animation-iteration-count: infinite
// ----- Steps ----- //
@for $i from 1 through $animate-steps
.animate--#{$i}
animation-delay: ($animate-duration * $i) - $animate-duration
// -------------------------------------
// Animations: Basic
// -------------------------------------
// ----- Fade In ----- //
@keyframes fadeIn
from
opacity: 0
to
opacity: 1
// ----- Fade Out ----- //
@keyframes fadeOut
from
opacity: 1
to
opacity: 0
// ----- Scale Down ----- //
@keyframes scaleDown
from
transform: scale(2)
to
transform: scale(1)
// ----- Scale Up ----- //
@keyframes scaleUp
from
transform: scale(0)
to
transform: scale(1)
// ----- Slide Down ----- //
@keyframes slideDown
from
transform: translateY(-100%)
to
transform: translateY(0)
// ----- Slide Up ----- //
@keyframes slideUp
from
transform: translateY(100%)
to
transform: translateY(0)
// -------------------------------------
// Animations: Fancy (Animate.css)
// -> Credit: http://daneden.github.io/animate.css/
// -------------------------------------
// ----- Bounce ----- //
@keyframes bounce
0%, 20%, 53%, 80%, 100%
transform: translate3d(0,0,0)
transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000)
40%, 43%
transform: translate3d(0, -30px, 0)
transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060)
70%
transform: translate3d(0, -15px, 0)
transition-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060)
90%
transform: translate3d(0,-4px,0)
// ----- Fade In Down ----- //
@keyframes fadeInDown
0%
opacity: 0
transform: translate3d(0, -100%, 0)
100%
opacity: 1
transform: none
// ----- Fade In Up ----- //
@keyframes fadeInUp
0%
opacity: 0
transform: translate3d(0, 100%, 0)
100%
opacity: 1
transform: none
// ----- Flash ----- //
@keyframes flash
0%, 50%, 100%
opacity: 1
25%, 75%
opacity: 0
// ----- Shake ----- //
@keyframes shake
0%, 100%
transform: translate3d(0, 0, 0)
10%, 30%, 50%, 70%, 90%
transform: translate3d(-10px, 0, 0)
20%, 40%, 60%, 80%
transform: translate3d(10px, 0, 0)
// ----- Tada ----- //
@keyframes tada
0%
transform: scale3d(1, 1, 1)
10%, 20%
transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)
30%, 50%, 70%, 90%
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)
40%, 60%, 80%
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)
100%
transform: scale3d(1, 1, 1)