forked from leeanndrees/gdi-responsive
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
1000 lines (889 loc) · 39 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
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
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Responsive Design Workshop ~ Girl Develop It</title>
<meta name="description" content="Girl Develop It framework for easily creating beautiful presentations using HTML in GDI theme. Forked from Hakim El Hattab's reveal.js">
<meta name="author" content="Girl Develop It">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/simple.css" id="theme">
<!-- For syntax highlighting -->
<!-- light editor<link rel="stylesheet" href="lib/css/light.css">-->
<!-- dark editor--><link rel="stylesheet" href="lib/css/dark.css">
<link rel="stylesheet" href="lib/css/zenburn.css">
<link rel="stylesheet" href="plugin/accessibility-helper/css/accessibility-helper.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!-- If use the PDF print sheet so students can print slides-->
<link rel="stylesheet" href="css/print/pdf.css" type="text/css" media="print">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- Opening slide -->
<section>
<h2>Responsive Web Design Workshop</h2>
<img src="images/circle-gdi-logo.png" alt="GDI logo" width="300">
</section>
<!-- Class Prep -->
<section>
<h3>Set up your computer for today</h3>
<p>Follow along with the slides at: <br>
<a href="http://gdila.github.io/gdi-responsive">gdila.github.io/gdi-responsive</a>
</p>
<hr>
<p>
<a href="http://gdila.github.io/gdi-responsive/intro-rwd-exercises.zip">Download the zip of files for class</a>
</p>
<p>Unzip the file to your desktop.</p>
</section>
<!-- Introductions -->
<section>
<h3>Introductions</h3>
<ul>
<li>What's your name?</li>
<li>What do you hope to get out of class today?</li>
<li>What is your favorite animal?</li>
</ul>
</section>
<!-- Why do we need responsive? -->
<section>
<h3>Bad user experiences are sad.</h3>
<img src="images/sad.png" width="500"/>
</section>
<!-- Responsive is good -->
<section>
<h3>Responsive Design gets it.</h3>
<p>And it's here to make things right.</p>
<p><img src="images/ok.jpg" width="600"></p>
</section>
<!-- Goals for today -->
<section>
<h3>Today we will:</h3>
<ul>
<li>Make things right by “responsivising” a fixed-width website</li>
<li>Do math and like it :-)</li>
<li>Explore frameworks and design tools that help us plan for responsive</li>
<li>Learn some best practices</li>
</ul>
</section>
<!-- What is responsive? -->
<section>
<h3>What exactly is Responsive Design?</h3>
<p style="text-align: left;">Responsive Design is the practice of designing and developing websites that allow the user to enjoy its features no matter what device they're viewing it on.</p>
<img src = "images/cute.png" width="300">
</section>
<!-- Responsive Design Roots -->
<section>
<h3>Responsive's roots</h3>
<p style="text-align: left;">Responsive Web Design was first coined by Ethan Marcotte in the <span class="pretty"><a href="http://alistapart.com/article/responsive-web-design" target="_blank">May 2010 issue of A List Apart</a></span>.</p>
<p style="text-align: left;">He also wrote this <a href="http://www.abookapart.com/products/responsive-web-design" target="_blank">very nice book</a> and owns the website <a href="http://responsivewebdesign.com/" target="_blank">Responsivewebdesign.com</a>, which are both excellent resources.</p>
<img src = "images/alistapart.png" width="500"/>
</section>
<!-- Why does responsive matter? -->
<section>
<h3>Why does Responsive matter?</h3>
<ul>
<li class="fragment">There are 1.75 Billion smartphone users worldwide.</li>
<li class="fragment">91% of smartphone users in the U.S. have their smart phone within reach 24/7.</li>
<li class="fragment">And many of them are checking their phones an average of 150x every day.</li>
<li class="fragment">25% of smartphone users in the U.S. don't even own a laptop or desktop computer.</li>
</ul>
</section>
<!-- And because...-->
<section>
<h3>And because…</h3>
<ul>
<li class="fragment">Mobile web usage will surpass desktop internet usage by 2015.<br/>
<span class="fragment">So…that's already happened!</span>
</li>
<li class="fragment">Our phones ARE our computers.</li>
</ul>
</section>
<!-- Test your favorite website -->
<section>
<h3>Is your favorite website responsive?</h3>
<p>You can enter the URL here: <a href="http://www.responsinator.com/?url=http%3A%2F%2Fmilkbarstore.com%2F" target="_blank">http://www.responsinator.com</a></p>
<img src="images/milk.png" width="700"/>
<small>(or pull it up on your mobile device for a more accurate view!)</small>
</section>
<!-- How many devices do we have to consider? -->
<section>
<h3>A few devices to consider</h3>
<img src = "images/android-devices.png" width="700px"><p style="font-size: .75em;">(these are just Android phone, tablets, phablets. There are lots more!</p>
</section>
<!-- Scream -->
<section>
<h3>Right?</h3>
<img src = "images/scream.jpg" width="300px">
</section>
<!-- Responsive is the solution -->
<section>
<h3>Responsive is our solution for this madness</h3>
<p>The magic is achieved with these 3 ingredients:</p>
<ol>
<li>fluid grids</li>
<li>flexible images</li>
<li>CSS3 media queries</li>
</ol>
</section>
<!-- Fluid grids -->
<section>
<h3>1. Fluid Grids</h3>
<p style="text-align: left;">First we define a width for our grid's container.</p>
<p style="text-align: left;">We divide the content up into a set of columns, usually 12.</p>
<p style="text-align: left;">Then we design elements that can scale in size. Instead of assigning a specific pixel dimension, we use percentages.</p>
<p style="text-align: left;">Whenever the device width changes, the grids change in width to scale with the device.</p>
<img src = "images/grid-cols.png" width="840"/>
</section>
<!-- Flexible Images -->
<section>
<h3>2. Flexible Images</h3>
<p style="text-align: left;">Here are some examples:</p>
<ul>
<li><code>max-width</code></li>
<li><a href="https://css-tricks.com/using-svg/" target="_blank">SVG (scalable vector graphics)</a></li>
<li><a href="https://icomoon.io/#icon-font" target="_blank">icon fonts</a></li>
<li><code>srcset</code>- list multiple image files</li>
<li><code>sizes</code>- give the browser multiple possible widths with media conditions</li>
<li><code>picture</code>- gives us more control over when different sources are used</li>
<li><code>source</code>- used to define sources for a picture element</li>
</ul>
</section>
<!-- Flexible images again -->
<section>
<h3>2. Flexible Images</h3>
<p style="text-align: left;">We could have an entire workshop just on flexible images alone!</p>
<p style="text-align: left;">So, we won't be discussing all of those options tonight, but <a href="http://alistapart.com/article/responsive-images-in-practice" target="_blank">this article</a> does a great job of detailing them.</p>
<img src = "images/practice.png" width="600"/>
</section>
<!-- Max-width -->
<section>
<h3>2. Flexible Images: <code>max-width</code></h3>
<p>For now, we'll be using <code>max-width</code>.</p>
<pre><code contenteditable class="css">img {
max-width: 100%;
}</code></pre>
</section>
<!-- Flexible images -->
<section>
<h3>2. Flexible Images: <code>max-width</code></h3>
<p style="text-align: left;">Unlike text, which scales easily on smaller devices, images can be a bit tricky.</p>
<p style="text-align: left;">Unless we give them a <code>max-width</code>, images will overflow their container elements if they're too big for them.</p>
<img src = "images/if-i-fits-i-sits.jpg" width="450"/>
</section>
<!-- Flexible images -->
<section>
<h3>2. Flexible Images: <code>max-width</code></h3>
<p style="text-align: left;">By assigning a <code>max-width</code> to images, they'll only expand to the size of their parent.</p>
<p style="text-align: left;">If their parent has no width (which it probably does), it'll just expand to the width of the viewport.</p>
<img src = "images/if_it_fits_i_sits_16.jpg" width="450"/>
</section>
<!-- Media Queries -->
<section>
<h3>3. CSS3 Media Queries</h3>
<p style="text-align: left;">CSS3 media queries let us assign breakpoints that correspond to the pixel width of your desktop monitor, tablet, e-reader, or phone display.</p>
<p style="text-align: left;">These breakpoints tell the content what to do when the display (or viewport) falls within these widths.</p>
<img src = "images/responsivedesign1.jpg" width="800"/>
</section>
<!-- Stuff & Nonsense Example -->
<section>
<h3>A Clever Example of Media Queries</h3>
<p><a href="http://stuffandnonsense.co.uk/" target="_blank">http://stuffandnonsense.co.uk</a></p>
<img src = "images/stuff-and-nonsense.jpg" width="600"/>
</section>
<!-- Open First Exercise -->
<section>
<h3>Let's take a peek at some awesomeness</h3>
<p style="text-align: left;">Let's go to our Exercise folder, find the <code>_MediaQueryMagic</code> folder, and open <code>awesomeness.html</code> in our browser.</p>
<img src = "images/magic.png" width="420"/>
<p style="text-align: left;">Then let's go to our <code>styles</code> folder and open <code>styles.css</code> in Sublime Text.</p>
<img src = "images/magic2.png" width="330"/>
</section>
<!-- Test breakpoints -->
<section>
<h3>Let's take a peek at some awesomeness</h3>
<p style="text-align: left;">We can see the breakpoints and styles assigned to this page in our media queries as we narrow our browser window.</p>
<img src = "images/ss.png" width="630"/>
<img src = "images/ss2.png" width="430"/>
<img src = "images/ss3.png" width="230"/>
</section>
<!-- Open Second Exercise -->
<section>
<h3>The website we'll be working with next</h3>
<p>Let's open <code>working.html</code> in our browser.</p>
<div class="left" width="500">
<img src = "images/baby-animals.png" width="500"/>
</div>
<div class="right">
<img src = "images/exercises-1.png" width="330"/>
</div>
</section>
<!-- Not responsive -->
<section>
<h3>Not Responsive :-(</h3>
<p>What if we don't want to start all over and make a totally new responsive site? We just want to make the <em>existing</em> site responsive.</p>
<img src="images/not.png" width="300"/>
</section>
<!-- Make it responsive -->
<section>
<h3>Making it Responsive</h3>
<p style="text-align: left;">We can totally make the following adjustments and get this site looking lovely on a mobile device:</p>
<ul>
<li>change up our font units</li>
<li>make the existing grid fluid</li>
<li>add CSS3 media queries</li>
</ul>
<p style="text-align: left; padding-top: 25px;">This will suit our needs because our site is small and manageable. But if you're starting a shiny new project, we'll explore some other options in a bit.</p>
</section>
<!-- Responsive Typography -->
<section>
<h3>Making it Responsive: Typography</h3>
<p>Once upon a time, in 2005, type was always set in <code class="pretty">px</code>.</p>
<p>But today we need to account for our billions of devices and a range of pixel densities. So, we use more flexible units for setting our type, like <code class="pretty">em</code>s or <code class="pretty">rem</code>s.</p>
<p><a href="http://www.w3.org/WAI/GL/css2em.htm" target="_blank">Here's a good explanation of <code>em</code>s.</a></p>
<p><a href="http://snook.ca/archives/html_and_css/font-size-with-rem">Here's a good explanation of <code>rem</code>s.</a></p>
<p>Good to know: The browser default for fonts is <code class="pretty">16px</code>, which is <code class="pretty">1em</code> or <code class="pretty">1rem</code>.</p>
</section>
<!-- Typography -->
<section>
<h3>Making it Responsive: Typography</h3>
<p>We're going to use <code class="pretty">ems</code> today.</p>
<p>The first thing we need to do is change the font sizes from px to ems.</p>
<p>There's a handy formula for this:<br/><span class="pretty">target ÷ context = result</span></p><br/>
<p>So if we're converting 24px to ems,<br/>and 16px is the default size (context), we calculate:<br/><span class="pretty">24 (target) ÷ 16 (context) = 1.5 (result)</span></p><br/>
<p style="font-size: 1.0em;"><code class="pretty">24px</code> is <span class="pretty">1.5</span> times greater than <code class="pretty">16px</code>,<br/>so our font-size is <code class="pretty">1.5em</code>.</p>
</section>
<!-- Typography -->
<section>
<h3>Making it Responsive: Typography</h3>
<p>For times when you are not in the mood for math, we have <a href="http://pxtoem.com/" target="_blank">pxtoem.com</a></p>
<a href="http://pxtoem.com/" target="_blank"><img src="images/px-to-em.png" width="700"/></a>
</section>
<!-- Let's Develop It -->
<section>
<h3>Let's Develop It!</h3>
<p>Let's open <strong>styles.css</strong> in Sublime Text.</p>
<p>Find all of the font-sizes that have px and convert them to the correct em sizes.</p>
<img src = "images/workingstyles.png" width="330"/>
<p>Use the formula<br/><span class="pretty">target ÷ context = result</span></p>
<p>or use the <a href="http://pxtoem.com/" target="_blank">pxtoem.com</a> chart/calculator</p>
<p>We'll work through a few together…</p>
</section>
<!-- First change to ems -->
<section>
<h3>Making it Responsive: Typography</h3>
<p>So we can keep track of what we changed, let's comment out the original <code>px</code> font-sizes when we add in our newly calculated em sizes.</p>
<p>Here's our first conversion as an example. Let's convert the <code>h1</code> font-size:</p>
<pre><code contenteditable class="css">h1 {
color: #ffffff;
font-size: 2.25em; /* font-size: 36px */
font-style: italic;
font-weight: 800;
margin-bottom: 20px;
padding: 10x 0 0;
text-align: center;
}</code></pre>
</section>
<!-- Second change to ems -->
<section>
<h3>Making it Responsive: Typography</h3>
<p>Let's convert the <code>h2</code> font-size.</p>
<pre><code contenteditable class="css">h2 {
font-size: 1.6em; /* font-size: 25px */
font-style: italic;
margin: 0 0 10px 0;
}</code></pre>
<p>And the <code>.summary p</code> font-size.</p>
<pre><code contenteditable class="css">.summary p {
color: #d5ecf0;
font-size: 1em; /* font-size: 16px */
font-weight: normal;
padding: 10px 0;
}</code></pre>
</section>
<!-- Third change to ems -->
<section>
<h3>Making it Responsive: Typography</h3>
<p>And lastly let's convert the <code>aside p</code> and the <code>footer</code> font-sizes:</p>
<pre><code contenteditable class="css">aside p {
color: yellowgreen;
font-size: .875em; /* font-size: 14px */
font-weight: bold;
padding: 10px 20px;
text-align: left;
}
footer {
clear: both;
color: #60b9ce;
display: block;
font-size: .875em; /* font-size: 14px */
height: 35px;
margin-top: -35px;
padding-top: 120px;
text-align: center;
width: 900px;
}</code></pre>
</section>
<!-- Typography done -->
<section>
<h3>Wasn't that FUN?</h3>
<p>It wasn't <em>horrible</em>, at least our fonts are now flexible.</p>
<p>And now we have a reminder of why it's better to start off with <code>em</code>s right from the start.</p>
</section>
<!-- Fluid Grid -->
<section>
<h3>Making it Responsive: A Fluid Grid</h3>
<p>We still have fixed-width sizing on the structural containers (wrapper, nav, gallery, etc.).</p>
<p>By converting their pixel widths to percentages, we'll be another step closer.</p>
</section>
<!-- Fluid Grid Calculation -->
<section>
<h3>Making it Responsive:<br/>A Fluid Grid</h3>
<p>The same formula we used to convert fonts from <code>px</code> to <code>ems</code> can be used to convert pixel widths to percentages.</p>
<p class="pretty">target ÷ context = result</p>
<p>The wrapper around our content is <code class="pretty">900px</code> wide, that's our <em>target</em>. Let's say the layout was designed to be <code class="pretty">960px</code> wide, that's our <em>context</em>. To convert the wrapper to a percentage, we do the math.</p>
<p class="pretty">900 ÷ 960 = .09375</p>
<p>Move the decimal over two spots for the percentage.</p>
<p>Our <code class="pretty">900px</code> wrapper is now <code class="pretty">93.75%</code>.</p>
</section>
<!-- Skipping Math -->
<section>
<h3>Skipping the math.</h3>
<p>Since we have a lot of nested containers in our working site, and want to keep this moving, we're going to make some arbitrary conversions and not do all the math on each one.</p>
<p>We'll use some nice round numbers, which is just fine for our single-page site.</p>
</section>
<!-- Fluid Grid Calculation -->
<section>
<h3>Let's Develop It!</h3>
<p>Go back to <code>styles.css</code> and start identifying our fixed-width containers.</p>
<img src="images/workingstyles.png" width="330px"/>
<p>In order to keep track of what we changed, comment out the original pixel widths and replace them with percentages.</p>
<p>Let's do the first few together…</p>
</section>
<!-- Wrapper and Header -->
<section>
<h3>Wrapper & Header</h3>
<p>On <code>#wrapper</code> we should also change the <code>margin</code> from <code>px</code> to a percentage.</p>
<pre><code contenteditable class="css">#wrapper {
margin: 0 10%; /* margin: 0 auto */
width: 80%; /* width: 900px; */
}
header {
background: #004488;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
border-bottom: 3px solid lightblue;
height: auto;
margin: 0;
width: 100%; /* width: 900px; */
}</code></pre>
</section>
<!-- Navigation -->
<section>
<h3>Let's convert the <code>nav</code> and the <code>nav li</code> widths.</h3>
<pre><code contenteditable class="css">nav {
float: left;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
margin: 10px 0 50px;
text-align: left;
width: 70%; /* width: 700px */
}
nav li {
display: inline;
padding: 5px 20px 15px 0;
width: 100%; /* width: 900px; */
}</code></pre>
</section>
<!-- Social and Summary -->
<section>
<h3>Let's convert the <code>#social</code> and the <code>.summary</code> widths.</h3>
<pre><code contenteditable class="css">#social {
float: right;
margin: 20px 0 50px;
padding: 0;
text-align: right;
width: 30%; /* width: 200px */
}
.summary {
clear: both;
float: left;
padding: 5px 0 10px;
width: 100%; /* width: 900px */
}</code></pre>
</section>
<!-- Feature and Gallery -->
<section>
<h3>Let's convert the <code>#feature img</code> and the <code>#gallery</code> widths.</h3>
<pre><code contenteditable class="css">#feature img {
padding: 0;
width: 100%; /* width: 800px */
z-index: 0;
}
#gallery {
float: left;
margin: 0;
padding: 0;
width: 60%; /* width: 550px */
}</code></pre>
</section>
<!-- Thumbs Gallery -->
<section>
<h3>Let's convert the <code>#thumbs li</code>, <code>#thumbs li img</code>, and the <code>aside</code> widths.</h3>
<pre><code contenteditable class="css">#thumbs li {
float: left;
padding: 0 20px 20px 0;
width: 20%; /* width: 80px */
}
#thumbs li img {
width: 100%; /* width: 80px */
}
aside {
background: #004488;
float: right;
height: auto;
margin: 0;
padding: 0;
width: 40%; /* width:250px; */
}</code></pre>
</section>
<section>
<h3>Let's convert the <code>#footer</code> width and add a <code>max-width</code> to images.</h3>
<pre><code contenteditable class="css">footer {
clear: both;
color: #60b9ce;
display: block;
font-size: .875em; /* font-size: 14px */
height: 35px;
margin-top: -35px;
padding-top: 120px;
text-align: center;
width: 100%; /* width: 900px */
}
img {
max-width: 100%;
}</code></pre>
</section>
<!-- Look at the site! -->
<section>
<h3>Check out your site now!</h3>
<p>Do things look better? <br/>Let's take some time to get things right before we move on.</p>
<p>If you need to catch up, you can copy and paste the <code>styles.css</code> from our finished-responsive-website folder:</p>
<img src = "images/finished-site-folder.png" width="350"/><br/>
</section>
<!-- Questions? -->
<section>
<h3>Any questions before we jump into Media Queries?</h3>
<img src="images/lead.jpg" height="400px"/>
</section>
<!-- Break -->
<section>
<h3>Break time!</h3>
</section>
<!-- Media Queries -->
<section>
<h3>Media Queries</h3>
<p style="text-align: left;">If you've ever created a print stylesheet for a website (<code>media="print"</code>) then you're already familiar with the idea of creating a specific stylesheet that comes into play under certain conditions.</p>
<pre><code contenteditable class="css">@media print {
#header img {
display: none;
}
}</code></pre>
</section>
<!-- Media Queries -->
<section>
<h3>If you can write CSS, you can write Media Queries</h3>
<p style="text-align: left;">Media Queries are just an extra layer of instructions that work alongside your existing CSS. These instructions come into play when certain constraints are defined:</p>
<ul>
<li>width and height (browser window or device viewport)</li>
<li>orientation (landscape or portrait mode)</li>
<li><a href="http://css-tricks.com/snippets/css/retina-display-media-query/" target="_blank">resolution (retina display)</a></li>
</ul>
</section>
<!-- Media Query Code -->
<section>
<h3>Media Queries</h3>
<p style="text-align: left;">They look only slightly different than regular CSS, just note the extra set of curly brackets.</p>
<pre><code contenteditable class="css">@media only screen and (max-width: 768px) { /* <-- This opening curly bracket is for the media query */
#gallery {
clear: both;
width: 100%;
}
#thumbs li img {
width: 100%;
}
aside {
clear: both;
margin: 0 auto;
width: 100%;
}
} /* <-- This bracket closes the media query */</code></pre>
</section>
<!-- Writing Media Queries -->
<section>
<h3>Let's Develop It!</h3>
<p style="text-align: left;">We can make a few small changes to our sample website right now and see what happens.</p>
<p>Let's go back to our <code>styles.css</code> file.</p>
<img src="images/workingstyles.png" width="330px"/>
</section>
<!-- Adding smaller screen styles -->
<section>
<h3>Adding Media Queries</h3>
<p style="text-align: left;">Since all of the CSS we've written so far looks best on mostly the desktop view, let's customize it a bit for a smaller screen, like a tablet.</p>
</section>
<!-- Adding a media query -->
<section>
<h3>Adding Media Queries</h3>
<p>At the very bottom of our <code>styles.css</code>, type the following:</p>
<pre><code contenteditable class="css">@media screen and (max-width: 1024px) {
#gallery {
clear: both;
width: 100%;
}
#thumbs li img {
width: 100%;
}
aside {
clear: both;
margin: 0 auto;
width: 100%;
}
}</code></pre>
</section>
<!-- Going smaller -->
<section>
<h3>Adding Media Queries</h3>
<div>Looking better! Now let's customize it a bit for an even smaller screen, like a phone. Considering phone sizes, let's set it for a width that covers some of the larger phones.</div>
</section>
<!-- Adding smaller media queries -->
<section>
<h3>Adding Media Queries</h3>
<div>At the very end of our <code>styles.css</code>, type the following:</div>
<pre><code contenteditable class="css">@media screen and (max-width: 667px) {
#thumbs li {
clear: both;
width: 100%;
}
}</code></pre>
</section>
<!-- Success! -->
<section>
<h3>Basics accomplished!</h3>
<p style="text-align: left;">Now we have a very basic, responsive website. We could keep adding and adding to this, but we're going to move on to learning about process.</p>
</section>
<!-- CSS Transitions -->
<section>
<h3>Bonus!</h3>
<p style="text-align: left;">As our content readjusts at each breakpoint, the change can be abrupt. Though users might not notice it, it's a subtle way to soften the transitions.</p>
<p style="text-align: left;">Add the following to the bottom of your CSS, save, refresh your website, and resize the browser to see the difference:</p>
<pre><code contenteditable class="css">aside, #thumbs li {
-webkit-transition: width 1s ease;
transition: width 1s ease;
}</code></pre>
</section>
<!-- [start] Starting from scratch -->
<section>
<h3>Starting from scratch: Framework</h3>
<p style="text-align: left;">Maybe it turns out you've got a site that's going to be a bit more complex, or you just want to start with a clean slate.</p>
<p>Here's where responsive frameworks can come in.</p>
<ul>
<li><a href="http://foundation.zurb.com/" target="_blank">Foundation</a></li>
<li><a href="http://www.getskeleton.com/" target="_blank">Skeleton</a></li>
<li><a href="http://gumbyframework.com/" target="_blank">Gumby</a></li>
<li><a href="http://getbootstrap.com/2.3.2/" target="_blank">Bootstrap</a></li>
</ul>
</section>
<!-- Frameworks -->
<section>
<h3>Frameworks give us: The Grid</h3>
<p style="text-align: left;">This is simply a 12-column flexible grid that can scale out to an arbitrary size (defined by the max-width of the row) that's easily nested. The widths are percentages. They've done the math for us!</p>
<img src="images/grid.png" width="700px"/>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Let's take a look at Foundation</h3>
<p>Here's a framework to try out:</p>
<a href="http://foundation.zurb.com/" target="_blank"><img src="images/zurb.png" width="600px"/></a>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">You should already have the Essential package downloaded, but if not, you can download it here: <a href="http://foundation.zurb.com/develop/download.html" target="_blank">foundation.zurb.com/develop/download.html</a></p>
<img src="images/download.png" width="600px"/>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Let's go to the Foundation Essentials folder we downloaded and open <code>index.html</code> in our browser.</p>
<a href="http://foundation.zurb.com/" target="_blank"><img src="images/found_ss.png" width="400px"/></a>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Check out the following chunks of code and their corresponding CSS by doing a right-click & inspect:</p>
<ul>
<li>div class="row"</li>
<li>div class="large-12 columns"</li>
<li>div class="large-4 medium-4 columns"</li>
</ul>
<img src="images/found-row.png" width="700px"/>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Let's take a look at <code>foundation.css</code> file the Foundation Essentials folder. Open that in Sublime Text, and let's see how they've done their media queries.</p>
<img src="images/found-css.png" width="400px"/>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">You'll notice their media queries are mixed in with the regular styles, so that they're grouped with other like items. In this case, we're dealing with columns.</p>
<img src="images/mix.png" width="500px"/>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Let's start modifying this page so we can get used to working within the rows and columns of the grid.</p>
<p style="text-align: left;">Open <code>index.html</code> in Sublime Text.</p>
<img src="images/found_ss.png" width="400px"/>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Change some text to your own, maybe start with the <code>h1</code> and <code>h2</code>.</p>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Find the spot in the code where there are 3 columns of text. Let's say we want to delete one of them and just have 2 columns.</p>
<p style="text-align: left;">Since these 3 columns are each given a class of <code>large-4 medium-4</code> we have 3 x 4 = 12.</p>
<p style="text-align: left;">If we delete one of the divs and rename the other two <code>large-6 medium-6</code> so that they still add up to 12, see what happens.</p>
<img src="images/rows.png" width="750px"/>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">If we want to change some styling, we should create a new CSS file so any add-ons will be separate from the existing huge CSS file.</p>
<p style="text-align: left;">Open a new document in Sublime Text and save it in the CSS folder inside <code>foundation-essentials</code>. Name it whatever you like. Don't forget to link the new CSS file to your HTML file.</p>
<img src="images/mine.png" width="400px"/>
</section>
<!-- Custom CSS with Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Try adding some color to these classes, or any other ones that you like.</p>
<pre><code contenteditable class="css">.row {
background: blue;
}
.large-12 p {
background: yellowgreen;
}
.large-4 p {
background: salmon;
}</code></pre>
</section>
<!-- Foundation -->
<section>
<h3>Frameworks: Foundation</h3>
<p style="text-align: left;">Once you get comfortable with the way the columns are nested, you'll soon see how you can adapt your own designs into a page like this Foundation starter page.</p>
<p style="text-align: left;">There are other downloads that include much more, including a custom download option, so be sure to try those too.</p>
</section>
<!-- Process -->
<section>
<h3>Process: It Starts with Mobile First</h3>
<p style="text-align: left;">Mobile First helps us to:</p>
<ul>
<li>embrace simplicity</li>
<li>get out of our comfort zone and be forced to innovate</li>
<li>eliminate the bells and whistles (there's no room for them)</li>
<li>prioritize content</li>
</ul>
<p style="text-align: left;">It makes us better designers and developers, and our users will be grateful for it.</p>
</section>
<!-- Mobile First -->
<section>
<h3>Mobile First</h3>
<p style="text-align: left;">It requires a shift in how we think about content.</p>
<p style="text-align: left;">Really, it's <em>content first</em>. Presenting only the most relevant content to begin with, so that none of it is treated as fluff that needs to be hidden from users.</p>
</section>
<!-- Mobile First -->
<section>
<h3>Mobile First</h3>
<p style="text-align: left;">Here's a high-level glance at the Responsive Design and Mobile first process.</p>
<img src="images/process.png"/>
</section>
<!-- Content/Wireframes -->
<section>
<h3>Content & Wireframes</h3>
<p>Creates a blueprint for designers and devs.</p>
<div style="width: 40%; float: left;">
<ul style="font-size: 80%;">
<li style="padding-top: 1.5em;">Requirements gathered</li>
<li>Copy is written (thoughtfully!)</li>
<li>Wireframes are created</li>
</ul>
</div>
<div style="width: 60%; float: right;">
<img src="images/mockup2.png" width="600"/>
</div>
</section>
<!-- Prototypes -->
<section>
<h3>Prototypes</h3>
<p>Great for identifying the pain points before visual design starts.</p>
<div style="width: 40%; float: left;">
<ul style="font-size: 75%;">
<li style="padding-top: 1.5em;">Many wireframing tools now support Responsive</li>
<li>Responsive frameworks help us quickly create prototypes</li>
<li>Interacting with screens in the browser lets you get feedback from others sooner</li>
<li>Dramatically reduces time spent in Photoshop</li>
</ul>
</div>
<div style="width: 60%; float: right;">
<img src="images/axure.png" width="500"/>
</div>
</section>
<!-- Paper Templates -->
<section>
<h3>Designing on paper templates</h3>
<p>Helps sort out the priority and proximity of content. At the very least, it's an exercise that helps clarify what matters the most.</p>
<img src="images/sketching-concept.jpg" width="600" />
</section>
<!-- Style Tiles -->
<section>
<h3>Designing with Style Tiles</h3>
<div style="float: left; width: 60%;">
<p style="text-align: left;"><span class="pretty">Style Tiles.</span> More refined than a mood board. Less detailed than a website mockup or comp.<br/><br/>The style tile below eventually became the website on the right.</p>
<img src="images/styletiles1.jpg" width="380px"/>
</div>
<div style="float: right; width: 40%;">
<img src="images/styletiles3.jpg" width="300px"/>
</div>
</section>
<!-- PSDs -->
<section>
<h3>Designing a PSD Deliverable</h3>
<img src="images/trucks.jpg" width="600" />
</section>
<!-- Responsive Frameworks -->
<section>
<h3>Development using Responsive Frameworks</h3>
<p style="text-align: left;">After receiving design deliverables (style tiles, mobile/desktop mockups), development starts.</p>
<p style="text-align: left;">The starting point can be a responsive framework, or a responsive template in your CMS of choice.</p><br/>
<div style="width: 50%; float: left;">
<h5>Frameworks</h5>
<ul class="pretty">
<li>Foundation</li>
<li>Bootstrap</li>
<li>HTML5 Boilerplate</li>
</ul>
</div>
<div style="width: 50%; float: right;">
<h5>CMS Templates</h5>
<ul class="pretty">
<li>WordPress</li>
<li>Joomla</li>
<li>Concrete5</li>
</ul>
</div>
</section>
<!-- What's not responsive? -->
<section>
<h3>Is there anything that Responsive is NOT?</h3>
<p style="text-align: left;">Responsive is not a replacement for mobile apps, and is not always the go-to solution.</p>
<p style="text-align: left;">We should assume that people will try to view a website on whatever device they have with them. It's up to us to provide the appropriate solutions for each app, website, and use case.</p>
</section>
<!-- Beyond responsive -->
<section>
<h3>This is beyond Responsive</h3>
<p style="text-align: left;">Sometimes there's another strategy happening, intentional or otherwise. Here's what Target has going on.</p>
<p style="text-align: left;">An m-dot mobile site, native app, full website on mobile, Cartwheel:</p>
<img src="images/target01.png" width="170px"/>
<img src="images/target5.png" width="170px"/>
<img src="images/target03.png" width="170px"/>
<img src="images/target04.png" width="170px"/>
</section>
<!-- Responsible -->
<section>
<h3>Responsivize Responsibly</h3>
<p style="text-align: left;">We have a responsibility to do the right thing for our users. It's not an easy job, but you've all taken the first step in helping improve the web just by being here!</p>
<p style="text-align: left;">Go forth and tackle your next project with a fresh perspective!</p>
<img src="images/fox.jpg" width="600px"/>
</section>
<!-- End of workshop -->
<section>
<h3>Thank you! Questions?</h3>
<img src="images/t-rex-sparkler.jpg" alt="you did it!" width="350px" />
</section>
<!-- Resources -->
<section>
<h3>Resources</h3>
<div>Find a complete list here: <a href="http://gopixelsgo.com/girldevelopit/resources.rtf" target="_blank">http://gopixelsgo.com/girldevelopit</a></div>
</section>
<!-- Upocming Events -->
<section>
<h3>Upcoming Events: Join Us!</h3>
<ul>
<li><a href="http://www.meetup.com/Girl-Develop-It-Los-Angeles/events/223824974/">Building with Code: JavaScript</a>, August 13</li>
<li><a href="http://www.meetup.com/Girl-Develop-It-Los-Angeles/events/223855344/">Mentoring Night</a>, August 19</li>
<li><a href="http://www.meetup.com/Girl-Develop-It-Los-Angeles/events/224078489/">JavaScript 101</a>, August 22</li>
<li>Why we code, September 10</li>
<li><a href="http://www.meetup.com/Girl-Develop-It-Los-Angeles/events/224358266/">Python 101</a>, September 13</li>
</ul>
<img src="images/circle-gdi-logo.png" alt="GDI Detroit logo" width="300">
</section>
<!-- Survey -->
<section>
<h3>Survey</h3>
<p>We strive to make each class better than the last! You can help by giving us your honest feedback:</p>
<p><a href="https://goo.gl/xLo23X ">https://goo.gl/xLo23X</a></p>
<p>Thank you!</p>
</section>
</div>
<footer>
<div class="copyright">
Responsive Design 102 -- Los Angeles --
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
</div>
</footer>
</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,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/accessibility-helper/js/accessibility-helper.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>