-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.html
executable file
·312 lines (307 loc) · 11.8 KB
/
examples.html
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<!DOCTYPE html>
<html>
<head>
<title>CSS Transitions and Animations</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery-2.0.3.min.js"></script>
</head>
<body>
<div class="nav">
<ul class="nav-main">
<li>
<a href="#transform">Transform</a>
</li>
<li>
<a href="#transition">Transition</a>
</li>
<li>
<a href="#animation">Animation</a>
</li>
</ul>
</div>
<div class="content">
<a name="transform" class="spacer"></a>
<h2>Transform</h2>
<!-- <p><b>transform: translate(12px, 50%)</b></p> -->
<ol>
<li><a href="#translate">translate </a></li>
<li><a href="#skew">skew </a></li>
<li><a href="#scale">scale </a></li>
<li><a href="#rotate">rotate </a></li>
<li><a href="#perspective">perspective </a></li>
<li><a href="#matrix">matrix </a></li>
<!-- <li><a href="#3D">3D </a></li> -->
</ol><a name="translate" class="spacer"></a>
<dl>
<dt>transform: translate()</dt>
<dd>
<div class="playground">
<p>none</p>
<img src="img/1.png">
</div>
<div class="playground translate">
<p>translate(12px, 50%)</p>
<img src="img/1.png" class="translate-1">
</div>
<div class="playground translateX">
<p>translateX(<textarea>40px</textarea>)</p>
<img src="img/1.png" class="translate-2">
</div>
<div class="playground translateY">
<p>translateY(<textarea>60px</textarea>)</p>
<img src="img/1.png" class="translate-3">
</div>
</dd>
<dd>Specifies a 2D translation by vector [tx, ty]</dd>
<dd>
<dl>
<dt>translate(tx[, ty]);</dt>
<dd>if ty isn't specified, its value is assumed zero</dd>
<dt>translateX(ax)</dt>
<dd>translates amount along X axis</dd>
<dt>translateY(ay)</dt>
<dd>translates amount along Y axis</dd>
</dl>
</dd><a name="skew" class="spacer"></a>
<dt>transform: skew()</dt>
<dd>
<div class="playground">
<p>none</p>
<img src="img/2.png">
</div>
<div class="playground skew">
<p>skew(5deg, 10deg)</p>
<img src="img/2.png" class="skew-1">
</div>
<div class="playground skewX">
<p>skewX(<textarea>10deg</textarea>)</p>
<img src="img/2.png" class="skew-2">
</div>
<div class="playground skewY">
<p>skewY(<textarea>10deg</textarea>)</p>
<img src="img/2.png" class="skew-3">
</div>
</dd>
<dd>Specifies a 2D translation by vector [tx, ty]</dd>
<dd>
<dl>
<dt>skew(ax[, ay]);</dt>
<dd>if ay isn't specified, no skew happens on the Y axis</dd>
<dt>skewX(angle)</dt>
<dd>skews amount along X axis by given angle</dd>
<dt>skewY(angle)</dt>
<dd>skews amount along Y axis by given angle</dd>
</dl>
</dd><a name="scale" class="spacer"></a>
<dt>transform: scale()</dt>
<dd>
<div class="playground">
<p>none</p>
<img src="img/3.png">
</div>
<div class="playground scale">
<p>scale(.3, 1.15)</p>
<img src="img/3.png" class="scale-1">
</div>
<div class="playground scaleX">
<p>scaleX(<textarea>2</textarea>)</p>
<img src="img/3.png" class="scale-2">
</div>
<div class="playground scaleY">
<p>scaleY(<textarea>.5</textarea>)</p>
<img src="img/3.png" class="scale-3">
</div>
</dd>
<dd>Specifies a 2D scaling operation with a unitless number</dd>
<dd>
<dl>
<dt>scale(sx[, sy]);</dt>
<dd>if sy isn't specified, no scaling happens on the Y axis'</dd>
<dt>scaleX(sx)</dt>
<dd>skews amount along X axis by given angle</dd>
<dt>scaleY(sy)</dt>
<dd>skews amount along Y axis by given angle</dd>
</dl>
</dd><a name="rotate" class="spacer"></a>
<dt>transform: rotate()</dt>
<dd>
<div class="playground">
<p>none</p>
<img src="img/1.png">
</div>
<div class="playground rotate">
<p>rotate(<textarea>15deg</textarea>)</p>
<img src="img/1.png" class="rotate-1">
</div>
</dd>
<dd>Rotates element clockwise around its origin by the specified angle</dd>
<dd>
<dl>
<dt>rotate(angle)</dt>
<dd>can be negative</dd>
</dl>
</dd><a name="perspective" class="spacer"></a>
<dt>transform: perspective()</dt>
<dd>
<div class="playground">
<p>none</p>
<img src="img/2.png">
</div>
<div class="playground perspective">
<p>perspective(400px) rotateX(45deg)</p>
<img src="img/2.png" class="perspective-1">
</div>
<div class="playground rotateX">
<p>perspective(400px) rotateX(45deg)</p>
<img src="img/2.png" class="perspective-2">
</div>
<div class="playground perspective">
<p>perspective(400px) rotateY(45deg)</p>
<img src="img/2.png" class="perspective-3">
</div>
</dd>
<dd>Distance between the Z plane and the user to give a 3D perspective. The <i>vanishing point</i> is placed in the center by default, but can be changed using <strong>perspective-origin</strong></dd>
<dd>Applying a perspective to a parent element will give the same perspective point for all its children. See <a href="http://desandro.github.io/3dtransforms/examples/perspective-02-children.html">Parents and Perspective</a>
</dd>
<dd>
<dl>
<dt>perspective(length)</dt>
<dd>length is the distance measured away from Z plane</dd>
<dt>perspective-origin: % | position</dt>
<dd>lengths are ok. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/perspective-origin">Perspective-Origin Values</a></dd>
</dl>
</dd><a name="matrix" class="spacer"></a>
<dt>transform: matrix()</dt>
<dd>
<div class="playground">
<p>none</p>
<img src="img/3.png">
</div>
<div class="playground matrix triple">
<p>matrix(1, 0, .6, 1, 0, 0)</p>
<img src="img/3.png" class="matrix-1">
</div>
</dd>
<dd>Builds transformation matrix with translate values</dd>
<dd>
<dl>
<dt>matrix(a, b, c, d, tx, ty)</dt>
<dd>a: top-left , b: bottom-left , c: top-right , d: bottom-left , tx: translateX , ty: translateY</dd>
<dt>perspective-origin: % | position</dt>
<dd>lengths are ok. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/perspective-origin">Perspective-Origin Values</dd>
</dl>
</dd>
</dl>
<a name="transition"></a>
<h2>Transition</h2>
1. Single iteration <br/>
2. Requires CSS property being changed <br/>
3. Transition:all (could be bad for performance)<br/>
4. Best paired with javaScript </br>
<dl>
<dt>transition-delay</dt>
<dd>Configures delay before the transition occurs once activated</dd>
<dt>transition-duration</dt>
<dd>Configures how long the transition will happen until it achieves the new property</dd>
<dt>transition-property</dt>
<dd>Specifies which properties will be transitioned. The browser listens for the exact ones explicitly stated, unless 'all' is declared</dd>
<dt>transition-timing-function</dt>
<dd>Configures how the transition gets to the next value. Usually a curve in time</dd>
</dl>
<a name="animation"></a>
<h2>Animations</h2>
1. Infinite iterations<br/>
2. Doesn't require triggers <br/>
3. Multiple intermediate points <br/>
<dl>
<dt>animation-delay</dt>
<dd>Configures the delay between the time the element is loaded and the beginning of the animation sequence.</dd>
<dd>
<dl>
<dt>[ 3s ]</dt>
<dd>indicates seconds</dd>
<dt>[ 2s, 4ms ]</dt>
<dd>2:04 seconds</dd>
</dl>
</dd>
<dt>animation-direction</dt>
<dd>Configures whether or not the animation should alternate direction on each run through the sequence or reset to the start point and repeat itself.</dd>
<dd>
<dl>
<dt>[ normal ]</dt>
<dd>plays normally</dd>
<dt>[ reverse ]</dt>
<dd>plays backwards </dd>
<dt>[ alternate ]</dt>
<dd>alternates between forward and backward timing functions included</dd>
<dt>[ alternate-reverse ]</dt>
<dd>alternates starting with reversed</dd>
</dl>
</dd>
<dt>animation-duration</dt>
<dd>Configures the length of time that an animation should take to complete one cycle.</dd>
<dd>
<dl>
<dt>[ 6s ]</dt>
<dd>6 seconds</dd>
<dt>[ 120ms ]</dt>
<dd>120 milliseconds</dd>
</dl>
</dd>
<dt>animation-iteration-count</dt>
<dd>Configures the number of times the animation should repeat; you can specify infinite to repeat the animation indefinitely.</dd>
<dd>
<dl>
<dt>[ infinite ]</dt>
<dd>plays foreverrrr</dd>
<dt>[ 3 ]</dt>
<dd>repeats 3 times</dd>
<dt>[ 2.3 ]</dt>
<dd>repeats 2 times, then for .3 of a third iteration</dd>
</dl>
</dd>
<dt>animation-name</dt>
<dd>Specifies the name of the @keyframes at-rule describing the animation's keyframes.</dd>
<dd>
<dl>
<dt>[ none ]</dt>
<dd>used to deactivate an animation without changing order of the other identifiers</dd>
<dt>[ IDENT ]</dt>
<dd>case-insensitive identifier(s) listed by commas. </dd>
<dt>[ 2.3 ]</dt>
<dd>repeats 2 times, then for .3 of a third iteration</dd>
</dl>
</dd>
<dt>animation-play-state</dt>
<dd>Lets you pause and resume the animation sequence.</dd>
<dd><i>W3C is considering removing this property</i></dd>
<dd>
<dl>
<dt>[ running ]</dt>
<dd>animation is currently playing</dd>
<dt>[ paused ]</dt>
<dd>animation is currently paused</dd>
<dt>[ paused, running, running ]</dt>
<dd> what does this mean?!</dd>
</dl>
</dd>
<dt>animation-timing-function</dt>
<dd>Configures the timing of the animation; that is, how the animation transitions through keyframes, by establishing acceleration curves.</dd>
<dd>See: <a href="http://cubic-bezier.com/#.17,.67,.83,.67" target="new">
Bezier Curve Comparison</a></dd>
<dt>animation-fill-mode</dt>
<dd>Configures what values are applied by the animation before and after it is executing.</dd>
<dd>
<dl>
<dt>[ none ]</dt>
<dd>Target will not apply any styles to the target before or after it is executing</dd>
<dt>[ forwards ]</dt>
<dd>Target will retain the computed values set by the last keyframe encountered during execution (retained during animation-delay)</dd>
<dt>[ backwards ]</dt>
<dd>The animation will apply values defined in the first relevant keyframe as soon as it is applied to the target (retained during animation-delay).
</dd>
</dl>
</div>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>