/
index.html
253 lines (207 loc) · 8.74 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
Things I learnt on responsive and animation
by shiawuen
</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<!--
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/theme/beige.css">
<link rel="stylesheet" href="css/custom.css">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<script>
// If the query includes 'print-pdf' we'll use the PDF print sheet
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Used to fade in a background when a specific slide state is reached -->
<div class="state-background"></div>
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Things I learnt on <br /><span class="highlight">responsive</span> <br />and <br /><span class="highlight">animation</span></h1>
<p><i><small>
by <a href="https://twitter.com/shiawuen">shiawuen</a>
</small></i></p>
</section>
<section>
<h2><span class="highlight">Disclaimer</span></h2>
<p>
What I going to talk about are extracts from project I currently working on.
</p>
<p class="highlight">
IT MIGHT NOT WORK FOR YOUR CASE.
</p>
</section>
<section>
<h2 style="margin-top: 4em;">
<span class="highlight yellow" style="font-size: 4em">So</span>…
What do I learn?
</h2>
</section>
<section>
<section>
<h2 style="font-size: 2.5em;margin-top: 2.5em;">Use <span class="highlight">percentages</span>, not <span class="highlight">pixels</span></h2>
</section>
<section>
<h3>Why not pixels?</h3>
<p>
When your page resize, <span class="highlight">elements
will not stay at the same place</span> where it
should be.
</p>
<p>
Then you <span class="highlight">end up
reposition your elements</span>
using JavaScript (ninja!), plus
it don’t work well…
</p>
</section>
<section>
<h3>But you <span class="highlight">can’t use it all the time</span> right?</h3>
<p>YES, you still have to use JavaScript to <span class="highlight">manually set width and height for some elements</span>.</p>
</section>
<section>
<h3>Haha…seem you still need pixels!</h3>
<p>Yup, but this makes maintenance easier for me. =P</p>
</section>
</section>
<section>
<section>
<h2 style="margin-top: 2.25em;">
background-size is lovely,<br />
but <span class="highlight">IE hates it</span><br />
<small>(IE8 and below)</small>
</h2>
</section>
<section>
<h3>One size rule them all!</h3>
<p>
When <span class="highlight">size of elements</span> on page
<span class="highlight">depend on the width/height of the screen</span>,
you can easily have element position at correct position
and same proportions without using JavaScript.
</p>
</section>
</section>
<section>
<section>
<h2 style="margin-top: 3.25em;">
display: none <span class="highlight">hurts</span> <small>on iOS</small>
</h2>
</section>
<section>
<h3>It causes perf issue!</h3>
<blockquote>
<span class="highlight">Changing the display-state on iOS</span>
is like adding or removing an element to and
from the DOM and is therefor a very heady
calculation depending on how many items you
have in your DOM that can
<span class="highlight">easyly cause the UI to freeze for a second or more</span>.
</blockquote>
<p>
<small>
<a href="http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/">
iOS6 html hardware acceleration changes and how to fix them
</a> by Olaf
</small></p>
</section>
</section>
<section>
<section>
<h2 style="margin-top:2.25em;">
<span class="highlight">Overlap</span> hardware accelerated element
with
<span class="highlight">non-hardware accelerated</span> element
is not good
</h2>
</section>
<section>
<h3>How?</h3>
<img src="http://indiegamr.com/wp-content/uploads/ios6-performance-overlapping.png" alt="" />
<p>
<small>
<a href="http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/">
iOS6 html hardware acceleration changes and how to fix them
</a> by Olaf
</small></p>
</section>
</section>
<section>
<h2>Links</h2>
<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/CSS/background-size">
backgroud-size (mdn)
</a></li>
<li><a href="http://caniuse.com/#search=background-size">
background-size browser support
</a></li>
<li><a href="http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/">
iOS6 html hardware acceleration changes and how to fix them by Olaf
</a></li>
<li><a href="http://laurakalbag.com/display-none/">
display:none by Laura Kalbag
</a></li>
</ul>
</section>
<section>
<h2 style="margin-top:3em;">
<span class="highlight" style="font-size:4em;font-weight:800">
Thanks!
</span>
</h2>
</section>
<section>
<h2 style="margin-top:4em;"></h2>
<p><i><small>fin.</small></i></p>
</section>
</div>
<!-- The navigational controls UI -->
<aside class="controls">
<a class="left" href="#">◄</a>
<a class="right" href="#">►</a>
<a class="up" href="#">▲</a>
<a class="down" href="#">▼</a>
</aside>
<!-- Presentation progress bar -->
<div class="progress"><span></span></div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/linear(2d)
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/highlight.js', async: true, callback: function() { window.hljs.initHighlightingOnLoad(); } },
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'lib/js/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'lib/js/data-markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'socket.io/socket.io.js', async: true, condition: function() { return window.location.host === 'localhost:1947'; } },
{ src: 'plugin/speakernotes/client.js', async: true, condition: function() { return window.location.host === 'localhost:1947'; } },
]
});
</script>
</body>
</html>