This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path09.responsive.web.design.html
executable file
·884 lines (792 loc) · 34 KB
/
09.responsive.web.design.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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Web & Mobile Development — 09.Responsive.Web.Design</title>
<meta name="description" content="Web & Mobile Development — 09.Responsive.Web.Design">
<meta name="author" content="Bram(us) Van Damme - Davy De Winne - ikdoeict.be">
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/main.css" media="screen">
<link rel="stylesheet" href="css/print.css" media="print">
<link rel="stylesheet" href="assets/09/examples.css">
<link rel="stylesheet" href="lib/zenburn.css">
</head>
<body>
<div id="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- 0 : Title -->
<section>
<section>
<h3 class="inverted">Web & Mobile Development <small>JLW288</small></h3>
<h1>09.Responsive.<br />Web.Design</h1>
<footer>
<em><a href="http://www.ikdoeict.be/">ikdoeict.be</a> — <a href="mailto:[email protected]">[email protected]</a></em>
</footer>
<script>
// Delicously hacky. Look away.
if(navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/i))
document.write('<p style="color: rgba(0,0,0,0.3); text-shadow: none;">('+'Tap to navigate'+')</p>');
</script>
</section>
</section>
<!-- 1 : Intro -->
<section>
<section>
<h2>Responsive Web Design</h2>
<p><img src="assets/09/ascent-of-bot.png" alt="" title="" height="371" width="684" /></p>
<q>Hey, look! I found a robot fossil!</q>
</section>
<section>
<h2>Responsive Web Design?</h2>
<p style="text-align: center;">
<a href="http://speakerdeck.com/u/bytte/p/responsive-web-design-1"><img src="assets/09/9aeede98879911e180d51231380fcd7e_7.jpg" alt="" title="" height="406" width="406" /></a>
</p>
<footer>
Guest Lecture by <a href="http://www.twitter.com/bytte">Thomas Byttebier</a> <em><small style="vertical-align: baseline">(click image to view slides)</small></em>
</footer>
<!-- Works, but is the wrong version
<div style="width:510px; margin: 0 auto 0;" id="__ss_10389263">
<iframe src="http://www.slideshare.net/slideshow/embed_code/10389263" width="510" height="426" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div>
-->
<!-- Correct version, but flaky when embedding (and when going fullscreen)
<div style="width: 510px; height: 388px; margin: 0 auto 0;">
<script async class="speakerdeck-embed" data-id="4f8d3fce78ea60001f01565e" data-ratio="1.3333333333333333" src="//speakerdeck.comassets/embed.js"></script>
</div>
-->
</section>
<section>
<h2>Responsive Web Design</h2>
<blockquote>Responsive design refers to an approach in web design that provides an <strong style="font-size: 100%; color: inherit; background: none; font-family: inherit; border-bottom: 1px solid hsl(185, 85%, 50%);">optimal viewing experience</strong> across a wide range of screen resolutions and devices. This includes easy reading and navigation with a minimum of resizing, panning, and scrolling. This is accomplished using <strong style="font-size: 100%; color: inherit; background: none; font-family: inherit; border-bottom: 1px solid hsl(185, 85%, 50%);">the same codebase and content</strong>, instead of separate sites for different devices.</blockquote>
<p style="text-align: right; width: 85%;"><small><em>— <a href="http://viget.com/advance/responsive-design-an-overview">Responsive Design, An Overview</a></em></small></p>
</section>
</section>
<!-- 2 : Fluid Layouts -->
<section>
<section>
<h2>Practical: Fluid Layouts</h2>
<p><img src="assets/09/theprisonerofbenda.jpg" alt="" title="" height="376" width="640" /></p>
<q>I'm not sure. I'm afraid we need to use ... Math.</q>
</section>
<section>
<h2>Practical: Fluid Layouts</h2>
<ul>
<li class="fragment">
Two steps to converting a pixel based layout to a fluid one
<ol>
<li class="fragment">Convert the grid used to percentage based values</li>
<li class="fragment">Convert the font-sizes used to em based values</li>
</ol>
</li>
<li class="fragment">
Magic formula: <code>target / context = result</code>
</li>
</ul>
</section>
<section>
<h2>Flexible Grid (1)</h2>
<ul>
<li class="fragment">
Let's start from this basic, pixel based, grid
<p>
<figure style="margin: 0 auto 0; width: 720px; display: block;">
<img src="assets/09/examples/01a.jpg" height="360" width="720" alt="Our basic grid" title="Our basic grid" />
<figcaption>Our basic grid</figcaption>
</figure>
</p>
</li>
</ul>
</section>
<section>
<h2>Flexible Grid (2)</h2>
<ul>
<li class="fragment">
Code is pretty straightforward
<pre class="bigger"><code class="language-html dontrun" data-overlay-example="assets/09/examples/01a.html" data-overlay-width="1000" data-overlay-height="610"><div id="wrapper" class="clearfix" style="width: 960px;">
<section id="secondary" style="width: 320px; float: left;">
...
</section>
<section id="primary" style="width: 640px; float: left;">
...
<article style="width: 500px; float: left;">
...
</article>
<aside style="width: 140px; float: left;">
...
</aside>
</section>
</div></code></pre>
</li>
</ul>
</section>
<section>
<h2>Flexible Grid (3)</h2>
<ul>
<li class="fragment">
Conversion to percentages via our magic formula <code style="white-space: nowrap">target / context = result</code>
<ul>
<li class="fragment">
<code>#secondary</code>
<ul>
<li class="fragment"><code>target</code> = width the box should be = 320px</li>
<li class="fragment"><code>context</code> = width of its parent <code>#sitewrapper</code> = 960px</li>
<li class="fragment"><code>result</code> = 320px / 960px = 33.333333%</li>
</ul>
</li>
<li class="fragment">
<code>#primary</code>
<ul>
<li class="fragment"><code>target</code> = width the box should be = 640px</li>
<li class="fragment"><code>context</code> = width of its parent <code>#sitewrapper</code> = 960px</li>
<li class="fragment"><code>result</code> = 640px / 960px = 66.666667%</li>
</ul>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Flexible Grid (4)</h2>
<ul>
<li class="fragment">
Conversion to percentages via our magic formula <code style="white-space: nowrap">target / context = result</code>
<ul>
<li class="fragment">
<code>article</code>
<ul>
<li class="fragment"><code>target</code> = width the box should be = 500px</li>
<li class="fragment"><code>context</code> = width of its parent <code>#primary</code> = 640px</li>
<li class="fragment"><code>result</code> = 500px / 640px = 78.125%</li>
</ul>
</li>
<li class="fragment">
<code>aside</code>
<ul>
<li class="fragment"><code>target</code> = width the box should be = 140px</li>
<li class="fragment"><code>context</code> = width of its parent <code>#primary</code> = 640px</li>
<li class="fragment"><code>result</code> = 140px / 640px = 21.875%</li>
</ul>
</li>
</ul>
</li>
<li class="fragment">
Finally, change the <code>width</code> of the <code>#wrapper</code> to <code>max-width</code>
</li>
</ul>
</section>
<section>
<h2>Flexible Grid (5)</h2>
<ul>
<li class="fragment">
Resulting code
<pre class="bigger"><code class="language-html dontrun" data-overlay-example="assets/09/examples/01c.html" data-overlay-width="1000" data-overlay-height="610"><div id="wrapper" class="clearfix" style="max-width: 960px;">
<section id="secondary" style="width: 33.333333%; float: left;">
...
</section>
<section id="primary" style="width: 66.666667%; float: left;">
...
<article style="width: 78.125%; float: left;">
...
</article>
<aside style="width: 21.875%; float: left;">
...
</aside>
</section>
</div></code></pre>
</li>
</ul>
<footer class="fragment"><em>Note that the wrapper still has it width set in pixels. This is allowed. For now.</em></footer>
</section>
<section>
<h2>Flexible Grid (6)</h2>
<ul>
<li class="fragment">
Other horizontal values such as margins and paddings are converted like you'd convert the width
<ul>
<li><code>target</code> = target padding/margin you want</li>
<li><code>context</code> = width of the parent</li>
</ul>
</li>
<li class="fragment">
Converting vertical values of the grid are a tad tricky, as percentages don't work
<ul>
<li>Use <code>em</code> for those instead</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Flexible Font Sizes (1)</h2>
<ul>
<li class="fragment">Setting the <code>font-size</code> to an <code>em</code>-based value will allow fluid font-sizes
<ul>
<li class="fragment">An <code>em</code> is a relative unit
<li class="fragment"><code>1em</code> = the font-size of the current context</li>
<li class="fragment">By default the context is the <code><body></code>, which defaults to 16px</li>
</ul>
</li>
<li class="fragment">
Let's take this example
<pre class="bigger"><code class="language-html dontrun" data-overlay-example="assets/09/examples/02a.html"><h1 style="font-size: 28px;">This is a test <small style="font-size: 16px;">and only a test</small></h1>
<p style="font-size: 13px;">I'm not kidding!</p></pre></code>
</li>
</ul>
</section>
<section>
<h2>Flexible Font Sizes (2)</h2>
<ul>
<li class="fragment">
Conversion to percentages via our magic formula <code style="white-space: nowrap">target / context = result</code>
<ul>
<li class="fragment">
<code>h1</code>
<ul>
<li class="fragment"><code>target</code> = the font-size it should be = 28px</li>
<li class="fragment"><code>context</code> = the font-size of its parent, <code>body</code> = 16px</li>
<li class="fragment"><code>result</code> = 28px / 16px = 1.75em</li>
</ul>
</li>
<li class="fragment">
<code>p</code>
<ul>
<li class="fragment"><code>target</code> = the font-size it should be = 13px</li>
<li class="fragment"><code>context</code> = the font-size of its parent, <code>body</code> = 16px</li>
<li class="fragment"><code>result</code> = 13px / 16px = 0.8125em</li>
</ul>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Flexible Font Sizes (3)</h2>
<ul>
<li class="fragment">
Conversion to percentages via our magic formula <code style="white-space: nowrap">target / context = result</code>
<ul>
<li class="fragment">
<code>small</code>
<ul>
<li class="fragment"><code>target</code> = the font-size it should be = 16px</li>
<li class="fragment"><code>context</code> = the font-size of its parent, <code>h1</code> = 28px</li>
<li class="fragment"><code>result</code> = 16px / 28px = 0.571428571em</li>
</ul>
</li>
<li class="fragment">
Resulting code
<pre class="bigger"><code class="language-html dontrun" data-overlay-example="assets/09/examples/02b.html"><h1 style="font-size: 1.75em;">This is a test <small style="font-size: 0.571428571em;">and only a test</small></h1>
<p style="font-size: 0.8125em;">I'm not kidding!</p></pre></code>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Closing Notes / Tips</h2>
<ul>
<li class="fragment">
Don't round the values that you've calculated.
<ul>
<li>0.5em is not the same as 0.571428571em!</li>
</ul>
</li>
<li class="fragment">
Set the (max-)width of the wrapper in <code>em</code> too
</li>
<li class="fragment">
When working with border use <code>box-sizing: border-box;</code> to adjust the box model being used
<ul>
<li>
That way <a href="http://css-tricks.com/box-sizing/">the rendered width will be the CSS <code>width</code> you specify</a>; the padding and border won't be added to it
<div style="text-align: center;">
<img src="assets/09/widthbox.png" alt="" title="" height="100" width="" class="zoom" />
</div>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Do I really need this em stuff?</h2>
<ul>
<li class="fragment">Yes! It allows one to easily scale up/down a site: just adjust the <code>font-size</code> of the <code><body></code> and everything else will scape/up down with it!</li>
</ul>
<p class="fragment" style="-webkit-transform: rotate(2deg);"><img src="assets/09/obama-not-bad.png" width="447" alt="What I think of it" class="noborder"></p>
</section>
</section>
<!-- 3 : Media Queries -->
<section>
<section>
<h2>Practical: Media Queries</h2>
<p><img src="assets/09/brainslug.jpg" alt="" title="" height="393" width="500" /></p>
<q>The flight had a stopover on the Brain Slug Planet. Hermes liked it so much he decided to stay of his own free will.</q>
</section>
<section>
<h2>The “problem” with fluid</h2>
<ul>
<li class="fragment">Fluid grids/font-sizes alone won't save you
<ul>
<li>
When the viewport becomes too narrow, it will look crappy
</li>
</ul>
</li>
<li class="fragment">
Need to change the layout when necesarry
<ul>
<li>
Enter, stage left: <a href="http://www.w3.org/TR/css3-mediaqueries/">CSS Media Queries</a>!
</li>
</ul>
</li>
</ul>
<p>
<figure class="fragment">
<img src="assets/09/onextrapixel-fluid.jpg" alt="" title="" height="250" />
<figcaption>Fluid (<a href="http://www.onextrapixel.com/2012/04/23/responsive-web-design-layouts-and-media-queries/">source</a>)</figcaption>
</figure>
<figure class="fragment">
<img src="assets/09/onextrapixel-responsive.jpg" alt="" title="" height="250" />
<figcaption>Responsive (<a href="http://www.onextrapixel.com/2012/04/23/responsive-web-design-layouts-and-media-queries/">source</a>)</figcaption>
</figure>
</p>
</section>
<section>
<h2>Plan Ahead (1)</h2>
<ul>
<li class="fragment">
Stop & think! Don't jump into your CSS editor and start coding but plan ahead.
</li>
<li class="fragment">
Make sketches, or a prototype at the various widths
<div style="width: 538px; margin: 12px auto 0;">
<figure>
<img src="assets/09/sketch.jpg" alt="" title="" height="300" width="538" />
<figcaption>Image by <a href="http://www.webdesignerdepot.com/2012/02/designing-for-responsiveness/">Webdesigner Depot</a></figcaption>
</figure>
</div>
</li>
</ul>
</section>
<section>
<h2>Plan Ahead (2)</h2>
<ul>
<li class="fragment">
Be inspired by sites such as <a href="http://mediaqueri.es/">Mediaqueri.es</a>
<p style="text-align: center;">
<img src="assets/09/tumblr_lw8s7e8KPT1qlg7tzo1_500.png" alt="" title="" width="262" height="500" />
</p>
</li>
</ul>
</section>
<section>
<h2>Think Mobile First & Focus</h2>
<ul>
<li class="fragment">
Layouting the mobile view of the site first forces you to focus on what really matters: <strong>the content</strong>
<p style="text-align: center;">
<img src="assets/09/focus.jpg" alt="" title="" width="472" height="300" />
</p>
</li>
</ul>
<footer class="fragment"><em>Personally, I first design not the smallest layout, but the second smallest one</em></footer>
</section>
<section>
<h2>Implement Mobile First & scale up (1)</h2>
<ul>
<li class="fragment">
Slice and code the smallest layout you've created,<br />then augment upwards
<pre class="bigger"><code class="language-css dontrun">/* General CSS (fonts, colors, etc) + Mobile First Layout */
html { ... }
body { ... }
h1 { ... }
header { ... }
section#main { ... }
/* From 360 pixels width and up */
@media (min-width: 360px) {
/* note: all styles above will be inherited! */
h1 { ... }
section#main { ... }
}</code></pre>
</li>
</ul>
</section>
<section>
<h2>Implement Mobile First & scale up (2)</h2>
<ul>
<li class="fragment">
Actually, define your media query <code>min-width</code> in <code>em</code> <small>(<a href="http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/">src</a>)</small>
<pre class="bigger"><code class="language-css dontrun">/* General CSS (fonts, colors, etc) + Mobile First Layout */
html { ... }
body { ... }
h1 { ... }
header { ... }
section#main { ... }
/* From 360 pixels width and up */
@media (min-width: 22.5em) {
/* note: all styles above will be inherited! */
h1 { ... }
section#main { ... }
}</code></pre>
</li>
</ul>
</section>
<section>
<h2>Implement Mobile First & scale up (3)</h2>
<ul>
<li class="fragment">
Include <a href="https://github.com/scottjehl/Respond">respond.js</a> on your page to make oldIE interpret the rules
<pre class="bigger"><code class="language-html dontrun" style="white-space: nowrap; overflow: scroll;"><!--[if (lt IE 9) & (!IEMobile)]><script src="js/respond.min.js"></script><![endif]--></code></pre>
</li>
<li class="fragment">
Include a <code>viewport</code> metatag to let mobile browsers properly render the site
<pre class="bigger"><code class="language-html dontrun"><meta name="viewport" content="width=device-width, initial-scale=1.0" /></code></pre>
</li>
</ul>
</section>
<section>
<h2>When to apply a different layout?</h2>
<ul>
<li class="fragment">
<strong>Don't</strong> use device breakpoints such as 320, 480, 768, etc.
<ul>
<li class="fragment">Devices will change.</li>
<li class="fragment">Screen-sizes vary, a lot: <a href="http://stephanierieger.com/the-trouble-with-android/">The trouble with Android</a></li>
</ul>
</li>
<li class="fragment">
Do set breakpoints when the layout becomes awkward or unusable
<ul>
<li class="fragment">
e.g. column becomes too narrow
</li>
<li class="fragment">
You'll be doing this stuff a lot
<p style="text-align: center;"><img src="assets/09/YkbaV.gif" width="250" /></p>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>What to change?</h2>
<ul>
<li class="fragment">
Font-sizes
<ul>
<li>Change the basic <code>font-size</code> of <code>body</code> and the <code>em</code>s will do their work</li>
</ul>
</li>
<li class="fragment">
Positioning of the main boxes/containers
<ul>
<li>Next to each other → Underneath each other</li>
</ul>
</li>
<li class="fragment">
Place text into <a href="http://www.quirksmode.org/css/multicolumn.html">CSS3 columns</a>
</li>
<li class="fragment">
Visibility of items
<ul>
<li>Beware though, RWD is not only <code>display: none;</code></li>
</ul>
</li>
<li class="fragment">
Navigation is quite tricky
<ul>
<li>Use one of the <a href="http://bradfrostweb.com/blog/web/responsive-nav-patterns/">Responsive Navigation Patterns</a></li>
</ul>
</li>
<li class="fragment">
Static elements vs. Interactive Elements
<ul>
<li>eg. small screen device: image of a map</li>
<li>eg. big screen device: interactive Google Maps interface</li>
</ul>
</li>
</ul>
</section>
</section>
<!-- 4 : Fluid Media -->
<section>
<section>
<h2>Practical: Fluid Media</h2>
<p><img src="assets/09/mythreesuns.png" alt="" title="" height="384" width="512" /></p>
<q>Please Don't Drink The Emperor!</q>
</section>
<section>
<h2>Fluid Images (1)</h2>
<ul>
<li class="fragment">
Prevent images from bleeding out of their fluid wrapper by limiting its <code>max-width</code> to <code>100%</code>
<pre class="bigger"><code class="language-css dontrun" data-overlay-example="assets/09/examples/03.html" data-overlay-width="500" data-overlay-height="300">img {
max-width: 100%;
_width: 100%; /* fix for IE6 who doesn't understand max-width */
}</code></pre>
</li>
</ul>
<footer class="fragment">The example launched has a limited width, and the image will be resized by the <code>max-width</code></footer>
</section>
<section>
<h2>Fluid Images (2)</h2>
<ul>
<li class="fragment">
Resizing imgs in the browser isn't bandwidth friendly
<ul>
<li class="fragment">
Some hacky solutions exist <a href="http://blog.cloudfour.com/responsive-imgs-part-2/">(list)</a>
<ul>
<li><code>.htaccess</code> redirect + resize script: <a href="http://adaptive-images.com/">Adaptive Images</a>, <a href="https://github.com/filamentgroup/Responsive-Images">Responsive-Images JS</a>, etc.</li>
<li>Define bigger image as URL part or via data attribute: <a href="https://github.com/joshje/Responsive-Enhance">Responsive Enhance</a>, etc.</li>
</ul>
</li>
<li class="fragment">
The solutions above basically scale down the images on the fly. Most of the time it's better to have a resized + cropped version though
<p style="text-align: center;"><img src="assets/09/difimages.jpg" width="600" /></p>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Fluid Images (2)</h2>
<ul>
<li class="fragment">
Resizing imgs in the browser isn't bandwidth friendly <em>(continued)</em>
<ul>
<li class="fragment">
A <a href="http://www.w3.org/community/respimg/">W3C community group</a> is pondering how to properly fix it:
<pre class="bigger"><code class="language-html dontrun"><picture alt="A giant stone face at The Bayon temple in Cambodia">
<source src="small.jpg">
<source src="medium.jpg" media="(min-width: 400px)">
<source src="large.jpg" media="(min-width: 800px)">
<noscript><img src="small.jpg" alt="..."></noscript>
</picture></code></pre>
</li>
<li class="fragment">Although not standarized <em>yet</em>, a polyfill <a href="https://github.com/scottjehl/picturefill">already exists</a>!</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Fluid Images (3)</h2>
<ul>
<li class="fragment">
Problem: Mobile != small bandwidth
<ul>
<li class="fragment">It's not because I am visiting a site on my mobile phone that I am on the road</li>
<li class="fragment">I can be connected over wifi</li>
<li class="fragment">I can be at home in my couch</li>
<li class="fragment">...</li>
</ul>
</li>
<li class="fragment">
The current proposal is lacking, one also needs to take connection speed into account
<ul>
<li class="fragment">The Community group is aware of this</li>
<li class="fragment">
Some JavaScript based solutions already exist
<ul>
<li><a href="https://github.com/nathanford/pngy">Pngy</a></li>
<li><a href="https://github.com/adamdbradley/foresight.js">foresight.js</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Fluid Video</h2>
<ul>
<li class="fragment">
Same trick as for images works
<pre class="bigger"><code class="language-css dontrun">video, embed, object {
max-width: 100%;
_width: 100%; /* fix for IE6 who doesn't understand max-width */
}</code></pre>
</li>
<li class="fragment">
Use of <a href="http://fitvidsjs.com/">fitvids.js</a> is recommended, as it uses <a href="http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/">intrinsic ratios</a>.
</li>
</ul>
</section>
</section>
<!-- 5 : Tools -->
<section>
<section>
<h2>Practical: Tools</h2>
<p><img src="assets/09/smelloscope.png" alt="" title="" height="390" width="519" /></p>
<q>The Smell-O-Scope is brilliant, I tell you!</q>
</section>
<section>
<h2>Easily test your layouts</h2>
<p class="fragment" style="text-align: center;"><img src="assets/09/resizer.jpg" width="" height="400" alt="" title="" style="background: transparent; border: 0; -webkit-box-shadow: none; -moz-box-shadow: none; -ms-box-shadow: none; -o-box-shadow: none; box-shadow: none;" /></p>
<footer class="fragment"><a href="http://codebomber.com/jquery/resizer/">Resizer Bookmarklet / Chrome Extension</a></footer>
</section>
<section>
<h2>Test your layouts all at once</h2>
<p class="fragment" style="text-align: center;"><img src="assets/09/allatonce.png" width="" height="487" alt="" title="" style="background: transparent; border: 0; -webkit-box-shadow: none; -moz-box-shadow: none; -ms-box-shadow: none; -o-box-shadow: none; box-shadow: none;" /></p>
<footer class="fragment"><a href="http://mattkersley.com/responsive/">Responsive Design Testing</a></footer>
</section>
<section>
<h2>Find that tricky breakpoint</h2>
<p class="fragment" style="text-align: center;"><img src="assets/09/responsivepx.png" width="" height="487" alt="" title="" style="background: transparent; border: 0; -webkit-box-shadow: none; -moz-box-shadow: none; -ms-box-shadow: none; -o-box-shadow: none; box-shadow: none;" /></p>
<footer class="fragment"><a href="http://responsivepx.com/">ResponsivePX</a></footer>
</section>
<section>
<h2>Test all mobile devices at once</h2>
<p class="fragment" style="text-align: center;"><img src="assets/09/shadow.png" width="560" height="316" alt="" title="" /></p>
<footer class="fragment"><a href="http://html.adobe.com/edge/inspect/">Adobe Edge Inspect</a></footer>
</section>
</section>
<!-- 7 : Final Note -->
<section>
<section>
<h2>Final Notes</h2>
<p><img src="assets/09/preacherbot.png" alt="" title="" height="390" width="520" /></p>
<q>Do you, Leela, copy and paste his response<br />till death do you part?</q>
</section>
<section>
<h2>Solid foundations</h2>
<ul>
<li class="fragment">
Structured and good HTML is a prerequisite before doing anything with CSS.
</li>
</ul>
</section>
<section>
<h2>Future Friendly</h2>
<ul>
<li class="fragment">
We can't predict the future. Things will change
<ul>
<li>New devices</li>
<li>New ways to accessing information</li>
<li>...</li>
</ul>
</li>
<li class="fragment">
Don't code for the proprietary solutions that exist now, but keep the future in mind, be <a href="http://futurefriend.ly/">future friendly</a>
<ul>
<li class="fragment">Create meaningful content and services; Focus!</li>
<li class="fragment">Define your data in way that it's interoperable and can exist later on</li>
<li class="fragment">Structure and store your content so that it can be read by anyone, on any device, any time, in different contexts</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>There is no mobile web</h2>
<div style="margin: 160px auto 0; width: 700px;" class="fragment">
<q>There is no Mobile Web. There is only The Web, which we view in different ways. There is also no Desktop Web. Or Tablet Web.</q>
<p style="text-align: right; margin-top: 40px;"><small>— <a href="http://www.the-haystack.com/2011/01/07/there-is-no-mobile-web/">Stephen Hay</a></small></p>
</div>
</section>
<section>
<h2>Embrace the medium</h2>
<div style="margin: 160px auto 0; width: 700px;" class="fragment">
<q>If you just make an HTML-Document and you put it on the Web it’s already responsive.</q>
<p style="text-align: right; margin-top: 40px;"><small>— Jeremy Keith</small></p>
</div>
</section>
<section>
<h2>No Silver Bullets (1)</h2>
<ul>
<li class="fragment">
Again <small><a href="08.misc.topics.html#/15">⚑</a></small>:
<div style="margin: 130px auto 0; width: 700px;">
<q>If you're looking for the more honest, truthful answer to pretty much any question on web design and usability, here it is: It depends.</q>
<p style="text-align: right; margin-top: 40px;"><small>— <a href="http://adactio.com/journal/4437/">Jeremy Keith</a></small></p>
</div>
</li>
</ul>
</section>
<section>
<h2>No Silver Bullets (2)</h2>
<ul>
<li class="fragment">RWD is not the answer to everything.
<li class="fragment">
In some cases, you'll need a combination of techniques, a variant or an alternative
<ul>
<li class="fragment">eg. <a href="http://www.lukew.com/ff/entry.asp?1392">RESS: Responsive Design + Server Side Components</a>
<ul>
<li>Selectively deliver lightweight versions of some parts of your site to mobile devices</li>
</ul>
</li>
<li class="fragment">eg. <a href="http://www.html5rocks.com/en/mobile/cross-device/">MVC with Form-Factor Specific Views</a></li>
</ul>
</li>
<li class="fragment">
In some cases you <strong>will need</strong> a separate app/website
<ul>
<li>Use <a href="http://cennydd.co.uk/2013/the-gradient-chart">The Gradient Chart</a> to decide</li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Recommended Reading</h2>
<p><a href="http://www.abookapart.com/products/mobile-first-responsive-web-design-bundle"><img src="assets/09/feature-bundle-6-4.jpg" alt="" title="" height="294" width="640" /></a></p>
<p style="text-align: center;"><a href="http://www.abookapart.com/products/mobile-first-responsive-web-design-bundle">Responsive Web Design & Mobile First <em>(A Book Apart)</em></a></p>
</section>
<section>
<h2>Recommended online material</h2>
<ul>
<li><a href="http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu">Rethinking the Mobile Web</a></li>
<li><a href="http://globalmoxie.com/jhc/prez/mobile-context-myth-fowd.pdf">The Myths of Mobile Context</a></li>
<li><a href="http://www.slideshare.net/bradfrostweb/for-a-futurefriendly-web">For a Future Friendly Web</a></li>
<li><a href="http://mobilewebbestpractices.com/">Mobile Web Best Pratices</a></li>
<li><a href="http://speakerdeck.com/u/malarkey/p/fashionably-flexible-responsive-web-design-full-day-workshop-1">Fashionably flexible responsive web design</a></li>
</ul>
</section>
</section>
<!-- The END -->
<section>
<section>
<h2>Questions?</h2>
<footer>
<em><a href="http://www.ikdoeict.be/">ikdoeict.be</a> — <a href="mailto:[email protected]">[email protected]</a></em>
</footer>
</section>
</section>
<!-- Sources -->
<!--
<section id="sources">
<section>
<h2>Sources</h2>
<ul>
<li></li>
</ul>
</section>
</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>
<span id="revealIndex">/</span>
</aside>
<!-- Index Link -->
<aside class="back">
<a href="index.html">← Back to index</a>
</aside>
<!-- ikdoeict.be Link -->
<a href="http://www.ikdoeict.be/" title="ikdoeict.be" id="ikdoeict">ikdoeict.be</a>
<!-- Displays presentation progress, max value changes via JS to reflect # of slides -->
<div class="progress"><span></span></div>
</div>
<script src="js/reveal.js"></script>
<script src="lib/highlight.js"></script>
<script src="lib/prefixfree.js"></script>
<script src="lib/css-snippets.js"></script>
<script src="lib/css-edit.js"></script>
<script src="lib/incrementable.js"></script>
<script src="js/main.js"></script>
</body>
</html>