-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtest.html5rocks.html
1264 lines (1068 loc) · 44.8 KB
/
test.html5rocks.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>
<head>
<meta charset="utf-8">
<title>HTML5 Presentation</title>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono">
<link rel="stylesheet" href="src/prettify/prettify.css" id="prettify-link" disabled>
<link rel="stylesheet" href="styles/fonts.css" media="screen">
<link rel="stylesheet" href="styles/presentation.css" media="screen">
<link rel="stylesheet" href="styles/common.css" media="screen">
<!-- todo: check - is media="screen" needed? what is the "default"? -->
<link rel="stylesheet" href="styles/default.css" class="theme" media="screen">
<link rel="stylesheet" href="styles/moon.css" class="theme" media="screen">
<link rel="stylesheet" href="styles/sand.css" class="theme" media="screen">
<link rel="stylesheet" href="styles/sea_wave.css" class="theme" media="screen">
</head>
<body>
<div id="flex-container">
<nav id="helpers">
<button title="Previous slide" id="nav-prev" class="nav-prev">⇽</button>
<button title="Jump to a random slide" id="slide-no">5</button>
<button title="Next slide" id="nav-next" class="nav-next">⇾</button>
<menu>
<button type="checkbox" data-command="toc" title="Table of Contents" class="toc">TOC</button>
<!-- <button type="checkbox" data-command="resources" title="View Related Resources">☆</button> -->
<button type="checkbox" data-command="notes" title="View Slide Notes">✏</button>
<button type="checkbox" data-command="source" title="View slide source">↻</button>
<button type="checkbox" data-command="help" title="View Help">?</button>
</menu>
</nav>
<div class="slides">
<div id="presentation-counter">Loading...</div>
<div class="slide" id="landing-slide">
<section class="middle">
<p>This presentation is an HTML5 website</p>
<p>Press <span id="left-init-key" class="key">→</span> key to advance.</p>
</section>
<aside class="note">
<section>
Welcome! (This field is for speaker notes and commentary.)
</section>
</aside>
</div>
<div class="slide" id="controls-slide">
<header>Slides controls</header>
<section>
<ul>
<li><span class="key">←</span> and <span class="key">→</span> to move around.</li>
<li><span class="key">Ctrl/Command</span> and <span class="key">+</span> or <span class="key">-</span> to zoom in and out if slides don’t fit.</li>
<li><span class="key">S</span> to view page source.</li>
<li><span class="key">T</span> to change the theme.</li>
<li><span class="key">H</span> to toggle syntax highlight.</li>
<li><span class="key">N</span> to toggle speaker notes.</li>
<li><span class="key">3</span> to toggle 3D effect.</li>
<li><span class="key">0</span> to toggle help.</li>
</ul>
</section>
</div>
<div class="slide" id="title-slide">
<section class="middle">
<hgroup>
<h1>
HTML5*
</h1>
<h2>
Web Development to the next level
</h2>
</hgroup>
<p>*Including other next generation technologies of the Web Development stack</p>
</section>
</div>
<div class="slide" id="timeline-slide">
<header>Rough Timeline of Web Technologies</header>
<section>
<ul id="timeline">
<li data-auto><span class="year">1991</span> <span class="html">HTML</span></li>
<li data-auto><span class="year">1994</span> <span class="html">HTML 2</span></li>
<li data-auto><span class="year">1996</span> <span class="css">CSS 1</span> + <span class="js">JavaScript</span></li>
<li data-auto><span class="year">1997</span> <span class="html">HTML 4</span></li>
<li data-auto><span class="year">1998</span> <span class="css">CSS 2</span></li>
<li data-auto><span class="year">2000</span> <span class="html">XHTML 1</span></li>
<li><span class="year"><em class="stroke">2002</em></span> <span class="css">Tableless Web Design</span></li>
<li><span class="year"><em class="stroke">2005</em></span> <span class="js">AJAX</span></li>
<li><span class="year"><em class="stroke">2009</em></span> <span class="html">HTML 5</span></li>
</ul>
</section>
</div>
<div class="slide" id="formula-intro-slide">
<section class="middle formula" data-build>
HTML5 ~=
<span class="html">HTML</span>
+
<span class="css">CSS</span>
+
<span class="js">JS</span>
</section>
</div>
<div class="slide" id="table-of-contents">
<header><h1>Today, we will cover...</h1></header>
<section>
<ul id="toc-list">
</ul>
</section>
</div>
{% include_relative html5rocks/01-offline-storage.html %}
{% include_relative html5rocks/02-realtime-communications.html %}
<div class="slide transitionSlide" id="hardware-access-title">
<section class="middle">
<h2>File / Hardware Access</h2>
<p>Deeper integration with the Operating System</p>
<img src="http://www.html5rocks.com/static/images/identity/classes_64/HTML5_Device_Access_64.png" title="HTML5 Device Access" alt="HTML5 Device Access">
</section>
</div>
<div class="slide device-access" id="native-drag-and-drop">
<header><span class="js">JS</span> <h1>Native Drag & Drop</h1></header>
<section id="dnd-section">
<pre>document.addEventListener(<em>'dragstart'</em>, function(event) {
event.<b>dataTransfer.setData</b>('text', 'Customized text');
event.<b>dataTransfer.effectAllowed</b> = 'copy';
}, false);
</pre>
</section>
</div>
<div class="slide device-access" id="desktop-drag-in">
<header><span class="js">JS</span> <h1>Desktop Drag-In (File API)</h1></header>
<section>
<h3>Drag files in from the desktop:</h3>
<pre>
document.querySelector('#dropzone').addEventListener('drop', function(e) {
var reader = new <b>FileReader</b>();
reader.onload = function(evt) {
document.querySelector('img').src = evt.target.<b>result</b>;
};
reader.<b>readAsDataURL</b>(e.<b>dataTransfer.files[0]</b>);
}, false);
</pre>
</section>
</div>
<div class="slide device-access" id="desktop-drag-out">
<header><span class="js">JS</span> <h1>Desktop Drag-Out</h1></header>
<section id="dnd-section">
<h3>Drag files out onto the desktop:</h3>
<pre>
<a href="src/star.mp3" draggable="true" class="dragout"
data-downloadurl="<b>MIMETYPE:FILENAME:ABSOLUTE_URI_TO_FILE</b>">download</a>
</pre>
<pre>
var files = document.querySelectorAll('.dragout');
for (var i = 0, file; file = files[i]; ++i) {
file.addEventListener('dragstart', function(e) {
e.dataTransfer.setData('DownloadURL', this.dataset.downloadurl);
}, false);
}
</pre>
</section>
</div>
<div class="slide device-access" id="filewriter">
<header><span class="js">JS</span> <h1>FileSystem APIs</h1></header>
<section>
<h3>Asynchronously write a file to a sandboxed file system using JavaScript:</h3>
<pre>
<b>window.requestFileSystem</b>(<b>window.TEMPORARY</b>, 1024 * 1024, function(fs) {
// fs.root is a DirectoryEntry object.
<b>fs.root.getFile</b>('log.txt', {create: true}, function(fileEntry) {
<b>fileEntry.createWriter</b>(function(writer) { // writer is a FileWriter object.
<b>writer.onwrite</b> = function(e) { ... };
<b>writer.onerror</b> = function(e) { ... };
var bb = new BlobBuilder();
bb.append('Hello World!');
<b>writer.write</b>(bb.getBlob('text/plain'));
}, opt_errorHandler);
}
}, opt_errorHandler);
</pre>
</section>
</div>
<div class="slide device-access" id="geolocation">
<header><span class="js">JS</span> <h1>Geolocation</h1></header>
<section>
<pre>if (<b>navigator</b>.<b>geolocation</b>) {
<b>navigator</b>.<b>geolocation</b>.<b>getCurrentPosition</b>(function(position) {
var latLng = new google.maps.LatLng(
position.<b>coords</b>.<b>latitude</b>, position.<b>coords</b>.<b>longitude</b>);
var marker = new google.maps.Marker({position: latLng, map: map});
map.setCenter(latLng);
}, errorHandler);
}
</pre>
</section>
</div>
<div class="slide device-access" id="slide-orientation" onload="os.onload();" onunload="os.onunload();">
<header><span class="js">JS</span> <h1>Device Orientation</h1></header>
<section>
<pre>
window.addEventListener('<em>deviceorientation</em>', function(event) {
var a = event.<b>alpha</b>;
var b = event.<b>beta</b>;
var g = event.<b>gamma</b>;
}, false);
</pre>
</section>
</div>
<div class="slide device-access" id="speech-input">
<header><span class="html">HTML</span> <h1>Speech Input</h1></header>
<section>
<pre><input type="text" <b>x-webkit-speech</b> /></pre>
</section>
</div>
<div class="slide transitionSlide" id="semantics-markup-title">
<section class="middle">
<h2>Semantics & Markup</h2>
<p>More meaningful elements</p>
<img src="http://www.html5rocks.com/static/images/identity/classes_64/HTML5_Semantics_64.png" title="HTML5 Semantics & Markup" alt="HTML5 Semantics & Markup">
</section>
</div>
<div class="slide semantics" id="semantic-tags-1">
<header><span class="html">HTML</span> <h1>Better semantic tags</h1></header>
<section>
<pre class="two-column"><body>
<<b>header</b>>
<<b>hgroup</b>>
<h1>Page title</h1>
<h2>Page subtitle</h2>
</hgroup>
</header>
<<b>nav</b>>
<ul>
Navigation...
</ul>
</nav>
<<b>section</b>>
<<b>article</b>>
<<b>header</b>>
<h1>Title</h1>
</header>
<section>
Content...
</section>
</article>
<article>
<header>
<h1>Title</h1>
</header>
<section>
Content...
</section>
</article>
</section>
<<b>aside</b>>
Top links...
</aside>
<<b>figure</b>>
<img src="..."/>
<<b>figcaption</b>>Chart 1.1</figcaption>
</figure>
<<b>footer</b>>
Copyright ©<br> <<b>time</b> <b>datetime</b>="2010-11-08">2010</time>.
</footer>
</body>
</pre>
</section>
</div>
<div class="slide semantics" id="semantic-tags-2">
<header><span class="html">HTML</span> <h1>Markup for applications</h1></header>
<section>
<pre>
<input <b>list</b>="cars"/>
<<b>datalist</b> id="cars">
<option value="BMW"/>
<option value="Ford"/>
<option value="Volvo"/>
</<b>datalist</b>>
<input id="cars-input" placeholder="You should see an autocomplete menu as you type" list="cars" />
<datalist id="cars">
<option value="BMW" />
<option value="Ford" />
<option value="Volvo" />
</datalist>
<<b>menu</b>>
<<b>command</b> type="command" disabled label="Publish" />
</<b>menu</b>>
<<b>details</b>>
<<b>summary</b>>HTML 5</<b>summary</b>>
This slide deck teaches you everything you need to know about HTML 5.
<<b>/details</b>>
<details><summary>HTML 5</summary>This slide deck teaches you everything you need to know about HTML 5.</details>
</pre>
<pre><<b>meter</b> <b>min</b>="0" <b>max</b>="100" <b>low</b>="40" <b>high</b>="90" <b>optimum</b>="100" value="91">A+</<b>meter</b>>
Your score is: <meter value="91" min="0" max="100" low="40" high="90" optimum="100">A+</meter><br>
<<b>progress</b>>working...</<b>progress</b>>
Download is: <progress>working...</progress><br>
<<b>progress</b> value="75" <b>max</b>="100">3/4 complete</<b>progress</b>>
Goal is: <progress value="75" max="100">3/4 complete</progress>
</pre>
</section>
</div>
<div class="slide semantics" id="link-relations">
<header><span class="html">HTML</span> <h1>Descriptive link relations</h1></header>
<section>
<pre><link <b>rel="alternate"</b> type="application/rss+xml" href="http://myblog.com/feed"/>
<link <b>rel="icon"</b> href="/favicon.ico"/>
<link <b>rel="pingback"</b> href="http://myblog.com/xmlrpc.php"/>
<link <b>rel="prefetch"</b> href="http://myblog.com/main.php"/>
...
<a <b>rel="archives"</b> href="http://myblog.com/archives"><span class="underlined">old posts</span></a>
<a <b>rel="external"</b> href="http://notmysite.com"><span class="underlined">tutorial</span></a>
<a <b>rel="license"</b> href="http://www.apache.org/licenses/LICENSE-2.0"><span class="underlined">license</span></a>
<a <b>rel="nofollow"</b> href="http://notmysite.com/sample"><span class="underlined">wannabe</span></a>
<a <b>rel="tag"</b> href="http://myblog.com/category/games"><span class="underlined">games posts</span></a>
...
</pre>
</section>
</div>
<div class="slide semantics" id="microdata">
<header><span class="html">HTML</span> <h1>Microdata</h1></header>
<section>
<pre><div <b>itemscope itemtype="http://example.org/band"</b>>
<p>My name is <span <b>itemprop="name"</b>>Neil</span>.</p>
<p>My band is called <span <b>itemprop="band"</b>>Four Parts Water</span>.</p>
<p>I am <span <b>itemprop="nationality"</b>>British</span>.</p>
</div>
</pre>
<figure>
<img id="microdata-screenshot" src="src/magpie.png" alt="Google Rich Snippets Tool screenshot" />
<figcaption>Rich Snippets Testing Tool at <a href="http://www.google.com/webmasters/tools/richsnippets">http://www.google.com/webmasters/tools/richsnippet</a></figcaption>
<figure>
</section>
</div>
<div class="slide semantics" id="aria-attributes">
<header><span class="html">HTML</span> <h1>ARIA attributes</h1></header>
<section>
<pre><ul id="tree1"
<b>role</b>="<b>tree</b>"
tabindex="0"
<b>aria-labelledby</b>="label_1">
<li <b>role</b>="<b>treeitem</b>" tabindex="-1" <b>aria-expanded</b>="true">Fruits</li>
<li <b>role</b>="<b>group</b>">
<ul>
<li <b>role</b>="<b>treeitem</b>" tabindex="-1">Oranges</li>
<li <b>role</b>="<b>treeitem</b>" tabindex="-1">Pineapples</li>
...
</ul>
</li>
</ul>
</pre>
</section>
</div>
<div class="slide semantics" id="new-form-types">
<header><span class="html">HTML</span> <h1>New form types</h1></header>
<section>
<pre>
<style>
[required] {
border-color: #88a;
-webkit-box-shadow: 0 0 3px rgba(0, 0, 255, .5);
}
:invalid {
border-color: #e88;
-webkit-box-shadow: 0 0 5px rgba(255, 0, 0, .8);
}
</style>
</pre>
<pre class="form-inputs">
<input type="text" required /><input type="text" <b>required</b> />
<input type="email" value="[email protected]" /><input type="<b>email</b>" value="[email protected]" />
<input type="date" min="2010-08-14" max="2011-08-14" value="2010-08-14" /><input type="<b>date</b>" <b>min</b>="2010-08-14" <b>max</b>="2011-08-14" value="2010-08-14"/>
<input type="range" min="0" max="50" value="10" /><input type="<b>range</b>" <b>min</b>="0" <b>max</b>="50" value="10" />
<input results="10" type="search" placeholder="Search..." /><input type="<b>search</b>" <b>results</b>="10" <b>placeholder</b>="Search..." />
<input type="tel" placeholder="(555) 555-5555" pattern="^\(?\d{3}\)?[-\s]\d{3}[-\s]\d{4}.*?$" /><input type="<b>tel</b>" <b>placeholder</b>="(555) 555-5555"
<b>pattern</b>="^\(?\d{3}\)?[-\s]\d{3}[-\s]\d{4}.*?$" />
<input type="color" placeholder="e.g. #bbbbbb" /><input type="<b>color</b>" <b>placeholder</b>="e.g. #bbbbbb" />
<input type="number" step="1" min="-5" max="10" value="0" /><input type="<b>number</b>" <b>step</b>="1" <b>min</b>="-5" <b>max</b>="10" value="0" />
<div style="height:0px; clear:both;">
</pre>
</section>
</div>
<div class="slide semantics" id="form-types-mobile">
<header><span class="html">HTML</span> <h1>Form field types on mobile</h1></header>
<style type="text/css" media="screen">
#form-types-mobile div {
float: left;
width: 24%;
padding-right: 1%;
text-align: center;
}
#form-types-mobile img {
width: 90%;
-webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 4px 6px;
}
</style>
<section>
<div>
<pre>type="<em>text</em>"</pre>
<figure>
<img src="src/android-form-text.png" alt="android keyboard on input type text" />
<figcaption>Android Device</figcaption>
</figure>
</div>
<div>
<pre>type="<em>number</em>"</pre>
<figure>
<img src="src/android-form-number.png" alt="android keyboard on input type number" />
<figcaption>Android Device</figcaption>
</figure>
</div>
<div>
<pre>type="<em>email</em>"</pre>
<figure>
<img src="src/iphone-form-email.png" alt="iphone keyboard on input type email" />
<figcaption>iPhone Device</figcaption>
</figure>
</div>
<div>
<pre>type="<em>tel</em>"</pre>
<figure>
<img src="src/iphone-form-tel.png" alt="iphone keyboard on input type tel" />
<figcaption>iPhone Device</figcaption>
</figure>
</div>
</section>
</div>
<div class="slide transitionSlide" id="graphics-multimedia-title">
<section class="middle">
<h2>Graphics / Multimedia</h2>
<p>2D & 3D</p>
<img src="http://www.html5rocks.com/static/images/identity/classes_64/HTML5_3D_Effects_64.png" title="HTML5 3D & Effects" alt="HTML5 3D & Effects">
<img src="http://www.html5rocks.com/static/images/identity/classes_64/HTML5_Multimedia_64.png" title="HTML5 Multimedia" alt="HTML5 Multimedia">
</section>
</div>
<div class="slide multimedia" id="video-audio">
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Audio + Video</h1></header>
<section>
<pre><<b>audio</b> id="audio" src="sound.mp3" <b>controls</b>></audio>
document.getElementById("audio").<b>muted</b> = false;
</pre>
<pre>
<<b>video</b> id="video" src="movie.webm" <b>autoplay</b> <b>controls</b>></video>
document.getElementById("video").<b>play</b>();
</pre>
</section>
</div>
<div class="slide multimedia" id="video-track">
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Track Element</h1></header>
<section>
<pre>
<<b>video</b> width="390" id="clip" <b>controls</b>>
<<b>source</b> src="Google_Developer_Stories.webm"
type='video/webm; codecs="vp8, vorbis"' />
<<b>track</b> label="English subtitles" kind="subtitles" srclang="en"
src="<em>video-subtitles-en.vtt</em>" default />
</<b>video</b>>
</pre>
</section>
</div>
<div class="slide" id="fullscreen-api">
<header><span class="css">CSS</span> <span class="js">JS</span> <h1>FullScreen API</h1></header>
<section>
<pre id="snippet">if (elem.<b>webkitRequestFullScreen</b>) {
elem.<b>webkitRequestFullScreen</b>(Element.<em>ALLOW_KEYBOARD_INPUT</em>);
} else if (elem.<b>mozRequestFullScreen</b>) {
elem.<b>mozRequestFullScreen</b>();
} else if (elem.<b>requestFullScreen</b>){
elem.<b>requestFullScreen</b>();
}
</pre>
<pre><b>:-webkit-full-screen-ancestor</b>:root {
overflow: hidden;
}
<b>:-webkit-full-screen-ancestor</b> {
z-index: auto;
-webkit-transform: none;
-webkit-transition: none;
}
pre<b>:-webkit-full-screen</b> {
background-color: white;
}
</pre>
</section>
</div>
<div class="slide effects" id="canvas-2d">
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Canvas 2D</h1></header>
<section>
<pre><canvas id="canvas" width="838" height="220"></canvas>
<script>
var canvasContext = document.getElementById("canvas").<b>getContext</b>("2d");
canvasContext.<b>fillRect</b>(250, 25, 150, 100);
canvasContext.<b>beginPath</b>();
canvasContext.<b>arc</b>(450, 110, 100, Math.PI * 1/2, Math.PI * 3/2);
canvasContext.<b>lineWidth</b> = 15;
canvasContext.<b>lineCap</b> = 'round';
canvasContext.<b>strokeStyle</b> = 'rgba(255, 127, 0, 0.5)';
canvasContext.<b>stroke</b>();
</script></pre>
</section>
</div>
<div class="slide effects" id="canvas-2d-example">
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Canvas example</h1></header>
<section>
</section>
</div>
<div class="slide effects" id="canvas-3d">
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Canvas 3D (WebGL)</h1></header>
<section>
<pre><canvas id="canvas" width="838" height="220"></canvas>
<script>
var gl = document.getElementById("canvas").<b>getContext</b>("experimental-webgl");
gl.<b>viewport</b>(0, 0, canvas.width, canvas.height);
...
</script>
</pre>
</section>
</div>
<div class="slide effects" id="inline-svg">
<header><span class="html">HTML</span> <h1>Inline SVG</h1></header>
<section>
<pre><html>
<svg width="300px" height="300px">
<defs>
<linearGradient id="<b>myGradient</b>" x1="0%" y1="100%" x2="100%" y2="0%">
<stop offset="5%" stop-color="red"></stop>
<stop offset="95%" stop-color="blue" stop-opacity="0.5"></stop>
</linearGradient>
</defs>
<circle id="myCircle" class="important" cx="50%" cy="50%" r="<span id="svg-circle-r-value">100</span>" <input id="svg-circle-r" type="range" min="50" max="150" value="100" onchange="changeSvgCircleRadius()"/>
fill="<b>url(#myGradient)</b>" onmousedown="alert('hello');"/>
</svg></b>
</html></pre>
</section>
</div>
<div class="slide effects" id="svg-example-slide">
<header><span class="html">HTML</span> <h1>SVG example</h1></header>
<section>
</section>
</div>
<div class="slide transitionSlide" id="css3-title">
<section class="middle">
<h2>CSS3</h2>
<p>Presentation & Styling</p>
<img src="http://www.html5rocks.com/static/images/identity/classes_64/HTML5_Styling_64.png" title="HTML5 Styling" alt="HTML5 Styling">
</section>
</div>
<div class="slide styling" id="css-selectors">
<header><span class="css">CSS</span> <h1>CSS Selectors</h1></header>
<section class="left">
<h2>Selectors</h2>
<pre>.row:<b>nth-child(even)</b> {
background: #dde;
}
.row:<b>nth-child(odd)</b> {
background: white;
}
</pre>
<h2>Image-like display</h2>
<pre>div {
display: <b>inline-block</b>;
}
</pre>
</section>
<section class="right">
<h2>Specific attributes</h2>
<pre>input<b>[type="text"]</b> {
background: #eee;
}</pre>
<h2>Negation</h2>
<pre><b>:not</b>(.box) {
color: #00c;
}
<b>:not</b>(span) {
display: block;
}
</pre>
<h2>More specific targetting</h2>
<pre>h2:<b>first-child</b> { ... }
div.text <b>></b> div { ... }
h2 <b>+</b> header { ... }
</pre>
</section>
<footer><a href="http://www.w3.org/TR/CSS2/selector.html#pattern-matching">CSS2 selectors</a> and <a href="http://www.w3.org/TR/css3-selectors/#selectors">CSS3 selectors</a> introduced some of the ones demonstrated here.</footer>
</div>
<div class="slide styling" id="web-fonts">
<header><span class="css">CSS</span> <h1>Webfonts</h1></header>
<section>
<pre><b>@font-face</b> {
font-family: 'LeagueGothic';
src: url(LeagueGothic.otf);
}
<b>@font-face</b> {
font-family: 'Droid Sans';
src: url(Droid_Sans.ttf);
}
header {
font-family: 'LeagueGothic';
}</pre>
</section>
</div>
<div class="slide styling" id="text-wrapping">
<header><span class="css">CSS</span> <h1>Text wrapping</h1></header>
<section>
<pre>div {
<b>text-overflow: ellipsis;</b>
}</pre>
</section>
</div>
<div class="slide styling" id="css-columns">
<header><span class="css">CSS</span> <h1>Columns</h1></header>
<section>
<pre>-webkit-<b>column-count</b>: <span id="columns-no-value">2</span>;
-webkit-<b>column-rule</b>: 1px solid #bbb;
-webkit-<b>column-gap</b>: 2em;</pre>
</section>
</div>
<div class="slide styling" id="css-stroke">
<header><span class="css">CSS</span> <h1>Text stroke</h1></header>
<section>
<pre>div {
-webkit-<b>text-fill-color</b>: black;
-webkit-<b>text-stroke-color</b>: red;
-webkit-<b>text-stroke-width</b>: <span id="text-stroke-value">0.00</span>px;
}</pre>
</section>
</div>
<div class="slide styling" id="css-opacity">
<header><span class="css">CSS</span> <h1>Opacity</h1></header>
<section>
<pre> color: <b>rgba</b>(255, 0, 0, <span id="opacity-color-value">0.75</span>);
background: <b>rgba</b>(0, 0, 255, <span id="opacity-background-value">0.75</span>);
</pre>
</section>
</div>
<div class="slide styling" id="css-color">
<header><span class="css">CSS</span> <h1>Hue/saturation/luminance color</h1></header>
<section>
<pre>color: <b>hsla</b>(
<span class="hsl-value" id="hsl-h-value">128</span>
<span class="hsl-value" id="hsl-s-value">74%</span>
<span class="hsl-value" id="hsl-l-value">33%</span>
<span class="hsl-value" id="hsl-a-value">1.00</span>
</pre>
</section>
</div>
<div class="slide styling" id="rounded-corners">
<header><span class="css">CSS</span> <h1>Rounded corners</h1></header>
<section>
<pre>
face: <b>border-radius</b>: <span id="face-rounded-border-value">0</span>px;
left eye: <b>border-radius</b>: <span id="lefteye-rounded-border-value">0</span>px;
right eye: <b>border-radius</b>: <span id="righteye-rounded-border-value">0</span>px;
base white: <b>border-radius</b>: <span id="base_white-rounded-border-value">0</span>px;
mouth: <b>border-radius</b>: <span id="mouth-rounded-border-value">0</span>px;
nose: <b>border-radius</b>: <span id="nose-rounded-border-value">0</span>px;
left black eye: <b>border-radius</b>: <span id="leftblackeye-rounded-border-value">0</span>px;
right black eye: <b>border-radius</b>: <span id="rightblackeye-rounded-border-value">0</span>px;
</pre>
</section>
</div>
<div class="slide styling" id="css-gradients">
<header><span class="css">CSS</span> <h1>Gradients</h1></header>
<section>
<pre>background-image: <b>linear-gradient</b>(top, <span style="text-shadow: #00abeb 0 0 1px; color: #00abeb">#00abeb</span> 0%, #fff 50%,
<span style="text-shadow: #00abeb 0 0 1px; color: #66cc00">#66cc00</span> 50%, #fff 100%);
</pre>
<br />
<pre>background-image: <b>radial-gradient</b>(center, circle cover, red, #000 <span id="gradients-radial-value">40</span>%);
</pre>
</section>
</div>
<div class="slide styling" id="css-shadow">
<header><span class="css">CSS</span> <h1>Shadows</h1></header>
<section>
<pre class="two-column"><b>text-shadow</b>:
rgba(64, 64, 64, 0.5)
<span id="shadows-text-x-value">0</span>px <input id="shadows-text-x" type="range" min="-9" max="9" value="0" onchange="changeShadow(event)">
<span id="shadows-text-y-value">0</span>px <input id="shadows-text-y" type="range" min="-9" max="9" value="0" onchange="changeShadow(event)">
<span id="shadows-text-size-value">0</span>px; <input id="shadows-text-size" type="range" min="0" max="9" value="0" onchange="changeShadow(event)">
<br><b>box-shadow</b>:
rgba(0, 0, 128, 0.25)
<span id="shadows-box-x-value">0</span>px <input id="shadows-box-x" type="range" min="-9" max="9" value="0" onchange="changeShadow(event)">
<span id="shadows-box-y-value">0</span>px <input id="shadows-box-y" type="range" min="-9" max="9" value="0" onchange="changeShadow(event)">
<span id="shadows-box-size-value">0</span>px; <input id="shadows-box-size" type="range" min="0" max="9" value="0" onchange="changeShadow(event)">
</pre>
</section>
</div>
<div class="slide styling" id="logo-demo">
<header><span class="css">CSS</span> <h1>Instant Web 2.0 (just add sliders)</h1></header>
<section>
<pre><b>text-shadow</b>: rgba(0, 0, 0, 0.5) 0 <span id="web20-shadow-value-1">0</span>px <span id="web20-shadow-value-2">0</span>px; <input id="web20-shadow" type="range" min="0" max="9" value="0" onchange="changeWeb20(event)">
background:
-<b>webkit-gradient</b>(linear, left top, left bottom, <input id="web20-gradient" type="range" min="0" max="100" value="0" onchange="changeWeb20(event)">
from(rgba(200, 200, 240, <span id="web20-gradient-value-1">0</span>)), to(rgba(255, 255, 255, <span id="web20-gradient-value-2">0</span>)));
<b>border-radius</b>: <span id="web20-border-value">0</span>px; <input id="web20-border" type="range" min="0" max="50" value="0" onchange="changeWeb20(event)">
-webkit-<b>box-reflect</b>: below 10px
-webkit-gradient(linear, left top, left bottom, <input id="web20-reflect" type="range" min="0" max="100" value="0" onchange="changeWeb20(event)">
from(transparent), to(rgba(255, 255, 255, <span id="web20-reflect-value">0</span>)));
</pre>
</section>
</div>
<div class="slide styling" id="css-background">
<header><span class="css">CSS</span> <h1>Background enhancements</h1></header>
<section>
<h2>Background sizing</h2>
<pre>#logo {
background: url(logo.gif) center center no-repeat;
<b>background-size: auto|contain|cover|100%;</b>
}
</pre>
<h2>Multiple backgrounds</h2>
<pre>div {
background: url(src/zippy-plus.png) 10px center no-repeat,
url(src/gray_lines_bg.png) 0 center repeat-x;
}
</pre>
</section>
</div>
<div class="slide styling" id="border-image">
<header><span class="css">CSS</span> <h1>Border image</h1></header>
<section>
<pre><div class="img-frame selected" onclick="changeBorderImageSource(event)"><img id="border_image_1" src="src/borderimage/border_image_1.png" width="100" height="100" alt="Border image No.1" />
</div><div class="img-frame" onclick="changeBorderImageSource(event)"><img id="border_image_2" src="src/borderimage/border_image_2.png" width="100" height="100" alt="Border image No.2" />
</div><div class="img-frame" onclick="changeBorderImageSource(event)"><img id="border_image_3" src="src/borderimage/border_image_3.png" width="100" height="100" alt="Border image No.3" />
</div><div class="img-frame" onclick="changeBorderImageSource(event)"><img id="border_image_4" src="src/borderimage/border_image_4.png" width="100" height="100" alt="Border image No.4" />
</div><div class="img-frame" onclick="changeBorderImageSource(event)"><img id="border_image_5" src="src/borderimage/border_image_5.png" width="100" height="100" alt="Border image No.5" />
</div><div style="clear:both;"></div>
-webkit-<b>border-image</b>: url(<span id="border_image_name">border_image_1</span>.png)</span> <select onchange="changeBorderImage()">
<option value="20%">20%</option>
<option value="40%">40%</option>
<option value="15">15</option>
<option value="33">33</option>
<option value="50">50</option>
</select> <select onchange="changeBorderImage()">
<option value="stretch">stretch</option>
<option value="repeat">repeat</option>
<option value="round">round</option></select> <select onchange='changeBorderImage()'>
<option value="stretch">stretch</option>
<option value="repeat">repeat</option>
<option value="round">round</option></select>;
border-width: <span id="border_width_value">10</span>px; <input id="border_width_range" type="range" min="0" max="50" value="10" onchange="changeBorderWidth(event)" /></pre>
<div class="example">
<div id="border-image-example" style="border-width: 10px; -webkit-border-image: url(src/borderimage/border_image_1.png) 20% stretch stretch;">
</div>
</div>
</section>
</div>
<div class="slide styling" id="flex-box-1">
<header><span class="css">CSS</span> <h1>Flexible Box Model</h1></header>
<section>
<pre>.box {
display: -webkit-<b>box</b>;
-webkit-<b>box-orient</b>: <select onchange='changeBoxOrient(event)'>
<option>horizontal</option>
<option>vertical</option>
</select>;
}
.box .one, .box .two {
-webkit-<b>box-flex</b>: 1;
}
.box .three {
-webkit-<b>box-flex</b>: 3;
}
</pre>
<div id="box-orient-example" class="example">
<div>
Box one
</div>
<div>
Box two
</div>
<div>
Box three
</div>
</div>
</section>
</div>
<div class="slide styling" id="flex-box-2">
<header><span class="css">CSS</span> <h1>Flexible Box Model</h1></header>
<section>
<pre>.box {
display: -webkit-<b>box</b>;
-webkit-<b>box-pack</b>: <select onchange='changeBoxPack(event)'>
<option>center</option>
<option>start</option>
<option>end</option>
</select>;
-webkit-<b>box-align</b>: <select onchange='changeBoxAlign(event)'>
<option>center</option>
<option>start</option>
<option>end</option>
<option>stretch</option>
</select>;
}
</pre>
<div id="box-orient-example-2" class="example">
<textarea>change the dropdowns and resize this <textarea></textarea>
</div>
</section>
</div>
<div class="slide styling" id="css-transitions">
<header><span class="css">CSS</span> <h1>Transitions</h1></header>
<section>
<div class="transitions example">
<div id="transitions-box-1"></div>
</div>
<pre>#box.left {
margin-left: 0;
}
#box.right {
margin-left: 1000px;
}
document.getElementById('box').className = 'left'; <button onclick="transitionLeft(1)">Left</button>
document.getElementById('box').className = 'right'; <button onclick="transitionRight(1)">Right</button>
</pre>
<div class="transitions example">
<div id="transitions-box-2"></div>
</div>
<pre>#box {
-webkit-<b>transition</b>: margin-left 1s ease-in-out;
}
document.getElementById('box').className = 'left'; <button onclick="transitionLeft(2)">Left</button>
document.getElementById('box').className = 'right'; <button onclick="transitionRight(2)">Right</button>
</pre>
</section>
</div>
<div class="slide styling" id="css-transforms">
<header><span class="css">CSS</span> <h1>Transforms</h1></header>
<section>
<p class="center">
Hover over me:
</p>
<pre id="threed-example">-webkit-<b>transform</b>: <b>rotateY</b>(45deg);
-webkit-transform: <b>scaleX</b>(25deg);
-webkit-transform: <b>translate3d</b>(0, 0, 90deg);
-webkit-transform: <b>perspective</b>(500px)
</pre>
<pre>#threed-example {
-webkit-transform: rotateZ(5deg);
-webkit-transition: -webkit-transform 2s ease-in-out;
}
#threed-example:hover {