-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathindex.html
1544 lines (1396 loc) · 53.9 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
<!--
Google IO 2012 HTML5 Slide Template
Authors: Eric Bidelman <[email protected]>
Luke Mahé <[email protected]>
URL: https://code.google.com/p/io-2012-slides
-->
<!DOCTYPE html>
<html>
<head>
<title>The Web Can Do That!? - Google IO 2012</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">-->
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
<!--This one seems to work all the time, but really small on ipad-->
<!--<meta name="viewport" content="initial-scale=0.4">-->
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="theme/css/default.css">
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="theme/css/phone.css">
<!--<link rel="stylesheet" media="all" href="theme/css/custom.css">-->
<base target="_blank"> <!-- This amazingness opens all links in a new tab. -->
<script data-main="js/slides" src="js/require-1.0.8.min.js"></script>
</head>
<body style="opacity: 0" class="weavebg">
<slides class="layout-widescreen">
<slide hidden class="logoslide nobackground">
<article class="flexbox vcenter">
<span><img src="images/google_developers_logo.png"></span>
</article>
</slide>
<slide hidden class="fill nobackground" data-body-class="nobackground">
<article>
<iframe width="640" height="390" data-src="http://www.youtube.com/embed/R0T13iiAzLM?autoplay=0&origin=http://localhost" frameborder="0"></iframe>
</article>
</slide>
<slide class="title-slide segue nobackground">
<aside class="gdbar"><img src="images/chrome_logo.png"></aside>
<!-- The content of this hgroup is replaced programmatically through the slide_config.json. -->
<hgroup class="auto-fadein">
<h1 data-config-title><!-- populated from slide_config.json --></h1>
<h2 data-config-subtitle><!-- populated from slide_config.json --></h2>
<p data-config-presenter><!-- populated from slide_config.json --></p>
<p><a href="https://developers.google.com/events/io/sessions/gooio2012/204/">Watch the video!</a></p>
</hgroup>
</slide>
<slide>
<hgroup>
<h2>Who <em>is</em> this Guy?</h2>
</hgroup>
<article id="who">
<span class="build"><p class="avatar rounded"></p></span>
<p data-config-presenter-title></p>
<p data-config-presenter-company></p>
<p style="margin-top:2em;">
<a rel="author" data-config-gplus>
<img src="http://www.google.com/images/icons/ui/gprofile_button-44.png" width="44" height="44"></a> +<a rel="author" data-config-gplus><span data-config-presenter-name></span></a>
</p>
<p>
<a rel="author" style="margin-left:-8px;" data-config-twitter>
<img src="images/twitter_newbird_blue.png" width="58" height="58"></a> <a rel="author" style="margin-left:-5px;" data-config-twitter></a>
</p>
<p>
<a rel="author" data-config-www></a>
</p>
</article>
</slide>
<slide class="nobackground" data-body-class="cat">
<article class="flexbox vcenter">
<span><a href="http://active.tutsplus.com/articles/roundups/10-flash-things-you-can%E2%80%99t-do-with-html5/" style="border:none"><img src="images/html_can_not_do_that.jpg"></a></span>
<div class="source"><a href="http://www.flickr.com/photos/thefangmonster/490423135/" class="white">www.flickr.com/photos/thefangmonster/490423135/</a></div>
</article>
</slide>
<slide>
<hgroup>
<h2>Agenda</h2>
</hgroup>
<article class="flexbox vcenter auto-fadein" style="height:65%">
<h2 class="black" style="font-size:90px;">There is no agenda!</h2>
</article>
</slide>
<slide>
<hgroup>
<h2>Legend</h2>
<h3>This slide deck is alive!</h3>
</hgroup>
<article class="flexbox vleft" id="legend-slide">
<div><img src="images/icons/radar.svg"> Close to being ready. Keep it on your radar.</div>
<div><img src="images/icons/bug.png"> Relevant Chrome/WebKit bug.</div>
<div><img src="images/icons/bug_closed.png"> Bug has been fixed/resolved.</div>
<div><img src="images/icons/gears.svg"> Specification link</div>
<p id="chrome-version-warning" class="toppadding centered red3" style="display:none">( Some of the live demos in this presentation require Chrome 21+. )</p>
</article>
</slide>
<slide class="can nobackground">
<article class="flexbox vcenter">
<hgroup>
<h2 class="white auto-fadein">CSS For Web Apps</h2>
<span class="build"><h1 class="stamp">Confirmed</h1></span>
</hgroup>
</article>
</slide>
<slide>
<hgroup>
<h2>Floats, Tables, & Positioning...OH MY!</h2>
</hgroup>
<article>
<ul>
<li>Floats stack horizontally to allow simple placement.</li>
<li>Tables lack repeatability and semantic meaning.</li>
<li>Using absolute positioning is difficult. Makes adaptive display hard.</li>
<li>CSS3 specifications address layout cases with regions, exclusions, grid and <span class="underline">flexible box</span>.</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>2012: The Rise of CSS for Web Apps</h2>
</hgroup>
<article>
<ul>
<li><a href="http://dev.w3.org/csswg/css3-regions/">CSS Regions Module Level 3</a></li>
<li><a href="http://dev.w3.org/csswg/css3-flexbox/">CSS Flexible Box Layout Module</a> ( da new one )</li>
<li><a href="http://dev.w3.org/csswg/css3-grid-align/">CSS Grid Layout</a></li>
<li><a href="http://dev.w3.org/csswg/css3-hierarchies/">CSS Hierarchies</a></li>
<li><a href="https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html">CSS Filter Effects 1.0</a></li>
<li><a href="http://dl.dropbox.com/u/11894343/web-animations/web-animations.html">Web Animations 1.0</a></li>
<li><a href="http://dev.w3.org/csswg/css-variables/">CSS Variables Module Level 1</a></li>
</ul>
</article>
</slide>
<slide hidden>
<hgroup>
<span>
<a href="http://webk.it/62048" class="bug" title="Bug link"></a>
<a href="http://dev.w3.org/csswg/css3-flexbox/" class="spec" title="Spec link"></a>
</span>
<h2>CSS Flexible Box Module</h2>
<h3>Layout for web apps</h3>
</hgroup>
<article>
<ul class="build fade">
<li>Box model optimized for user interface design</li>
<li>Children can "flex" their sizes: fill unused space / shrink to avoid overflow</li>
<li>Source-ordering independence: children can be laid out in any direction</li>
<li>Enabled by <code>display: <a data-tooltip-property="flex" class="bold"></a></code> and <code>display: <a data-tooltip-property="inline-flex" class="bold"></a></code></li>
<li>Note: Replacing old flex box <code>display: <a data-tooltip-property="box"></a></code></li>
</ul>
<p class="toppadding build"><span>That's all great...</span></p>
</article>
</slide>
<slide class="segue">
<article class="flexbox vcenter auto-fadein">
<h2 class="black">So why is flexbox so awesome?</h2>
</article>
</slide>
<slide>
<hgroup>
<h2>Achieve That "Holy Grail" Layout!</h2>
</hgroup>
<article class="flexbox vcenter">
<img src="images/slides/flexbox-holygrail.svg" style="width:500px;height:400px;" alt="Standard layout" title="Standard layout">
</article>
</slide>
<slide>
<hgroup>
<h2>Alignment</h2>
<h3>Vertically centered content is easy peasy!</h3>
</hgroup>
<article class="flexbox-example" id="flexbox-ex2">
<pre class="prettyprint" data-lang="css">
.box {
display: <a data-tooltip-property="flex" class="bold"></a>;
<a data-tooltip-property="justify-content" class="bold"></a>: <select id="justify-content">
<option>flex-start</option>
<option selected>center</option>
<option>flex-end</option>
<option>space-between</option>
<option>space-around</option>
</select>;
<a data-tooltip-property="align-items" class="bold"></a>: <select id="align-items">
<option>flex-start</option>
<option selected>center</option>
<option>flex-end</option>
<option>baseline</option>
<option>stretch</option>
</select>;
}
</pre>
<section class="box">
<div>A</div>
<div>B</div>
<div>C</div>
</section>
</article>
</slide>
<slide>
<hgroup>
<h2>Ordering & Orientation</h2>
<h3>Order independent from source</h3>
</hgroup>
<article class="flexbox-example smaller" id="flexbox-ex4">
<ul>
<li>Content is laid out from lowest to highest numbered ordinal group.</li>
<li>Items with the same order group are laid out per source document.</li>
</ul>
<pre class="prettyprint" data-lang="css">
.box {
<a data-tooltip-property="flex-direction" class="bold"></a>: <select id="flexDirection">
<option selected>row</option>
<option>row-reverse</option>
<option>column</option>
<option>column-reverse</option>
</select>;
}
.box > :nth-child(2) {
<a data-tooltip-property="order" class="bold"></a>: <input id="order" type="number" placeholder="0">;
}
</pre>
<section class="box">
<div>A</div>
<div>B</div>
<div>C</div>
</section>
</article>
</slide>
<slide hidden>
<hgroup>
<h2>Optimized For UI Design!</h2>
</hgroup>
<article>
<p>Example: distribute toolbar icons evenly as device width changes:</p>
<p class="centered">
<img src="images/slides/flexbox-tools.svg" alt="Typical toolbar" title="Typical toolbar">
</p>
</article>
</slide>
<slide>
<hgroup>
<h2>Same Height Columns!</h2>
</hgroup>
<article id="flexbox-bad">
<div class="rounded">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla varius tortor ut sem volutpat eu tincidunt ligula feugiat. Pellentesque sollicitudin turpis egestas lorem tincidunt ultricies in at metus. Fusce nec nibh justo.
</div>
<div class="rounded">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</div>
<div class="rounded">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla varius tortor ut sem volutpat eu tincidunt ligula feugiat.
</div>
</article>
</slide>
<slide>
<hgroup>
<h2>Flexibility</h2>
</hgroup>
<article class="flexbox-example smaller" id="flexbox-ex3">
<ul>
<li>Flexbox items alter their width/height to fill available space.</li>
<li>Items grow/shrink proportional to their positive/negative flexibility</li>
<li>3rd argument is preferred size</li>
</ul>
<pre class="prettyprint" data-lang="css">
.box > * {
<a data-tooltip-property="flex" class="bold"></a>: 1 0 0px;
}
.box > :nth-child(2) {
<a data-tooltip-property="flex" class="bold"></a>: <input type="number" value="1" placeholder="1"> <input type="number" placeholder="0"> <input type="text" placeholder="0">px;
}
</pre>
<section class="box">
<div>A</div>
<div>B</div>
<div>C</div>
</section>
</article>
</slide>
<slide class="fill nobackground" data-body-class="blueprint">
<hgroup>
<h2 class="white">Demo: Holy Grail Layout</h2>
</hgroup>
<article>
<!--<a href="http://jsbin.com/emedub/37/edit" class="demo">Demo</a>-->
<a href="http://html5-demos.appspot.com/static/css/flexbox/index.html" class="previewframe"><iframe data-src="http://html5-demos.appspot.com/static/css/flexbox/index.html"></iframe></a>
</article>
</slide>
<slide>
<hgroup>
<h2>Browser Support</h2>
<h3>CSS Flexbox ( da new one )</h3>
</hgroup>
<article class="flexbox vcenter" style="height:65%">
<div class="browser-support">
<img src="images/browser_logos/safari_logo.png" class="supported">
<img src="images/chrome_logo.png" class="supported">
<img src="images/browser_logos/ff_logo.png">
<img src="images/browser_logos/opera_logo.png">
<img src="images/browser_logos/ie10_logo.png" class="supported">
</div>
</article>
</slide>
<slide class="can nobackground">
<article class="flexbox vcenter">
<hgroup>
<h2 class="white auto-fadein">Dynamic CSS</h2>
<span class="build"><h1 class="stamp">Confirmed</h1></span>
</hgroup>
</article>
</slide>
<slide hidden>
<aside class="note">
<section>
<p>Support: <code>-webkit-calc()</code>, <code>-moz-calc()</code>, IE9.</p>
</section>
</aside>
<hgroup>
<span>
<a href="http://webk.it/16662" class="bug"></a>
<a href="http://www.w3.org/TR/css3-values/#calc" class="spec" title="Spec link" alt="Spec link"></a>
</span>
<h2>New CSS Functions</h2>
</hgroup>
<article class="smaller">
<p>calc()</p>
<pre class="prettyprint" data-lang="css">
width: <a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(200px - 100);
width: <a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(2 * 50%);
width: <a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(200px / 2);
color: hsl(<a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(120), <a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(75%), 0.5);
background-position: <a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(50% + 5px) center;
</pre>
<p>min()</p>
<pre class="prettyprint" data-lang="css">
width: <a data-tooltip-property="min" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(150px, 100px, 200px);
width: <a data-tooltip-property="min" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(90px + 50px, 100px);
width: <a data-tooltip-property="min" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(100px, 100%); /* where 100% is 200px; */
</pre>
<p>max()</p>
<pre class="prettyprint" data-lang="css">
width: <a data-tooltip-property="max" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(150px, 100px, 200px);
width: <a data-tooltip-property="max" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(200px - 50px, 100px);
width: <a data-tooltip-property="max" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(100px, 100%); /* where 100% is 200px; */
</pre>
</article>
</slide>
<slide>
<aside class="note">
<section>
<p>Support: <code>-webkit-calc()</code>, <code>-moz-calc()</code>, IE9.</p>
</section>
</aside>
<hgroup>
<span>
<a href="http://webk.it/16662" class="bug"></a>
<a href="http://www.w3.org/TR/css3-values/#calc" class="spec" title="Spec link" alt="Spec link"></a>
</span>
<h2>calc()</h2>
</hgroup>
<article id="flexbox-circle" class="columns-2">
<pre class="prettyprint" data-lang="css">
.circle {
width: 300px;
height: 300px;
}
div {
display: <a data-tooltip-property="flex" class="bold"></a>;
width: <a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(100% - 4em);
height: <a data-tooltip-property="calc" data-tooltip-support='["webkit", "moz", "unprefixed"]' class="bold"></a>(100% - 4em);
border-radius: 50%;
<a data-tooltip-property="align-items" data-tooltip-support='["webkit"]' class="bold"></a>: center;
<a data-tooltip-property="justify-content" data-tooltip-support='["webkit"]' class="bold"></a>: center;
}
div:hover {
border-radius: 0;
}
</pre>
<div class="circle">
<div>
<div><div></div></div>
</div>
</div>
</article>
</slide>
<slide>
<hgroup>
<h2>Browser Support</h2>
<h3>CSS calc()</h3>
</hgroup>
<article class="flexbox vcenter" style="height:65%">
<div class="browser-support">
<img src="images/browser_logos/safari_logo.png" class="supported">
<img src="images/chrome_logo.png" class="supported">
<img src="images/browser_logos/ff_logo.png" class="supported">
<img src="images/browser_logos/opera_logo.png">
<img src="images/browser_logos/ie10_logo.png" class="supported">
</div>
</article>
</slide>
<slide hidden>
<hgroup>
<span>
<a href="http://webk.it/52162" class="bug"></a>
<a href="http://dev.w3.org/csswg/css3-images/#cross-fade-function" class="spec" title="Spec link" alt="Spec link"></a>
</span>
<h2>CSS Functions ( cont. )</h2>
</hgroup>
<article>
<p>cross-fade()</p>
<pre class="prettyprint" data-lang="css">
background-image: <a data-tooltip-property="cross-fade" class="bold"></a>(url(first.png), url(second.png), 50%);
@-webkit-keyframes fading {
0% { background-image: <a data-tooltip-property="cross-fade" class="bold"></a>(url(first.png), url(second.png), 0%); }
100% { background-image: <a data-tooltip-property="cross-fade" class="bold"></a>(url(first.png), url(second.png), 100%); }
}
</pre>
<p class="centered"><a href="http://peter.sh/files/examples/cross-fading.html" class="demo">Demo</a></p>
</article>
</slide>
<slide hidden>
<aside class="note">
<section>
<ul>
<li>Prefixed in WebKit nightly/Chrome Canary: <code>-webkit-filter</code>.</li>
</ul>
</section>
</aside>
<hgroup>
<span>
<a href="http://webk.it/68469" class="bug" title="Bug link"></a>
<a href="https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html" class="spec" title="Spec link"></a>
</span>
<h2>CSS Filter Effects</h2>
</hgroup>
<article>
<p>Apply filter effects to any DOM element:</p>
<pre class="prettyprint" data-lang="css">
video, img {
<a data-tooltip-property="filter" class="bold"></a>: grayscale(0.5) blur(10px);
}
</pre>
<ul>
<li>Chrome needs <code>--enable-accelerated</code> flag for hardware accelerated content.</li>
<li>Good <a href="http://drublic.de/blog/effects-for-the-web/">blog post</a>.</li>
</ul>
<p class="centered"><a href="http://html5-demos.appspot.com/static/css/filters/index.html" class="demo">Demo</a> <a href="http://lab.simurai.com/stars/" class="demo">Demo2</a></p>
</article>
</slide>
<slide class="can nobackground" data-body-class="binding">
<article class="flexbox vcenter">
<hgroup>
<h2 class="white auto-fadein">Data binding</h2>
<span class="build"><h1 class="stamp">Confirmed</h1></span>
</hgroup>
<div class="source"><a href="http://www.flickr.com/photos/24946690@N03/4345556870/" class="white">www.flickr.com/photos/24946690@N03/4345556870/</a></div>
</article>
</slide>
<slide>
<hgroup>
<h2>Old Hat for JS Frameworks</h2>
</hgroup>
<article class="build">
<div>
<p>Angular ( <a href="http://angularjs.org">angularjs.org</a> ) example:</p>
<pre class="prettyprint" data-lang="html">
<div <b>ng-app</b> ng-init="val=25">
Volume: <input type="range" min="0" max="100" <b>ng-model="val"</b>>
<b>{{val}}</b>/100
</div>
</pre>
</div>
<div ng-app ng-cloak ng-init="val=25" class="centered toppadding">
Volume: <input type="range" min="0" max="100" ng-model="val"> {{val}}/100
</div>
</article >
</slide>
<slide>
<hgroup>
<h2>One-way Data Binding: <code>data-*</code> Attributes</h2>
<h3>"Poor man's data binding"</h3>
</hgroup>
<article>
<ul>
<li>Model: data attribute</li>
<li>Use <code>attr()</code> to get the value(s)</li>
<li>View: render generated content to <code>:before</code>/<code>:after</code> pseudo elements</li>
<li>Hook listeners that watch for changes.</li>
</ul>
</article>
</slide>
<slide id="data-binding-example">
<hgroup>
<h2>"Poor Man's Data Binding"</h2>
</hgroup>
<article>
<pre class="prettyprint" data-lang="html/js">
<style>
input::after {
<b>content: attr(data-value) '/' attr(max);</b>
position: relative;
left: 135px; top: -20px;
}
</style>
<input type="range" min="0" max="100" value="25">
<script>
var input = document.querySelector('input');
input.dataset.value = input.value; // Set an initial value.
<b>input.addEventListener('change', function(e) {
this.dataset.value = this.value;
});</b>
</script>
</pre>
<div class="centered">
Volume: <input type="range" min="0" max="100" value="25">
</div>
</article>
</slide>
<slide>
<hgroup>
<span>
<a href="http://webk.it/27247" class="bug" title="Bug link"></a>
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-datalist-element" class="spec" title="Spec link"></a>
</span>
<h2>One-way Data Binding: <datalist></h2>
</hgroup>
<article>
<pre class="prettyprint" data-lang="html">
Browsers: <input <b>list="browsers"></b>
<<b>datalist</b> id="browsers">
<option value="Chrome">
<option value="Firefox">
<option value="Internet Explorer">
<option value="Opera">
<option value="Safari">
<b></datalist></b>
</pre>
<ul>
<li>Specifies a list of pre-defined options for an <input> element.</li>
<li><code>list</code> attribute "binds" data list to an <input></li>
<li>Useful for "autocomplete" on <input> elements.</li>
</ul>
<p class="centered blue">Browsers: <input list="browsers">
<datalist id="browsers">
<option value="Chrome">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Opera">
<option value="Safari">
</datalist>
</p>
</article>
</slide>
<slide>
<hgroup>
<h2>Browser Support</h2>
<h3>Data binding with <code>data-*</code> attrs / <code><datalist></code></h3>
</hgroup>
<article class="flexbox vcenter" style="height:65%;">
<div class="browser-support">
<img src="images/browser_logos/safari_logo.png" class="supported">
<img src="images/chrome_logo.png" class="supported">
<img src="images/browser_logos/ff_logo.png" class="supported">
<img src="images/browser_logos/opera_logo.png" class="supported">
<img src="images/browser_logos/ie10_logo.png" class="supported">
</div>
</article>
</slide>
<slide class="can nobackground">
<article class="flexbox vcenter">
<hgroup>
<h2 class="white auto-fadein">Access a Filesystem</h2>
<span class="build"><h1 class="stamp">Confirmed</h1></span>
</hgroup>
</article>
</slide>
<slide>
<hgroup style="display:inline-block;">
<h2 class="build">I Got So Excited...<span>I Wrote a Book :)</span></h2>
</hgroup>
<article class="flexbox vcenter">
<a href="http://www.amazon.com/Using-HTML5-Filesystem-Eric-Bidelman/dp/1449309453" style="border:none;"><img src="images/my_book_cover.jpg" alt="Using the HTML5 Filesystem API" title="Using the HTML5 Filesystem API" style="height:500px;"></a>
</article>
</slide>
<slide>
<hgroup>
<span>
<a href="http://dev.w3.org/2009/dap/file-system/file-dir-sys.html" class="spec" title="Spec link"></a>
</span>
<h2>HTML5 Filesystem API</h2>
<h3>Persist data to files/folders</h3>
</hgroup>
<article>
<p>Opening a filesystem:</p>
<pre class="prettyprint" data-lang="js">
window.<a data-tooltip-property="requestFileSystem" data-tooltip-support='["webkit"]' data-tooltip-js class="bold"></a>(
TEMPORARY, // persistent vs. temporary storage
1024 * 1024, // size (bytes) of needed space
initFs, // success callback
opt_errorHandler // opt. error callback, denial of access
);
</pre>
<ul class="build">
<li>Security: sandboxed per origin</li>
<li>Power: native apps can do files/folders,...web apps should too!</li>
<li>Benefit: dynamically cache and manage assets.</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>Example: Caching Remote Files</h2>
</hgroup>
<article class="">
<pre class="prettyprint" data-lang="js">
var xhr = new XMLHttpRequest();
xhr.open('GET', '/path/to/image.png', true);
<b>xhr.responseType = 'arraybuffer';</b>
xhr.onload = function(e) {
};
xhr.send();
</pre>
</article>
</slide>
<slide>
<hgroup>
<h2>Example: Caching Remote Files</h2>
</hgroup>
<article class="">
<pre class="prettyprint" data-lang="js">
var xhr = new XMLHttpRequest();
xhr.open('GET', '/path/to/image.png', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
<b>window.<a data-tooltip-property="requestFileSystem" data-tooltip-support='["webkit"]' data-tooltip-js class="bold"></a>(TEMPORARY, 1024 * 1024, function(fs) {</b>
<b>}, onError);</b>
};
xhr.send();
</pre>
</article>
</slide>
<slide>
<hgroup>
<h2>Example: Caching Remote Files</h2>
</hgroup>
<article class="">
<pre class="prettyprint" data-lang="js">
var xhr = new XMLHttpRequest();
xhr.open('GET', '/path/to/image.png', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
window.<a data-tooltip-property="requestFileSystem" data-tooltip-support='["webkit"]' data-tooltip-js></a>(TEMPORARY, 1024 * 1024, function(fs) {
<b>fs.root.getFile('image.png', {create: true}, function(fileEntry) {</b>
<b>}, onError);</b>
}, onError);
};
xhr.send();
</pre>
</article>
</slide>
<slide>
<hgroup>
<h2>Example: Caching Remote Files</h2>
</hgroup>
<article class="">
<pre class="prettyprint" data-lang="js">
var xhr = new XMLHttpRequest();
xhr.open('GET', '/path/to/image.png', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
window.<a data-tooltip-property="requestFileSystem" data-tooltip-support='["webkit"]' data-tooltip-js></a>(TEMPORARY, 1024 * 1024, function(fs) {
fs.root.getFile('image.png', {create: true}, function(fileEntry) {
<b>fileEntry.createWriter(function(writer) {</b>
writer.onwriteend = function(e) { ... };
writer.onerror = function(e) { ... };
<b>writer.write(new Blob([xhr.response], {type: 'image/png'}));</b>
<b>}, onError);</b>
}, onError);
}, onError);
};
xhr.send();
</pre>
</article>
</slide>
<slide>
<hgroup>
<h2>Using Local Assets</h2>
</hgroup>
<article>
<ul>
<li>Stored files/folders get their own ( <code>filesystem:</code> ) URL:</li>
</ul>
<pre class="centered" style="font-size:25px;">
<b>filesystem:</b><b alt="Origin of the app" class="blue" data-tooltip="Origin of the app"><span class="property" style="color:inherit;">http://example.com</span></b>/<b alt="Type of storage used" class="red" data-tooltip="Type of storage used"><span class="property" style="color:inherit;">temporary</span></b>/<b alt="Path to the file/folder" class="green" data-tooltip="Path to the file/folder"><span class="property" style="color:inherit;">image.png</span></b>
</pre>
<ul><li>Use for a src/href value:</li></ul>
<pre class="prettyprint" data-lang="js">
var img = document.createElement('img');
img.src = <b>fileEntry.toURL();</b>
document.body.appendChild(img);
</pre>
<ul><li>Get back to a <code>FileEntry</code> from its <code>filesystem:</code> URL:</li></ul>
<pre class="prettyprint" data-lang="js">
window.<a data-tooltip-property="resolveLocalFileSystemURL" data-tooltip-support='["webkit"]' data-tooltip-js class="bold"></a>(img.src, function(fileEntry) { ... });
</pre>
</article>
</slide>
<slide>
<hgroup>
<h2>Moar Callbackzzzzzz!</h2>
</hgroup>
<article class="">
<pre class="prettyprint" data-lang="js">
var xhr = new XMLHttpRequest();
xhr.open('GET', '/path/to/image.png', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
window.<a data-tooltip-property="requestFileSystem" data-tooltip-support='["webkit"]' data-tooltip-js></a>(TEMPORARY, 1024 * 1024, function(fs) {
fs.root.getFile('image.png', {create: true}, function(fileEntry) {
fileEntry.createWriter(function(writer) {
writer.onwriteend = function(e) { ... };
writer.onerror = function(e) { ... };
writer.write(new Blob([xhr.response], {type: 'image/png'}));
}, onError);
}, onError);
}, onError);
};
xhr.send();
</pre>
</article>
</slide>
<slide class="segue">
<article class="flexbox vcenter auto-fadein">
<q style="font-size: 60px;">Callback spaghetti is hard,... let's go shopping!</q>
<div class="build toppadding"><div class="author">Eric Bidelman</div></span>
</article>
</slide>
<slide>
<hgroup>
<h2>filer.js ( <a href="https://github.com/ebidel/filer.js">github.com/ebidel/filer.js</a> )</h2>
</hgroup>
<article>
<p>Wrapper lib that implements common UNIX cmds (ls, cp, mv)</p>
<pre class="prettyprint" data-lang="js">
<b>var filer = new Filer();</b>
filer.<b>init</b>({persistent: false, size: 1024 * 1024}, function(fs) {...}, onError);
filer.<b>ls</b>('path/to/some/dir/', function(entries) { ... }, onError);
<b>filer.cp('file.txt', '/path/to/folder', 'newname.txt', function(entry) {
// entry.fullPath == '/path/to/folder/newname.txt'
}, onError);</b>
var b = new Blob(['body { color: red; }'], {type: 'text/css'});
filer.<b>write</b>('styles.css', {data: b, type: b.type}, function(entry, writer) {
...
}, onError);
</pre>
</article>
</slide>
<slide class="fill nobackground" data-body-class="blueprint">
<hgroup>
<h2 class="white">Demo: Filesystem Playground</h2>
</hgroup>
<article style="margin-top:0;">
<a href="http://html5-demos.appspot.com/static/filesystem/filer.js/demos/index.html" class="previewframe"><iframe data-src="http://html5-demos.appspot.com/static/filesystem/filer.js/demos/index.html" style="-webkit-transform: scale(0.75) translateX(-130px);width: 120%;height:600px;"></iframe></a>
</article>
</slide>
<!--
<slide>
<hgroup>
<h2>Browser Support</h2>
<h3>Filesystem API</h3>
</hgroup>
<article class="flexbox vcenter" style="height:65%">
<div class="browser-support">
<img src="images/browser_logos/safari_logo.png">
<img src="images/chrome_logo.png" class="supported">
<img src="images/browser_logos/ff_logo.png">
<img src="images/browser_logos/opera_logo.png">
<img src="images/browser_logos/ie10_logo.png">
</div>
</article>
</slide>
-->
<slide class="segue">
<article class="flexbox vcenter auto-fadein">
<h2 class="black" style="font-size:45px;">But kind Sir, this marvel is only in Chrome!</h2>
<p class="centered build toppadding"><a href="http://html5-demos.appspot.com/static/filesystem/idb.filesystem.js/demos/playground/index.html" class="demo">Oh yeah?</a></p>
</article>
</slide>
<!--
<slide>
<hgroup>
<h2>idb.filesystem.js</h2>
</hgroup>
<article>
<p class="centered"><a href="https://github.com/ebidel/idb.filesystem.js">github.com/ebidel/idb.filesystem.js</a></p>
<ul class="build">
<li>HTML5 Filesystem API shim library using IndexedDB</li>
<li>Means browsers that support IDB also support the Filesystem API!</li>
</ul>
<p class="centered build"><a href="http://html5-demos.appspot.com/static/filesystem/idb.filesystem.js/demos/playground/index.html" class="demo">Launch me in FF</a></p>
</article>
</slide>
-->
<slide>
<hgroup>
<h2>Browser Support</h2>
<h3>HTML5 Filesystem API - thanks to <a href="https://github.com/ebidel/idb.filesystem.js">idb.filesystem.js</a> shim!</h3>
</hgroup>
<article class="flexbox vcenter" style="height:65%">
<div class="browser-support">
<img src="images/browser_logos/safari_logo.png">
<img src="images/chrome_logo.png" class="supported">
<img src="images/browser_logos/ff_logo.png" class="supported">
<img src="images/browser_logos/opera_logo.png">
<img src="images/browser_logos/ie10_logo.png" class="supported">
</div>
</article>
</slide>
<slide class="can cant nobackground">
<article class="flexbox vcenter">
<hgroup>
<h2 class="white auto-fadein">sudo make me a sandwich</h2>
<span class="build"><h1 class="stamp" style="left:30%">BUSTED</h1></span>
</hgroup>
</article>
</slide>
<slide class="can nobackground">
<article class="flexbox vcenter">
<hgroup>
<h2 class="white auto-fadein">Serverless Downloads</h2>
<span class="build"><h1 class="stamp">Confirmed</h1></span>
</hgroup>
</article>
</slide>
<slide>
<hgroup>
<span>
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#downloading-resources" class="spec" title="Spec link"></a>
</span>
<h2>Client-side Downloads</h2>
</hgroup>
<article class="build">
<p><label class="old"></label>Force downloads with a server:</p>
<pre class="prettyprint" data-lang="http">
Content-Disposition: attachment; filename="MyLogo.png";
</pre>
<ul class="toppadding">
<li>Need a way for users to download data created in the app.</li>
</ul>
<p><label class="new"></label>Use <code>download</code> to download resources rather than navigate to them:</p>
<pre class="prettyprint" data-lang="html">
<a href="http://google.com/logo.png" <b>download="Logo.png"</b>>download me</a>
</pre>
</article>
</slide>
<slide class="fill nobackground" data-body-class="blueprint">
<hgroup>
<h2 class="white">Demo: Novel Generator</h2>
</hgroup>
<article>
<a href="http://html5-demos.appspot.com/static/a.download.html" class="previewframe"><iframe data-src="http://html5-demos.appspot.com/static/a.download.html"></iframe></a>
</article>
</slide>
<slide>
<hgroup>
<h2>Example: Downloading a Generated File</h2>
</hgroup>
<article>
<pre class="prettyprint" data-lang="js">
function downloadLink(name, content, mimetype) {
var a = document.createElement('a');
<b>a.href = window.<a data-tooltip-property="URL.createObjectURL" data-tooltip-lowercase data-tooltip-support='["unprefixed", "webkit"]' data-tooltip-js></a>(new Blob([content], {type: mimetype}));</b>
<b>a.download = name;</b>
a.textContent = 'Download ready';
document.body.appendChild(a);
}
downloadLink('MyNovel.txt', document.querySelector('textarea').textContent, 'text/plain');
</pre>
</article>
</slide>
<slide class="can nobackground" data-body-class="rocket">
<article class="flexbox vcenter">
<hgroup>
<h2 class="white auto-fadein">Efficiently Transfer Data</h2>
<span class="build"><h1 class="stamp">Confirmed</h1></span>
</hgroup>
<div class="source"><a href="http://www.flickr.com/photos/hamillianactor/362021036/" class="white">www.flickr.com/photos/hamillianactor/362021036/</a></div>
</article>
</slide>
<slide class="segue">
<article class="flexbox vcenter auto-fadein">
<h2 class="black">Evolution of <code>postMessage()</code></h2>
</article>
</slide>
<slide>
<hgroup>
<span>
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#web-messaging" class="spec" title="window.postMessage() spec link"></a>
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#dedicatedworkerglobalscope" class="spec" title="worker.postMessage() spec link"></a>
</span>
<h2>Evolution of <code>postMessage()</code></h2>