-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.html
executable file
·363 lines (324 loc) · 20.2 KB
/
index.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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head profile="http://gmpg.org/xfn/11">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Unfolding the Box Model: Exploring CSS 3D Transforms</title>
<meta name="description" content="A short presentation demonstrating the exciting potential of CSS 3D Transforms, a web standard you can use today :)">
<meta name="author" content="Chris Ruppel">
<meta name="viewport" content="width=device-width,user-scalable=no">
<meta name="monetization" content="$ilp.uphold.com/BGG9gLz6k9z9">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<p class="mobile-warning">Hi.<br><br> You have arrived at <strong>Unfolding the Box Model</strong>, a presentation that explores CSS 3D Transforms. <br><br> It doesn't look right unless you view on something at least 1200px wide. So widen that window, or just bookmark it and check it out later!<br><br>— <a href="https://twitter.com/rupl">Chris</a></p>
<main role="main" class="main wrapper clearfix" id="slides">
<nav role="navigation">
<a class="back" title="back">‹</a>
<a class="next" title="next">›</a>
</nav>
<article id="s1">
<h1>
<span class="fold">
<span class="un">Un</span>fold<span class="ing">ing</span>
</span>
<span class="the">
the
<span class="b">
B<span class="ox">ox</span>
</span>
<span class="m">
M<span class="odel">odel</span>
</span>
</span>
</h1>
<h2><span>Exploring CSS 3D Transforms</span></h2>
<div class="warning">
<p>Darn, your browser seems unable to display 3D Transforms.</p>
</div>
<p class="instructions">
Use the ‹ and › keys<br>
to advance backward and forward.
</p>
</article>
<article id="s2">
<p class="intro friend show">Here is our dear friend, the <strong>DOM element</strong>.</p>
<p class="limits">For so long, we've had limited options: <span class="floats bold">floats</span> and <span class="pos">positioning</span></p>
<div class="sandbox">
<div class="de"></div>
<p class="design">Web design is the ever-evolving art</p>
<p class="placing">of placing DOM elements on the page</p>
<p class="lipsum">Quinoa portland farm-to-table retro, put a bird on it mlkshk tattooed flannel actually high life carles semiotics iphone. Single-origin coffee blue bottle helvetica, neutra letterpress typewriter cardigan ethical. Selvage bushwick american apparel next level.</p>
<p class="lipsum">Jean shorts whatever blog bushwick. Actually godard pitchfork, neutra bushwick dreamcatcher pour-over farm-to-table food truck banjo authentic occupy mlkshk vice. Farm-to-table brooklyn cosby sweater, tattooed stumptown keytar.</p>
</div>
</article>
<article id="s3">
<div class="sandbox sandbox1">
<p class="intro">However, there's a feature of CSS that unlocks a whole new dimension:</p>
<h2 class="hide"><span>CSS 3D Transforms</span></h2>
</div>
<div class="sandbox sandbox2 hide">
<p class="intro explain">
3D Transforms let you <span class="translate">translate</span> and <span class="rotate">rotate</span> DOM Elements.<br>
There are three axes: <span class="axes"><span class="x">X</span>, <span class="y">Y</span>, <span class="z">Z</span>
</p>
<div class="de"><span class="axis"></span></div>
</div>
</article>
<article id="s4">
<p class="intro">
Combined with some settings that control perspective,<br>
3D transforms will make your DOM Elements jump out of flatland!
</p>
<div class="sandbox">
<div class="cube hide">
<span class="top side"></span>
<span class="left side"></span>
<span class="right side"></span>
<span class="bottom side">
<span class="back side"></span>
</span>
</div>
</div>
<dl>
<dt class="transform-style hide"><code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-style">transform-style</a></code></dt>
<dd class="transform-style hide">A value of <code>preserve-3d</code> tells the browser you want 3D.</dd>
<dt class="perspective hide"><code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/perspective">perspective</a></code></dt>
<dd class="perspective hide">An integer representing distance from camera. Measured in px.</dd>
<dt class="perspective-origin hide"><code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/perspective-origin">perspective-origin</a></code></dt>
<dd class="perspective-origin hide">Specifies the vanishing point of the perspective effect.</dd>
</dl>
</article>
<article id="s5">
<p class="intro">
These settings go on the element you want to transform:
</p>
<div class="sandbox">
<div class="cube hide">
<span class="top side"></span>
<span class="left side"></span>
<span class="right side"></span>
<span class="bottom side">
<span class="back side"></span>
</span>
<span class="handles h-translate tx"></span>
<span class="handles h-translate ty"></span>
<span class="handles h-translate tz"></span>
<span class="handles h-rotate rx"></span>
<span class="handles h-rotate ry"></span>
<span class="handles h-rotate rz"></span>
</div>
</div>
<dl>
<dt class="translate hide"><code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#translate()">translate()</a></code></dt>
<dd class="translate hide">Moves elements in space.</dd>
<dt class="rotate hide"><code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function#rotate()">rotate()</a></code></dt>
<dd class="rotate hide">Rotates elements in space.</dd>
<dt class="backface-visibility hide"><code><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility">backface-visibility</a></code></dt>
<dd class="backface-visibility hide">Specifies if you can see this element when it is <b>not</b> facing you.</dd>
</dl>
</article>
<article id="s6">
<p class="intro">
<span class="flat">Transforms are inherited by children.</span><br>
You can think of nested <span class="elements">elements <span class="like">much like <span class="paper">paper <span class="folds">folds</span></span></span></span>
</p>
<div class="sandbox">
<div class="cube rotate hide">
<span class="top flat side"></span>
<span class="left flat side"></span>
<span class="right flat side"></span>
<span class="bottom flat side">
<span class="back flat side"></span>
</span>
</div>
</div>
</article>
<article id="s7">
<p class="intro">You can use this inheritance to simulate more complex objects</p>
<p class="slinky-desc hide">This slinky is not a spiral, but numerous nested <code><div></code>s</p>
<p class="solar-desc hide">A solar system only needs one element per celestial body.</p>
<div class="sandbox">
<div class="slinky hide">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment">
<div class="segment last">
<!-- nothing to see here, move along -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- .slinky -->
<!-- There is lots of prior art for this: http://codepen.io/juliangarnier/pen/idhuG -->
<div class="solar-system hide">
<span class="sun">
<span class="earth">
<span class="moon"></span>
</span>
</span>
</div>
</div><!-- .sandbox -->
</article>
<article id="s8">
<p class="intro">You can also incorporate transformed elements into images.</p>
<!-- I took the tile photo right here: http://j.mp/tile-aic -->
<div id="floor">
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div class="panel"><div class="left"></div><div class="right"></div><div class="front"></div><div class="back"></div><div class="top"></div><div class="shadow"></div></div>
<div id="base"></div>
</div><!-- #floor -->
<div id="fallback"><b>If you can read this, it means your browser cannot process the 3D transforms on this page.</b><br> There's no good fallback behavior, so I put this message here to let you know what happened.</div>
</article>
<article id="s9">
<p class="intro">You can combine transforms with other CSS to create interesting effects</p>
<p class="mouse"><small>(move your mouse around!)</small></p>
<div class="back layer"><span contenteditable>Back</span></div>
<div class="middle layer"><span contenteditable>Middle</span></div>
<div class="front layer"><span contenteditable>Front</span></div>
</article>
<article id="s10">
<div class="de"></div>
<p class="intro">Back to our humble friend:</p>
<p class="intro world hide">We now have a whole new world for it to explore.</p>
<div class="c hide">
<h3>Transform properties</h3>
<ul>
<li class="translate"><code>translate()</code>
<li class="rotate"><code>rotate()</code>
<li class="transform-origin"><code>transform-origin</code>
<li class="backface-visibility"><code>backface-visibility</code>
</ul>
<h3>Container properties</h3>
<ul>
<li class="perspective"><code>perspective()</code>
<li class="perspective-origin"><code>perspective-origin()</code>
<li class="transform-style"><code>transform-style()</code>
</ul>
</div>
</article>
<article id="s11">
<p class="intro" style="margin-top: 0em; ">Wall o' links 'n' resources:</p>
<ul class="links demos">
<li><a href="https://www.youtube.com/watch?v=w9HeWBH_kvg">Maths-powered transforms for creating 3D shapes</a>
<li><a href="https://creativeguidebook.appspot.com/">A detailed pop-up book made with 3D transforms</a>
<li><a href="https://www.clicktorelease.com/code/css3dclouds/">Cool-looking clouds</a>
<li><a href="https://codepen.io/peterwestendorp/pen/wGECk">3D sphere-ish thing using border radius</a>
<li><a href="https://css3playground.com">CSS3 Playground - 3D transforms and more.</a>
<li><a href="https://desandro.github.io/3dtransforms/">Comprehensive intro to 3D transforms</a>
<li><a href="https://bartaz.github.io/meetjs/css3d-summit/">Short introduction to 3D transforms</a>
<li><a href="https://24ways.org/2010/intro-to-css-3d-transforms/">24-ways: Intro to CSS 3D Transforms</a>
<li><a href="https://acko.net/blog/making-love-to-webkit/">Making love to WebKit</a>
<li><a href="https://acko.net/blog/this-is-your-brain-on-css/">This is your Brain on CSS</a>
<li><a href="http://tridiv.com/">Tridiv - CSS 3D Transform editor (insecure origin)</a>
</ul>
</article>
<article id="s12">
<h1>the beginning</h1>
<br><br><br>
<ul class="contact">
<li><a href="https://github.com/rupl" rel="me">github.com/rupl</a>
<li><a href="https://twitter.com/rupl" rel="me">twitter.com/rupl</a>
<li><a href="https://chrisruppel.com" rel="me">chrisruppel.com</a>
<li>chris.ruppel ❀ gmail</li>
</ul>
</article>
</main>
<footer class="wrapper">
<span>Made with ❤ by</span>
<span><a href="https://chrisruppel.com/work/" rel="me">Chris Ruppel</a></span>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.3.min.js"><\/script>')</script>
<script src="js/main.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-432773-15', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>