-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1489 lines (1372 loc) · 93.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
<!DOCTYPE html>
<!-- saved from url=(0044)http://slides.html5rocks.com/#new-form-types -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
<title>HTML5 Presentation</title>
<link href="./HTML5_files/css" rel="stylesheet" type="text/css">
<link id="prettify-link" href="HTML5_files/prettify.css" rel="stylesheet" disabled="">
<link href="./HTML5_files/moon.css" class="theme" rel="stylesheet" disabled="">
<link href="./HTML5_files/sand.css" class="theme" rel="stylesheet" disabled="">
<link href="./HTML5_files/sea_wave.css" class="theme" rel="stylesheet" disabled="">
<link href="./HTML5_files/default.css" class="theme" rel="stylesheet" media="screen">
</head>
<body>
<div class="presentation">
<div id="presentation-counter">28</div>
<div class="slides" style="display: block; ">
<div class="slide distant-slide" id="landing-slide">
<style>
#landing-slide p {
font-size: 22px;
}
p#disclaimer-message {
margin-top: 150px;
font-size: 20px;
}
#landing-slide header {
position: relative;
left: 0;
margin-top: 180px;
}
#landing-slide h2 {
font-size: 28px;
}
.logo {
position: absolute;
top: 40px;
left: 30px;
}
</style>
<img src="HTML5_files/g_senegal.png" class="logo"/>
<section class="middle">
<header>
<hgroup>
<h1>HTML 5 pratique</h1>
<h2>Basé sur <a href="http://slides.html5rocks.com">html5rocks.com</a>, recuit par Thierry Le Boulengé</h2>
</hgroup>
</header>
<p>Présentation faite en HTML5. Utiliser <span id="left-init-key" class="key">→</span> pour page suivante.</p>
<p id="disclaimer-message">G|Sénégal, 21-22 fév. 2011</p>
</section>
<span class="counter">1</span></div>
<div class="slide distant-slide" id="timeline-slide">
<header>Ligne du temps des technologies du Web.</header>
<section>
<style>
span.year {
display: inline-block;
text-align: right;
width: 120px;
letter-spacing: -2px;
padding-right: 10px;
}
hr {
visibility: hidden;
padding: 0;
margin: 0 0 -20px 0;
}
#timeline {
margin-top: 15px;
font-size: 50px;
}
#timeline li {
padding: 0;
}
</style>
<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">Web Design sans <table>s.</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>
<span class="counter">2</span></div>
<div class="slide distant-slide" id="html-1992">
<header><span class="html">HTML</span> <h1>HTML en 1996</h1></header>
<section>
<style>
#html-histo li {
list-style:circle;
font-size: 24px;
line-height: 2em;
}
#html-1992 iframe {
width: 800px;
height: 520px;
}
#html-1992 figcaption {
margin-top: 1em;
display: block;
}
</style>
<figure>
<iframe src="HTML5_files/yahoo.html"></iframe>
<figcaption>Voir aussi <a href="http://www.w3.org/History/19921103-hypertext/hypertext/WWW/TheProject.html">Le tout premier site web</a>.</figcaption>
</figure>
</section>
<span class="counter">3</span></div>
<div class="slide distant-slide" id="html-histo">
<header><span class="html">HTML</span> <h1>Normer le langage HTML</h1></header>
<section>
<style>
#html-histo li {
list-style:circle;
font-size: 24px;
line-height: 2em;
}
</style>
<ul>
<li>Depuis 1991</li>
<li>... mais toujours utilisable!</li>
<li>Pages web non-valides: 99%</li>
<li>HTML: Jeu d'équilibre entre auteurs, normateurs et implémenteurs.</li>
<li>Tentatives de normer plus strictement (XHTML, XFroms)?</li>
<li>HTML5 = Compatibilité</li>
</ul>
</section>
<span class="counter">4</span></div>
<div class="slide distant-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>
<span class="counter">5</span></div>
<div class="slide transitionSlide distant-slide" id="semantics-markup-title">
<section class="middle">
<h2>Markup sémantique</h2>
<p>Quelques additions bienvenues!</p>
<img src="./HTML5_files/HTML5_Semantics_64.png" title="HTML5 Semantics & Markup" alt="HTML5 Semantics & Markup">
</section>
<span class="counter">6</span></div>
<div class="slide semantics distant-slide" id="semantic-tags-1">
<header><span class="html">HTML</span> <h1>Nouveaux tags descriptifs</h1></header>
<section>
<style>
#semantic-tags-1 {
font-size: 95%;
}
</style>
<pre class="two-column prettyprint"><span class="tag"><body></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">header</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">hgroup</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><h1></span><span class="pln">Page title</span><span class="tag"></h1></span><span class="pln"><br> </span><span class="tag"><h2></span><span class="pln">Page subtitle</span><span class="tag"></h2></span><span class="pln"><br> </span><span class="tag"></hgroup></span><span class="pln"><br> </span><span class="tag"></header></span><span class="pln"><br><br> </span><span class="tag"><</span><b><span class="tag">nav</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><ul></span><span class="pln"><br> Navigation...<br> </span><span class="tag"></ul></span><span class="pln"><br> </span><span class="tag"></nav></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">section</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">article</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">header</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><h1></span><span class="pln">Title</span><span class="tag"></h1></span><span class="pln"><br> </span><span class="tag"></header></span><span class="pln"><br> </span><span class="tag"><section></span><span class="pln"><br> Content...<br> </span><span class="tag"></section></span><span class="pln"><br> </span><span class="tag"></article></span><span class="pln"><br> </span><span class="tag"><article></span><span class="pln"><br> </span><span class="tag"><header></span><span class="pln"><br> </span><span class="tag"><h1></span><span class="pln">Title</span><span class="tag"></h1></span><span class="pln"><br> </span><span class="tag"></header></span><span class="pln"><br> </span><span class="tag"><section></span><span class="pln"><br> Content...<br> </span><span class="tag"></section></span><span class="pln"><br> </span><span class="tag"></article></span><span class="pln"><br> </span><span class="tag"></section></span><span class="pln"><br><br> </span><span class="tag"><</span><b><span class="tag">aside</span></b><span class="tag">></span><span class="pln"><br> Top links...<br> </span><span class="tag"></aside></span><span class="pln"><br><br> </span><span class="tag"><</span><b><span class="tag">figure</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><img</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"..."</span><span class="tag">/></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">figcaption</span></b><span class="tag">></span><span class="pln">Chart 1.1</span><span class="tag"></figcaption></span><span class="pln"><br> </span><span class="tag"></figure></span><span class="pln"><br><br> </span><span class="tag"><</span><b><span class="tag">footer</span></b><span class="tag">></span><span class="pln"><br> Copyright ©<br> </span><span class="tag"><</span><b><span class="tag">time</span></b><span class="pln"> </span><b><span class="atn">datetime</span></b><span class="pun">=</span><span class="atv">"2010-11-08"</span><span class="tag">></span><span class="pln">2010</span><span class="tag"></time></span><span class="pln">.<br> </span><span class="tag"></footer></span><span class="pln"><br></span><span class="tag"></body></span></pre>
</section>
<span class="counter">7</span></div>
<div class="slide semantics distant-slide" id="semantic-tags-2">
<header><span class="html">HTML</span> <h1>Markup pour les applicatifs</h1></header>
<style>
#cars-input {
width: 500px;
}
#semantic-tags-2 pre {
font-size: 90%;
}
</style>
<section>
<pre class="prettyprint"><span class="tag"><input</span><span class="pln"> </span><b><span class="atn">list</span></b><span class="pun">=</span><span class="atv">"cars"</span><span class="tag">/></span><span class="pln"><br></span><span class="tag"><</span><b><span class="tag">datalist</span></b><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"cars"</span><span class="tag">></span><span class="pln"><br> </span><span class="tag"><option</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"BMW"</span><span class="tag">/></span><span class="pln"><br> </span><span class="tag"><option</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"Ford"</span><span class="tag">/></span><span class="pln"><br> </span><span class="tag"><option</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"Volvo"</span><span class="tag">/></span><span class="pln"><br></span><span class="tag"></</span><b><span class="tag">datalist</span></b><span class="tag">></span><span class="pln"><br></span><input id="cars-input" placeholder="L'autocomplétion en action..." list="cars"><span class="pln"><br></span><datalist id="cars"><span class="pln"><br> </span><option value="BMW"><span class="pln"><br> </span></option><option value="Ford"><span class="pln"><br> </span></option><option value="Volvo"><span class="pln"><br></span></option></datalist><span class="pln"><br></span><span class="tag"><</span><b><span class="tag">menu</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">command</span></b><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"command"</span><span class="tag">></span><span class="pln">Save as...</span><span class="tag"></</span><b><span class="tag">command</span></b><span class="tag">></span><span class="pln"><br></span><span class="tag"></</span><b><span class="tag">menu</span></b><span class="tag">></span><span class="pln"><br><br></span><span class="tag"><</span><b><span class="tag">details</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><</span><b><span class="tag">summary</span></b><span class="tag">></span><span class="pln">HTML 5</span><span class="tag"></</span><b><span class="tag">summary</span></b><span class="tag">></span><span class="pln"><br> This slide deck teaches you everything you need to know about HTML 5.<br></span><span class="tag"><</span><b><span class="tag">/details</span></b><span class="tag">></span></pre>
<pre class="prettyprint"><span class="tag"><</span><b><span class="tag">meter</span></b><span class="pln"> </span><b><span class="atn">min</span></b><span class="pun">=</span><span class="atv">"0"</span><span class="pln"> </span><b><span class="atn">max</span></b><span class="pun">=</span><span class="atv">"100"</span><span class="pln"> </span><b><span class="atn">low</span></b><span class="pun">=</span><span class="atv">"40"</span><span class="pln"> </span><b><span class="atn">high</span></b><span class="pun">=</span><span class="atv">"90"</span><span class="pln"> </span><b><span class="atn">optimum</span></b><span class="pun">=</span><span class="atv">"100"</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"91"</span><span class="tag">></span><span class="pln">A+</span><span class="tag"></</span><b><span class="tag">meter</span></b><span class="tag">></span><span class="pln"><br>Your score is: </span><meter value="91" min="0" max="100" low="40" high="90" optimum="100"><span class="pln">A+</span></meter><span class="pln"><br><br></span><span class="tag"><</span><b><span class="tag">progress</span></b><span class="tag">></span><span class="pln">working...</span><span class="tag"></</span><b><span class="tag">progress</span></b><span class="tag">></span><span class="pln"><br>Download is: </span><progress><span class="pln">working...</span></progress><span class="pln"><br><br></span><span class="tag"><</span><b><span class="tag">progress</span></b><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"75"</span><span class="pln"> </span><b><span class="atn">max</span></b><span class="pun">=</span><span class="atv">"100"</span><span class="tag">></span><span class="pln">3/4 complete</span><span class="tag"></</span><b><span class="tag">progress</span></b><span class="tag">></span><span class="pln"><br>Goal is: </span><progress value="75" max="100"><span class="pln">3/4 complete</span></progress></pre>
</section>
<span class="counter">8</span></div>
<div class="slide semantics far-future" id="new-form-types">
<header><span class="html">HTML</span> <h1>Nouveaux types de champs</h1></header>
<section>
<style>
.form-inputs {
font-size: 80%;
}
.form-inputs input {
float: right;
border: 1px solid #CCC;
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset;
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset;
-o-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset;
box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset;
padding: 3px 5px;
}
input:invalid {
border-color: #e88;
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, 0 0 5px rgba(255, 0, 0, .8);
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, 0 0 5px rgba(255, 0, 0, .8);
-o-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, 0 0 5px rgba(255, 0, 0, .8);
box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, 0 0 5px rgba(255, 0, 0, .8);
}
input[required] {
border-color: #88a;
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, rgba(0, 0, 255, 0.5) 0px 0px 3px;
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, rgba(0, 0, 255, 0.5) 0px 0px 3px;
-o-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, rgba(0, 0, 255, 0.5) 0px 0px 3px;
box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 3px inset, rgba(0, 0, 255, 0.5) 0px 0px 3px;
}
</style>
<pre class="prettyprint"><span class="tag"><style></span><span class="pln"><br> </span><span class="pun">:</span><span class="pln">invalid </span><span class="pun">{</span><span class="pln"> <br> border</span><span class="pun">-</span><span class="pln">color</span><span class="pun">:</span><span class="pln"> </span><span class="com">#e88;</span><span class="pln"><br> </span><span class="pun">-</span><span class="pln">webkit</span><span class="pun">-</span><span class="pln">box</span><span class="pun">-</span><span class="pln">shadow</span><span class="pun">:</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="lit">5px</span><span class="pln"> rgba</span><span class="pun">(</span><span class="lit">255</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="pun">.</span><span class="lit">8</span><span class="pun">);</span><span class="pln"><br> </span><span class="pun">}</span><span class="pln"><br> </span><span class="pun">[</span><span class="pln">required</span><span class="pun">]</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> border</span><span class="pun">-</span><span class="pln">color</span><span class="pun">:</span><span class="pln"> </span><span class="com">#88a;</span><span class="pln"><br> </span><span class="pun">-</span><span class="pln">webkit</span><span class="pun">-</span><span class="pln">box</span><span class="pun">-</span><span class="pln">shadow</span><span class="pun">:</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="lit">0</span><span class="pln"> </span><span class="lit">3px</span><span class="pln"> rgba</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> </span><span class="lit">255</span><span class="pun">,</span><span class="pln"> </span><span class="pun">.</span><span class="lit">5</span><span class="pun">);</span><span class="pln"><br> </span><span class="pun">}</span><span class="pln"><br></span><span class="tag"></style></span></pre>
<pre class="form-inputs prettyprint"><input type="text" required=""><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text"</span><span class="pln"> </span><b><span class="atn">required</span></b><span class="pln"> </span><span class="tag">/></span><span class="pln"><br><br></span><input type="email" value="some@email.com"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">email</span></b><span class="atv">"</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"some@email.com"</span><span class="pln"> </span><span class="tag">/></span><span class="pln"><br><br></span><input type="date" min="2010-08-14" max="2011-08-14" value="2010-08-14"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">date</span></b><span class="atv">"</span><span class="pln"> </span><b><span class="atn">min</span></b><span class="pun">=</span><span class="atv">"2010-08-14"</span><span class="pln"> </span><b><span class="atn">max</span></b><span class="pun">=</span><span class="atv">"2011-08-14"</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"2010-08-14"</span><span class="tag">/></span><span class="pln"><br><br></span><input type="range" min="0" max="50" value="10"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">range</span></b><span class="atv">"</span><span class="pln"> </span><b><span class="atn">min</span></b><span class="pun">=</span><span class="atv">"0"</span><span class="pln"> </span><b><span class="atn">max</span></b><span class="pun">=</span><span class="atv">"50"</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"10"</span><span class="pln"> </span><span class="tag">/></span><span class="pln"><br><br></span><input results="10" type="search" placeholder="Search..."><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">search</span></b><span class="atv">"</span><span class="pln"> </span><b><span class="atn">results</span></b><span class="pun">=</span><span class="atv">"10"</span><span class="pln"> </span><b><span class="atn">placeholder</span></b><span class="pun">=</span><span class="atv">"Search..."</span><span class="pln"> </span><span class="tag">/></span><span class="pln"><br><br></span><input type="tel" placeholder="(555) 555-5555" pattern="^\(?\d{3}\)?[-\s]\d{3}[-\s]\d{4}.*?$"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">tel</span></b><span class="atv">"</span><span class="pln"> </span><span class="atn">placeholder</span><span class="pun">=</span><span class="atv">"(555) 555-5555"</span><span class="pln"><br> </span><b><span class="atn">pattern</span></b><span class="pun">=</span><span class="atv">"^\(?\d{3}\)?[-\s]\d{3}[-\s]\d{4}.*?$"</span><span class="pln"> </span><span class="tag">/></span><span class="pln"><br><br></span><input type="color" placeholder="e.g. #bbbbbb"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">color</span></b><span class="atv">"</span><span class="pln"> </span><b><span class="atn">placeholder</span></b><span class="pun">=</span><span class="atv">"e.g. #bbbbbb"</span><span class="pln"> </span><span class="tag">/></span><span class="pln"><br><br></span><input type="number" step="1" min="-5" max="10" value="0"><span class="tag"><input</span><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">number</span></b><span class="atv">"</span><span class="pln"> </span><b><span class="atn">step</span></b><span class="pun">=</span><span class="atv">"1"</span><span class="pln"> </span><b><span class="atn">min</span></b><span class="pun">=</span><span class="atv">"-5"</span><span class="pln"> </span><b><span class="atn">max</span></b><span class="pun">=</span><span class="atv">"10"</span><span class="pln"> </span><span class="atn">value</span><span class="pun">=</span><span class="atv">"0"</span><span class="pln"> </span><span class="tag">/></span></pre>
</section>
<span class="counter">9</span></div>
<div class="slide semantics far-future" id="form-types-mobile">
<header><span class="html">HTML</span> <h1>...sur téléphone portable</h1></header>
<section>
<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>
<div>
<pre class="prettyprint"><span class="pln">type</span><span class="pun">=</span><span class="str">"</span><em><span class="str">text</span></em><span class="str">"</span></pre>
<figure>
<img src="./HTML5_files/android-form-text.png" alt="android keyboard on input type text">
<figcaption>Téléphone Android</figcaption>
</figure>
</div>
<div>
<pre class="prettyprint"><span class="pln">type</span><span class="pun">=</span><span class="str">"</span><em><span class="str">number</span></em><span class="str">"</span></pre>
<figure>
<img src="./HTML5_files/android-form-number.png" alt="android keyboard on input type number">
<figcaption>Téléphone Android</figcaption>
</figure>
</div>
<div>
<pre class="prettyprint"><span class="pln">type</span><span class="pun">=</span><span class="str">"</span><em><span class="str">email</span></em><span class="str">"</span></pre>
<figure>
<img src="./HTML5_files/iphone-form-email.png" alt="iphone keyboard on input type email">
<figcaption>iPhone</figcaption>
</figure>
</div>
<div>
<pre class="prettyprint"><span class="pln">type</span><span class="pun">=</span><span class="str">"</span><em><span class="str">tel</span></em><span class="str">"</span></pre>
<figure>
<img src="./HTML5_files/iphone-form-tel.png" alt="iphone keyboard on input type tel">
<figcaption>iPhone</figcaption>
</figure>
</div>
</section>
<span class="counter">10</span></div>
<div class="slide semantics distant-slide" id="microdata">
<style>
#microdata-screenshot {
width: 84%;
margin: 0 auto;
display: block;
border: 3px solid #ccc;
}
#microdata figure {
display: block;
text-align: center;
margin: 30px;
}
#microdata figcaption {
display: block;
}
</style>
<header><span class="html">HTML</span> <h1>Microdata</h1></header>
<section>
<pre class="prettyprint"><span class="tag"><div</span><span class="pln"> </span><b><span class="atn">itemscope</span><span class="pln"> </span><span class="atn">itemtype</span><span class="pun">=</span><span class="atv">"http://data-vocabulary.org/Person"</span></b><span class="tag">></span><span class="pln"><br> </span><span class="tag"><p></span><span class="pln">Je suis </span><span class="tag"><span</span><span class="pln"> </span><b><span class="atn">itemprop</span><span class="pun">=</span><span class="atv">"name"</span></b><span class="tag">></span><span class="pln">Thierry</span><span class="tag"></span></span><span class="pln">.</span><span class="tag"></p></span><span class="pln"><br> </span><span class="tag"><p></span><span class="pln">Je travaille comme </span><span class="tag"><span</span><span class="pln"> </span><b><span class="atn">itemprop</span><span class="pun">=</span><span class="atv">"title"</span></b><span class="tag">></span><span class="pln">Software Engineer</span><span class="tag"></span></span><span class="pln">.</span><span class="tag"></p></span><span class="pln"><br> </span><span class="tag"><p></span><span class="pln">Je vis en </span><span class="tag"><span</span><span class="pln"> </span><b><span class="atn">itemprop</span><span class="pun">=</span><span class="atv">"address.country-name"</span></b><span class="tag">></span><span class="pln">Suisse</span><span class="tag"></span></span><span class="pln">.</span><span class="tag"></p></span><span class="pln"><br></span><span class="tag"></div></span></pre>
<figure>
<img id="microdata-screenshot" src="./HTML5_files/tlb-wo-micro.png" alt="Google results without microdata">
<figcaption>Google serach result without microdata</figcaption>
</figure>
<figure>
<img id="microdata-screenshot" src="./HTML5_files/tlb-with-micro.png" alt="Google results without microdata">
<figcaption>Google serach result with microdata</figcaption>
</figure>
<p>Rich Snippets Testing Tool at <a href="http://www.google.com/webmasters/tools/richsnippets">http://www.google.com/webmasters/tools/richsnippet</a></p>
</section>
<span class="counter">11</span></div>
<div class="slide transitionSlide distant-slide" id="offline-storage-title">
<section class="middle">
<h2>Le réseau sans réseau</h2>
<p>Gérer les interruptions de service </p>
<img src="./HTML5_files/HTML5_Offline_Storage_64.png" title="HTML5 Offline & Storage" alt="HTML5 Offline & Storage">
</section>
<span class="counter">12</span></div>
<div class="slide offline-storage distant-slide" id="web-storage">
<style>
#ta {
width: 400px;
height: 150px;
display: block;
}
#localstorage-message {
padding-top: 50px;
}
</style>
<header><span class="js">JS</span> <h1>Données sur le client</h1></header>
<section>
<pre class="prettyprint"><span class="com">// use localStorage for persistent storage</span><span class="pln"><br></span><span class="com">// use sessionStorage for per tab storage</span><span class="pln"><br>textarea</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'keyup'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pln"> </span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> window</span><span class="pun">.</span><b><span class="pln">localStorage</span></b><span class="pun">.</span><b><span class="pln">setItem</span></b><span class="pun">(</span><span class="str">'value'</span><span class="pun">,</span><span class="pln"> area</span><span class="pun">.</span><span class="pln">value</span><span class="pun">);</span><span class="pln"><br> window</span><span class="pun">.</span><b><span class="pln">localStorage</span></b><span class="pun">.</span><b><span class="pln">setItem</span></b><span class="pun">(</span><span class="str">'timestamp'</span><span class="pun">,</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Date</span><span class="pun">()).</span><span class="pln">getTime</span><span class="pun">());</span><span class="pln"><br></span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln"><br>textarea</span><span class="pun">.</span><span class="pln">value </span><span class="pun">=</span><span class="pln"> window</span><span class="pun">.</span><b><span class="pln">localStorage</span></b><span class="pun">.</span><b><span class="pln">getItem</span></b><span class="pun">(</span><span class="str">'value'</span><span class="pun">);</span></pre>
<p id="localstorage-message">Enregistrer ce texte sur le client (récupérable)</p>
<textarea id="ta" placeholder="Entrer du texte ici..."></textarea>
<button id="save-ta">Enregistrer</button>
<p id="ta-log"></p>
<script type="text/javascript" async="" src="./HTML5_files/ga.js"></script><script defer="">
(function(){
try {
(window.localStorage.getItem) // will throw in Firefox under some settings
} catch(e){
return; // quit because dom.storage.enabled is false
}
var area = document.querySelector('#ta');
// place content from previous edit
if (!area.value) {
area.value = window.localStorage.getItem('value');
}
updateLog(false);
// your content will be saved locally
document.querySelector('#save-ta').addEventListener('click', function () {
window.localStorage.setItem('value', area.value);
window.localStorage.setItem('timestamp', (new Date()).getTime());
updateLog(true);
}, false);
function updateLog(new_save) {
var log = document.querySelector("#ta-log");
var delta = 0;
if (window.localStorage.getItem('value')) {
delta = ((new Date()).getTime() - (new Date()).setTime(window.localStorage.getItem('timestamp'))) / 1000;
if (new_save) {
log.textContent = 'Enregistré. Le contenu sera disponible après re-chargement de la page.';
setTimeout(function() {
log.textContent = '';
}, 3000);
} else {
log.textContent = 'enregistré il y a: ' + delta + ' sec.';
}
}
}
})();
</script>
</section>
<span class="counter">13</span></div>
<div class="slide offline-storage distant-slide" id="app-cache">
<style>
#appcache-message {
padding-top: 20px;
text-align: center;
}
</style>
<header><span class="js">JS</span> <h1>Cache applicative</h1></header>
<section>
<pre class="prettyprint"><span class="tag"><html</span><span class="pln"> </span><b><span class="atn">manifest</span><span class="pun">=</span><span class="atv">"cache.manifest"</span></b><span class="tag">></span><span class="pln"><br>window.</span><b><span class="pln">applicationCache</span></b><span class="pln">.addEventListener(</span><em><span class="pln">'checking'</span></em><span class="pln">, updateCacheStatus, false);</span></pre>
cache.manifest:
<pre class="prettyprint"><span class="pln">CACHE MANIFEST<br><br></span><span class="com"># version 1</span><span class="pln"><br><br>CACHE</span><span class="pun">:</span><span class="pln"><br></span><span class="str">/html5/</span><span class="pln">src</span><span class="pun">/</span><span class="pln">refresh</span><span class="pun">.</span><span class="pln">png<br></span><span class="pun">/</span><span class="pln">html5</span><span class="pun">/</span><span class="pln">src</span><span class="pun">/</span><span class="pln">logic</span><span class="pun">.</span><span class="pln">js<br></span><span class="pun">/</span><span class="pln">html5</span><span class="pun">/</span><span class="pln">src</span><span class="pun">/</span><span class="pln">style</span><span class="pun">.</span><span class="pln">css<br></span><span class="pun">/</span><span class="pln">html5</span><span class="pun">/</span><span class="pln">src</span><span class="pun">/</span><span class="pln">background</span><span class="pun">.</span><span class="pln">png</span></pre>
<!-- <p id="appcache-message">Turn off your internet connection and refresh this page! <img src="src/refresh.png" style="vertical-align:top"/></p> -->
</section>
<span class="counter">14</span></div>
<div class="slide transitionSlide performance distant-slide" id="hardware-access-title">
<section class="middle">
<h2>Accès disque et hardware locaux</h2>
<p>Intégration d'éléments du système d'exploitation</p>
<img src="./HTML5_files/HTML5_Performance_64.png" title="HTML5 Performance & Integration" alt="HTML5 Performance & Integration">
</section>
<span class="counter">15</span></div>
<div class="slide performance distant-slide" id="drag-and-drop">
<style>
#drag-zone {
list-style: none;
float: left;
}
#drag-zone li * {
border: 4px solid #888;
display: block;
}
#drag-zone, #drop-zone, #drop-data { width: 20%; }
#drop-zone, #drop-data {
padding: 40px;
border: 5px solid #888;
float: right;
height: 240px;
overflow: auto;
}
#drop-zone.hovering {
border: 5px solid #aaa;
background-color: rgba(255, 0, 0, 0.199219);
}
#drop-data {
background-color: #eee;
font-family: Monospace;
-ms-word-wrap: break-word;
word-wrap: break-word;
}
.datatypes {
font-weight: bold;
}
.draggable-text {
padding: 5px;
}
</style>
<header><span class="js">JS</span> <h1>Evènements Drag & Drop</h1></header>
<section id="dnd-section">
<pre class="prettyprint"><span class="pln">document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><em><span class="str">'dragstart'</span></em><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="kwd">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> </span><span class="kwd">event</span><span class="pun">.</span><b><span class="pln">dataTransfer</span><span class="pun">.</span><span class="pln">setData</span></b><span class="pun">(</span><span class="str">'text'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'Customized text'</span><span class="pun">);</span><span class="pln"><br> </span><span class="kwd">event</span><span class="pun">.</span><b><span class="pln">dataTransfer</span><span class="pun">.</span><span class="pln">effectAllowed</span></b><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'copy'</span><span class="pun">;</span><span class="pln"><br></span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span></pre>
<ol id="drag-zone">
<li><img src="./HTML5_files/dwd1.png" draggable="" class="copy"></li>
<li><span class="draggable-text" draggable="">Sélectionner le text et le glisser (le texte original sera copié)</span></li>
<li><span class="draggable-text" draggable="">Sélectionner le et glisser (le texte original sera changé)</span></li>
</ol>
<div id="drop-data">Données source</div>
<div id="drop-zone">Zone de dépose</div>
<script defer="">
(function() {
var dragZone = document.querySelector('#drag-zone');
var dropZone = document.querySelector('#drop-zone');
dragZone.addEventListener('dragstart', function(event) {
if (event.target.className) { // img case
event.dataTransfer.effectAllowed = event.target.className;
event.target.style.border = "4px solid #cc3300";
}
else { // text case
if (event.target.parentNode.className == 'overwrite') {
event.dataTransfer.setData("text", "<strong>Overwritten Content</strong>");
}
event.target.parentNode.style.border = "4px solid #cc3300";
}
return true;
}, true);
dragZone.addEventListener('dragend', function(event) {
if (event.target.className) { // img case
event.target.style.border = "4px solid #888";
}
else { // text case
event.target.parentNode.style.border = "4px solid #888";
}
return true;
}, true);
dropZone.addEventListener('dragenter', function(event) {
if (event.preventDefault) event.preventDefault();
event.dataTransfer.dropEffect = 'copy';
this.className = 'hovering';
return false;
}, false);
dropZone.addEventListener('dragover', function(event) {
if (event.preventDefault) event.preventDefault(); // allows us to drop
event.dataTransfer.dropEffect = 'copy';
return false;
}, false);
dropZone.addEventListener('dragleave', function(event) {
if (event.preventDefault) event.preventDefault(); // allows us to drop
this.className = '';
return false;
}, false);
dropZone.addEventListener('drop', function(event) {
if (event.preventDefault) event.preventDefault();
var imgPassed = null;
var dropdata = document.querySelector('#drop-data');
var types = event.dataTransfer.types;
document.querySelector('#drop-data').textContent = '';
this.innerHTML = '';
for (var i = 0; i < types.length; i++) {
if (types[i] == 'Files') {
var files = event.dataTransfer.files;
for (var j = 0; j < files.length; j++) {
dropdata.textContent += 'File Name: '+files[j].fileName;
dropdata.textContent += 'File Size: '+files[j].fileSize;
}
}
else {
if (typeof event.dataTransfer.getData(types[i]) !== 'undefined') {
dropdata.innerHTML += '<p><em class="datatypes">'+types[i]+'</em>: <br />'+event.dataTransfer.getData(types[i]).replace(/</g, '<') + '</p>';
}
}
if (types[i] == 'text/uri-list') {
imgPassed = event.dataTransfer.getData('text/uri-list');
}
}
if (imgPassed) {
var cEl = document.createElement('canvas');
cEl.width = 200;
cEl.height = 100;
var ctx = cEl.getContext('2d');
var img_buffer = document.createElement('img');
img_buffer.src = imgPassed;
img_buffer.style.display = 'none';
document.body.appendChild(img_buffer); // this line only needed in safari
img_buffer.onload = function() { ctx.drawImage(img_buffer,0,0,100,100); }
this.appendChild(cEl);
} else {
if (event.dataTransfer.getData('text')) {
this.innerHTML = event.dataTransfer.getData('text');
}
else if (event.dataTransfer.getData('text/plain')) {
this.innerHTML = event.dataTransfer.getData('text/plain');
}
}
return false;
}, false);
})();
</script>
</section>
<span class="counter">16</span></div>
<div class="slide performance distant-slide" id="drag-in">
<style>
#dropzone {
height: 150px;
width: 100%;
-webkit-border-radius: 10px;
-khtml-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: 2px dashed #0687FF;
}
#dropzone.rounded {
-webkit-box-shadow: inset 0px 0px 50px #777;
-moz-box-shadow: inset 0px 0px 50px #777;
-o-box-shadow: inset 0px 0px 50px #777;
box-shadow: inset 0px 0px 50px #777;
}
#dnd-thumbnails {
height: 125px;
margin-top: 10px;
}
#dnd-thumbnails img {
width: 75px;
height: 75px;
border: 1px solid black;
margin-right: 10px;
-webkit-transition: -webkit-transform 0.2s ease-in, margin-left 0.7s ease-in-out, margin-right 0.7s ease-in-out;
-moz-transition: -moz-transform 1s ease-in-out, margin-left 0.7s ease-in-out, margin-right 0.7s ease-in-out;
-o-transition: -o-transform 1s ease-in-out, margin-left 1s ease-in-out, margin-left 0.7s ease-in-out, margin-right 0.7s ease-in-out;
}
#dnd-thumbnails img:hover {
-webkit-transform: scale(3.0) rotate(10deg);
-webkit-transform-origin: 50% 75px;
-moz-transform: scale(3.0) rotate(10deg);
-moz-transform-origin: 50% 75px;
margin: 0 100px;
}
</style>
<header><span class="js">JS</span> <h1>Glisser-déposer du bureau (API fichier)</h1></header>
<section>
<h3>Glissez des fichiers à partir du bureau:</h3>
<pre class="prettyprint"><span class="pln">document</span><span class="pun">.</span><span class="pln">querySelector</span><span class="pun">(</span><span class="str">'#dropzone'</span><span class="pun">).</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'drop'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">e</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> </span><span class="kwd">var</span><span class="pln"> reader </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><b><span class="typ">FileReader</span></b><span class="pun">();</span><span class="pln"><br> reader</span><span class="pun">.</span><span class="pln">onload </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">evt</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> document</span><span class="pun">.</span><span class="pln">querySelector</span><span class="pun">(</span><span class="str">'img'</span><span class="pun">).</span><span class="pln">src </span><span class="pun">=</span><span class="pln"> evt</span><span class="pun">.</span><span class="pln">target</span><span class="pun">.</span><b><span class="pln">result</span></b><span class="pun">;</span><span class="pln"><br> </span><span class="pun">};</span><span class="pln"><br><br> reader</span><span class="pun">.</span><b><span class="pln">readAsDataURL</span></b><span class="pun">(</span><span class="pln">evt</span><span class="pun">.</span><b><span class="pln">dataTransfer</span><span class="pun">.</span><span class="pln">files</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]</span></b><span class="pun">);</span><span class="pln"><br></span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span></pre>
<div class="example">
<div id="dropzone" class="vbox boxcenter center">
Déposer une image du bureau
</div>
</div>
<div id="dnd-thumbnails" class="center"></div>
<script src="./HTML5_files/dnd-lib.js" defer=""></script>
<script defer="">
window.addEventListener('load', function(e) {
var dndc = new DNDFileController('dropzone', 'dnd-thumbnails');
}, false);
</script>
</section>
<span class="counter">17</span></div>
<div class="slide performance distant-slide" id="drag-out">
<style>
.dragout {
background: #0687FF;
color: #fff;
padding: 10px;
margin: 10px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
</style>
<header><span class="js">JS</span> <h1>Glisser-déposer vers le bureau</h1></header>
<section id="dnd-section">
<h3>Glissez ces fichiers vers le bureau:</h3>
<pre class="prettyprint"><span class="tag"><a</span><span class="pln"> </span><span class="atn">href</span><span class="pun">=</span><span class="atv">"src/star.mp3"</span><span class="pln"> </span><span class="atn">draggable</span><span class="pun">=</span><span class="atv">"true"</span><span class="pln"> </span><span class="atn">class</span><span class="pun">=</span><span class="atv">"dragout"</span><span class="pln"><br> </span><span class="atn">data-downloadurl</span><span class="pun">=</span><span class="atv">"</span><b><span class="atv">MIMETYPE:FILENAME:ABSOLUTE_URI_TO_FILE</span></b><span class="atv">"</span><span class="tag">></span><span class="pln">download</span><span class="tag"></a></span></pre>
<pre class="prettyprint"><span class="kwd">var</span><span class="pln"> files </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">querySelectorAll</span><span class="pun">(</span><span class="str">'.dragout'</span><span class="pun">);</span><span class="pln"><br></span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="kwd">var</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">,</span><span class="pln"> file</span><span class="pun">;</span><span class="pln"> file </span><span class="pun">=</span><span class="pln"> files</span><span class="pun">[</span><span class="pln">i</span><span class="pun">];</span><span class="pln"> </span><span class="pun">++</span><span class="pln">i</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> file</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'dragstart'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">e</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> e</span><span class="pun">.</span><span class="pln">dataTransfer</span><span class="pun">.</span><span class="pln">setData</span><span class="pun">(</span><span class="str">'DownloadURL'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">dataset</span><span class="pun">.</span><span class="pln">downloadurl</span><span class="pun">);</span><span class="pln"><br> </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln"><br></span><span class="pun">}</span></pre>
<div class="example">
Glissez ces fichiers vers le bureau:
<a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/en/us/intl/en/landing/chrome/cadie/glasses.pdf" class="dragout" data-downloadurl="application/pdf:Chrome3DGlasses.pdf:http://static.googleusercontent.com/external_content/untrusted_dlcp/www.google.com/en/us/intl/en/landing/chrome/cadie/glasses.pdf" draggable="true">.pdf file</a>
<a href="http://slides.html5rocks.com/src/star.mp3" class="dragout" data-downloadurl="audio/mpeg:star.mp3:http://slides.html5rocks.com/src/star.mp3" draggable="true">.mp3 file</a>
</div>
<p class="center" style="font-size:90%">( actuellement seulement disponible en Google Chrome )</p>
<script defer="">
(function() {
var files = document.querySelectorAll('.dragout');
for (var i = 0, file; file = files[i]; ++i) {
file.setAttribute('draggable', 'true'); // Don't really need, but good practice.
file.addEventListener('dragstart', function(evt) {
evt.dataTransfer.setData('DownloadURL', this.getAttribute('data-downloadurl'));
}, false);
}
})();
</script>
</section>
<span class="counter">18</span></div>
<div class="slide performance distant-slide" id="geolocation">
<style>
#see-position {
margin-bottom: 10px;
}
#geo-map {
height: 280px;
width: 640px;
}
#geo-log {
background-color: red;
color: white;
padding: 5px;
border-radius: 5px;
visibility: hidden;
}
</style>
<header><span class="js">JS</span> <h1>Geolocalisation</h1></header>
<section>
<pre class="prettyprint"><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><b><span class="pln">navigator</span></b><span class="pun">.</span><b><span class="pln">geolocation</span></b><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> </span><b><span class="pln">navigator</span></b><span class="pun">.</span><b><span class="pln">geolocation</span></b><span class="pun">.</span><b><span class="pln">getCurrentPosition</span></b><span class="pun">(</span><span class="kwd">function</span><span class="pun">(</span><span class="pln">position</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> </span><span class="kwd">var</span><span class="pln"> latLng </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> google</span><span class="pun">.</span><span class="pln">maps</span><span class="pun">.</span><span class="typ">LatLng</span><span class="pun">(</span><span class="pln"><br> position</span><span class="pun">.</span><b><span class="pln">coords</span></b><span class="pun">.</span><b><span class="pln">latitude</span></b><span class="pun">,</span><span class="pln"> position</span><span class="pun">.</span><b><span class="pln">coords</span></b><span class="pun">.</span><b><span class="pln">longitude</span></b><span class="pun">);</span><span class="pln"><br> </span><span class="kwd">var</span><span class="pln"> marker </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> google</span><span class="pun">.</span><span class="pln">maps</span><span class="pun">.</span><span class="typ">Marker</span><span class="pun">({</span><span class="pln">position</span><span class="pun">:</span><span class="pln"> latLng</span><span class="pun">,</span><span class="pln"> map</span><span class="pun">:</span><span class="pln"> map</span><span class="pun">});</span><span class="pln"><br> map</span><span class="pun">.</span><span class="pln">setCenter</span><span class="pun">(</span><span class="pln">latLng</span><span class="pun">);</span><span class="pln"><br> </span><span class="pun">},</span><span class="pln"> errorHandler</span><span class="pun">);</span><span class="pln"><br></span><span class="pun">}</span></pre>
<button id="see-position">Montrer Position</button> <span id="geo-log"></span>
<div id="geo-map" class="gmap example">
<img src="./HTML5_files/staticmap(1)">
</div>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script defer="">
(function() {
var map = null;
var geolog = document.querySelector('#geo-log');
var geoMap = document.querySelector('#geo-map');
function showPosition(position) {
geolog.textContent = "You're within " + position.coords.accuracy +
" meters of (" + position.coords.latitude + ", " +
position.coords.longitude + ")";
var latLng = new google.maps.LatLng(
position.coords.latitude, position.coords.longitude);
var marker = new google.maps.Marker({
position: latLng,
map: map
});
map.setCenter(latLng);
map.setZoom(15);
}
function handlePositionError(evt) {
geolog.textContent = evt.message;
}
function successPositionHandler(evt) {
// Load map if it doesn't already exist and when user clicks the button.
if (!map) {
map = new google.maps.Map(geoMap, {
zoom: 3,
center: new google.maps.LatLng(37.4419, -94.1419), // United States
mapTypeId: google.maps.MapTypeId.ROADMAP
});
map.getDiv().style.border = '1px solid #ccc';
}
if (navigator.geolocation) {
geolog.style.visibility = 'visible';
geolog.textContent = 'Looking for location...';
navigator.geolocation.getCurrentPosition(showPosition, handlePositionError);
// Also monitor position as it changes.
//navigator.geolocation.watchPosition(showPosition, handlePositionError);
} else {
geolog.textContent = 'Oops! Your browser does not support geolocation.';
}
}
document.querySelector('#see-position').addEventListener('click', successPositionHandler, false);
geoMap.addEventListener('click', successPositionHandler, false);
})();
</script>
</section>
<span class="counter">19</span></div>
<div class="slide performance distant-slide" id="slide-orientation" onload="os.onload();" onunload="os.onunload();">
<style>
#slide-orientation section {
height: 100%;
}
#orientationWrap {
width: 300px;
height: 300px;
position: relative;
}
#slide-orientation p {
display: none;
text-align: center;
}
#orientationWrap .layer {
position: absolute;
left: 50%;
top: 0;
-webkit-transition-property: x, y;
-webkit-transition-duration: 0.1s;
-webkit-transition-timing-function: linear;
-moz-transition-property: x, y;
-moz-transition-duration: 0.1s;
-moz-transition-timing-function: linear;
}
</style>
<header><span class="js">JS</span> <h1>Orientation de l'appareil</h1></header>
<section>
<pre class="prettyprint"><span class="pln">window</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'</span><em><span class="str">deviceorientation</span></em><span class="str">'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="kwd">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br> </span><span class="kwd">var</span><span class="pln"> a </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">event</span><span class="pun">.</span><b><span class="pln">alpha</span></b><span class="pun">;</span><span class="pln"><br> </span><span class="kwd">var</span><span class="pln"> b </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">event</span><span class="pun">.</span><b><span class="pln">beta</span></b><span class="pun">;</span><span class="pln"><br> </span><span class="kwd">var</span><span class="pln"> g </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">event</span><span class="pun">.</span><b><span class="pln">gamma</span></b><span class="pun">;</span><span class="pln"><br></span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span></pre>
<p>This sample requires FF3.6+ or Google Chrome
on a device with a built in accelerometer or iOS 4.2.</p>
<div class="flex hbox boxcenter">
<div id="orientationWrap" class="noflex vbox boxcenter">
<div class="layer" style="left: 0px; top: 0px; -webkit-transform: rotateY(0deg) rotateX(0deg); "><img src="./HTML5_files/chrome-layer-01.png"></div>
<div class="layer" style="left: 0px; top: 0px; -webkit-transform: rotateY(0deg) rotateX(0deg); "><img src="./HTML5_files/chrome-layer-02.png"></div>
<div class="layer" style="left: 0px; top: 0px; -webkit-transform: rotateY(0deg) rotateX(0deg); "><img src="./HTML5_files/chrome-layer-03.png"></div>
<div class="layer" style="left: 0px; top: 0px; -webkit-transform: rotateY(0deg) rotateX(0deg); "><img src="./HTML5_files/chrome-layer-04.png"></div>
<div class="layer" style="left: 0px; top: 0px; -webkit-transform: rotateY(0deg) rotateX(0deg); "><img src="./HTML5_files/chrome-layer-05.png"></div>
</div>
</div>
<script defer="">
function OrientationSlide(slide) {
this._slide = document.querySelector(slide);
this._lastBeta = 0;
this._lastGamma = 0;
}
OrientationSlide.prototype.orientationListener = function(evt) {
// For FF3.6+
if (!evt.gamma && !evt.beta) {
evt.gamma = -(evt.x * (180 / Math.PI));
evt.beta = -(evt.y * (180 / Math.PI));
}
var overThreshold = Math.abs(evt.gamma) > 4 || Math.abs(evt.beta) > 4;
var gamma = overThreshold ? evt.gamma : 0;
var beta = overThreshold ? evt.beta : 0;
if (this._lastGamma != gamma || this._lastBeta != beta) {
var zindex = 0;
var layers = document.querySelectorAll('.layer');
for (var i = 0, elem; elem = layers[i]; ++i) {
zindex++;
var x = Math.round(1.5 * gamma * zindex);
var y = Math.round(1.5 * beta * zindex);
var style = elem.style;
style.left = x.toString() + 'px';
style.top = y.toString() + 'px';
style.webkitTransform = 'rotateY(' + (-2.0 * gamma) + 'deg) rotateX(' + (-2.0 * beta) + 'deg)';
style.MozTransform = 'rotateY(' + (-2.0 * gamma) + 'deg) rotateX(' + (-2.0 * beta) + 'deg)';
}
this._lastGamma = gamma;
this._lastBeta = beta;
}
};
OrientationSlide.prototype.onunload = function(evt) {
window.removeEventListener('deviceorientation', this.orientationListener, false);
window.removeEventListener('MozOrientation', this.orientationListener, false);
};
OrientationSlide.prototype.onload = function(evt) {
window.addEventListener('deviceorientation', this.orientationListener, false);
window.addEventListener('MozOrientation', this.orientationListener, false);
};
var os = new OrientationSlide('#slide-orientation');
if (!('ondeviceorientation' in window) &&
!(window.onmozorientation)) {
document.querySelector('#slide-orientation p').style.display = 'block';
}
</script>
</section>
<span class="counter">20</span></div>
<div class="slide transitionSlide far-future" id="graphics-multimedia-title">
<section class="middle">
<h2>Graphique / Multimedia</h2>
<p>2D & 3D</p>
<img src="./HTML5_files/HTML5_3D_Effects_64.png" title="HTML5 3D & Effects" alt="HTML5 3D & Effects">
<img src="./HTML5_files/HTML5_Multimedia_64.png" title="HTML5 Multimedia" alt="HTML5 Multimedia">
</section>
<span class="counter">21</span></div>
<div class="slide multimedia distant-slide" id="video-audio">
<style>
#video-column {
float: left;
width: 50%;
margin-top: 20px;
}
#reflection-button {
margin: 20px 0;
}
#audio-column {
float: left;
width: 45%;
margin-top: 120px;
}
.media-buttons {
margin: 40px 0;
}
</style>
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Audio + Video</h1></header>
<section>
<pre class="prettyprint"><span class="tag"><</span><b><span class="tag">audio</span></b><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"audio"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"sound.mp3"</span><span class="pln"> </span><b><span class="atn">controls</span></b><span class="tag">></audio></span><span class="pln"><br>document.getElementById("audio").</span><b><span class="pln">muted</span></b><span class="pln"> = false;</span></pre>
<pre class="prettyprint"><span class="tag"><</span><b><span class="tag">video</span></b><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"video"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"movie.webm"</span><span class="pln"> </span><b><span class="atn">autoplay</span></b><span class="pln"> </span><b><span class="atn">controls</span></b><span class="tag">></video></span><span class="pln"><br>document.getElementById("video").</span><b><span class="pln">play</span></b><span class="pln">();</span></pre>
<div id="video-column" class="center">
<input type="button" id="reflection-button" onclick="addReflection()" value="Reflet de la vidéo en CSS">
<video width="390" id="clip" controls="">
<source src="./HTML5_files/chrome_japan.webm" type="video/webm; codecs="vp8, vorbis"">
<source src="./HTML5_files/chrome_japan.mp4" type="video/mp4; codecs="avc1.42E01E, mp4a.40.2"">
<source src="./HTML5_files/chrome_japan.ogv" type="video/ogg; codecs="theora, vorbis"">
Your browser does not support the video tag
</video>
<div class="media-buttons">
<input type="button" id="play-button" onclick="PlayVideo()" ;="" value="Play">
<input type="button" id="pause-button" onclick="PauseVideo()" ;="" value="Pause" disabled="">
<input type="button" id="mute" onclick="MuteUnMute()" value="Mute">
</div>
</div>
<div id="audio-column" class="center">
<audio id="audio-clip" width="670" controls="">
<source src="./HTML5_files/rushus-modal_blues.mp3" type="audio/mpeg">
<source src="./HTML5_files/rushus-modal_blues.ogg" type="audio/ogg">
Your browser does not support the audio tag
</audio>
<div class="media-buttons">
<input type="button" id="audio-play-button" onclick="PlayAudio()" value="Play">
<input type="button" id="audio-pause-button" onclick="PauseAudio()" value="Pause" disabled="">
<input type="button" id="audio-mute" onclick="MuteUnMuteAudio()" value="Mute">
</div>
</div>
</section>
<script defer="">
var videoClip = document.getElementById('clip');
var playButton = document.getElementById('play-button');
var pauseButton = document.getElementById('pause-button');
function PlayVideo() {
videoClip.play();
playButton.disabled = true;
pauseButton.disabled = false;
}
function PauseVideo() {
videoClip.pause();
playButton.disabled = false;
pauseButton.disabled = true;
}
function MuteUnMute() {
document.getElementById('mute').value = videoClip.muted ? 'Mute' : 'Unmute';
videoClip.muted = videoClip.muted ? false : true;
}
function OnFinished() {
playButton.disabled = false;
pauseButton.disabled = true;
}
function addReflection() {
videoClip.style.webkitBoxReflect = videoClip.style.webkitBoxReflect !== '' ? '' : "below 0px -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), color-stop(0.55, transparent), to(white))";
}
</script>
<script defer="">
var audioClip = document.getElementById('audio-clip');
var audioPlayButton = document.getElementById('audio-play-button');
var audioPauseButton = document.getElementById('audio-pause-button');
audioClip.addEventListener('ended', OnAudioFinished, false);
function PlayAudio() {
audioClip.play();
audioPlayButton.disabled = true;
audioPauseButton.disabled = false;
}
function PauseAudio() {
audioClip.pause();
audioPlayButton.disabled = false;
audioPauseButton.disabled = true;
}
function MuteUnMuteAudio() {
document.getElementById('audio-mute').value = audioClip.muted ? 'Mute' : 'Unmute';
audioClip.muted = audioClip.muted ? false : true;
}
function OnAudioFinished() {
audioPlayButton.disabled = false;
audioPauseButton.disabled = true;
}
</script>
<span class="counter">22</span></div>
<div class="slide effects distant-slide" id="canvas-2d">
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Canvas 2D</h1></header>
<section>
<style>
#canvas-area {
background: white;
-webkit-border-radius: 8px;
-khtml-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
border: 1px solid #bbb;
}
</style>
<pre class="prettyprint"><span class="tag"><canvas</span><span class="pln"> </span><span class="atn">id</span><span class="pun">=</span><span class="atv">"canvas"</span><span class="pln"> </span><span class="atn">width</span><span class="pun">=</span><span class="atv">"838"</span><span class="pln"> </span><span class="atn">height</span><span class="pun">=</span><span class="atv">"220"</span><span class="tag">></canvas></span><span class="pln"><br><br></span><span class="tag"><script></span><span class="pln"><br> </span><span class="kwd">var</span><span class="pln"> canvasContext </span><span class="pun">=</span><span class="pln"> document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">"canvas"</span><span class="pun">).</span><b><span class="pln">getContext</span></b><span class="pun">(</span><span class="str">"2d"</span><span class="pun">);</span><span class="pln"><br> canvasContext</span><span class="pun">.</span><b><span class="pln">fillRect</span></b><span class="pun">(</span><span class="lit">250</span><span class="pun">,</span><span class="pln"> </span><span class="lit">25</span><span class="pun">,</span><span class="pln"> </span><span class="lit">150</span><span class="pun">,</span><span class="pln"> </span><span class="lit">100</span><span class="pun">);</span><span class="pln"><br> <br> canvasContext</span><span class="pun">.</span><b><span class="pln">beginPath</span></b><span class="pun">();</span><span class="pln"><br> canvasContext</span><span class="pun">.</span><b><span class="pln">arc</span></b><span class="pun">(</span><span class="lit">450</span><span class="pun">,</span><span class="pln"> </span><span class="lit">110</span><span class="pun">,</span><span class="pln"> </span><span class="lit">100</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Math</span><span class="pun">.</span><span class="pln">PI </span><span class="pun">*</span><span class="pln"> </span><span class="lit">1</span><span class="pun">/</span><span class="lit">2</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Math</span><span class="pun">.</span><span class="pln">PI </span><span class="pun">*</span><span class="pln"> </span><span class="lit">3</span><span class="pun">/</span><span class="lit">2</span><span class="pun">);</span><span class="pln"><br> canvasContext</span><span class="pun">.</span><b><span class="pln">lineWidth</span></b><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="lit">15</span><span class="pun">;</span><span class="pln"><br> canvasContext</span><span class="pun">.</span><b><span class="pln">lineCap</span></b><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'round'</span><span class="pun">;</span><span class="pln"><br> canvasContext</span><span class="pun">.</span><b><span class="pln">strokeStyle</span></b><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'rgba(255, 127, 0, 0.5)'</span><span class="pun">;</span><span class="pln"><br> canvasContext</span><span class="pun">.</span><b><span class="pln">stroke</span></b><span class="pun">();</span><span class="pln"><br></span><span class="tag"></script></span><span class="pln"><br> </span></pre>
<canvas id="canvas-area" width="838" height="225"></canvas>
<script defer="">
var canvasContext = document.getElementById("canvas-area").getContext("2d");
canvasContext.fillRect(250, 25, 150, 100);
canvasContext.beginPath();
canvasContext.arc(450, 110, 100, Math.PI * 1/2, Math.PI * 3/2, false);
canvasContext.lineWidth = 15;
canvasContext.lineCap = 'round';
canvasContext.strokeStyle = 'rgba(255, 127, 0, 0.5)';
canvasContext.stroke();
</script>
</section>
<span class="counter">23</span></div>
<div class="slide effects distant-slide" id="canvas-2d-example">
<style>
#canvas-example {
margin-left: 150px;
margin-top: 40px;
padding: 0;
width: 530px;
height: 505px;
padding: 5px;
text-align:center;
}
#canvas-example iframe {
width: 520px;
height: 500px;
border: none;
background: white;
}
</style>
<header><span class="html">HTML</span> <span class="js">JS</span> <h1>Canvas 2D: exemple</h1></header>
<section>
<div id="canvas-example" class="example">
<iframe _src="./HTML5_files/canvasphoto/index.html" scrolling="no"></iframe>
</div>
</section>
<span class="counter">24</span></div>