-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.htm
More file actions
1798 lines (1603 loc) · 74.9 KB
/
Copy pathexample.htm
File metadata and controls
1798 lines (1603 loc) · 74.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" data-notes="example_notes.htm" data-synchronize="slides.php" data-syncss="sync.css">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" title="mainsheet" href="dewdrop/template.css">
<link rel="alternate stylesheet" title="outlinesheet" href="dewdrop/template_outline.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
<script src="slides.js"></script>
<script src="interactive.js"></script> <!-- This is only needed if interactive features are used. -->
<script>
initialize({
"title": "Slides.js",
"subtitle": "Example and slideshow",
"authors": "François Hissel",
"description": "Slides.js reference slideshow"
});
</script>
<style>
body>section div .code-sample, #thumblayer>div.wthumb>section div .code-sample { overflow: auto auto; }
body>section pre, #thumblayer>div.wthumb>section pre {
margin: 0px;
tab-size: 2;
}
body>section code, #thumblayer>div.wthumb>section code {
background-color: #f3f3f3;
font-size: 0.7em;
text-wrap: wrap;
}
body>section.outline div.content li:not(.current) ul, #thumblayer>div.wthumb>section.outline div.content li:not(.current) ul {display: none}
key {
display: inline-block;
min-width: 1.5em;
min-height: 1.5em;
line-height: 1.5em;
padding: 0.1em;
text-align: center;
vertical-align: middle;
border: 1px solid black;
background-color: #f3f3f3ff;
box-shadow: 0.3vw 0.2vh 0.2vmax rgba(0,0,0,0.5);
}
#autofragments-elements ul > li {
--autofragment: "{'before':['semivisible'],'current':['pulse'],'animation':'fragment_cssanim'}";
}
</style>
</head>
<body>
<svg viewBox="0 0 1 1" width="0" height="0">
<mask id="tempmask" maskContentUnits="objectBoundingBox"></mask>
<mask id="tempmaskb" maskContentUnits="objectBoundingBox"></mask>
</svg>
<h2 data-short="Slides.js">What is Slides.js ?</h2>
<section id="nutshell" class="content">
<h1>Design guidelines</h1>
<div class="content">
<ul>
<li>Lightweight: relies only on pure HTML, CSS, Ecmascript, with no third-party library</li>
<li>Adaptive elements to support all screen ratios, and always use the full viewport</li>
<li>Support convenient features: presenter screen, automatic synchronization of audience devices, outline view,…</li>
<li>Designed to enforce the use of predefined templates, including color themes</li>
<li>Enforce a strong separation between content and style: it is usually not needed to include any style attribute in the HTML code</li>
<li>Make it easy to create custom templates, using only CSS (or Sass), even for animations, transitions, dynamic components</li>
<li>Make it easy to develop new components and animations, in a few lines of Javascript</li>
<li>Heavily inspired by the wonderful <a href="https://touying-typ.github.io/">Typst Touying package</a>.</li>
</ul>
<p>See the <a class="view-source">source</a> of this web page to get an example.</p>
</div>
</section>
<section class="content">
<h1>Main features</h1>
<div class="content">
<ul>
<li>Automatic sizing of slides based on screen dimensions</li>
<li>Overview of slides</li>
<li>Presenter notes</li>
<li>Export slides to PDF, and view a paged document with the content of the slideshow</li>
<li>Automatic synchronization of other viewers based on the presenter current slide</li>
<li>Transitions between slides</li>
<li>Animations of fragments inside slides</li>
<li>Dynamic components inside slides that may be added through CSS only, such as a Beamer-inspired clickable mini-table of contents in the header</li>
<li>Background and foreground layers which stay in place during the whole slideshow and are not impacted by transitions</li>
<li>Automatic generation of outline slides</li>
<li>Keyboard shortcut to other parts of the presentation</li>
<li>Templates can easily be created with only bare CSS</li>
</ul>
</div>
</section>
<section class="content">
<h1>This is the source of this slideshow</h1>
<div class="content">
<div class="code-sample" data-language="html" style="height: 60vh">
</div>
</div>
</section>
<h2 data-short="Slideshow">The slideshow structure</h2>
<h3>The general configuration</h3>
<section class="content">
<h1>Initialize the slideshow</h1>
<div class="content">
<div>
Include the stylesheets:
<dl>
<dt><code>title="outlinesheet"</code></dt><dd>Stylesheet used when displaying the outline view</dd>
<dt><code>title="mainsheet"</code></dt><dd>Stylesheet used when displaying the normal view of slides</dd>
</dl>
<pre><code>
<link rel="stylesheet" title="outlinesheet" href="/templates/dewdrop/slides/template_outline.css">
<link rel="stylesheet" title="mainsheet" href="/templates/dewdrop/slides/template.css">
</code></pre>
</div>
<div>
Include the main library:
<pre><code>
<script src="/templates/slides/slides.js"></script>
</code></pre>
</div>
<div>
Initialize metadata:
<pre><code>
<script>
initialize({
"title": "Slides.js",
"subtitle": "Example and slideshow",
"authors": "François Hissel",
"description": "Slides.js reference slideshow"
});
</script>
</code></pre>
</div>
</div>
</section>
<section class="content">
<h1>Initialize metadata</h1>
<div class="content">
<pre><code>
initialize({
"title": "My wonderful slideshow",
"subtitle": "Executive board",
"authors": "John Doe",
"description": "A slideshow for my office"
});
</code></pre>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Key</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>title</td><td>The title of the slideshow. It is used in the title page and as the title of the web page.</td></tr>
<tr><td>subtitle</td><td>The subtitle, displayed on the title page.</td></tr>
<tr><td>authors</td><td>The authors, displayed on the title page and used in the metadata.</td></tr>
<tr><td>description</td><td>Metadata description</td></tr>
<tr><td>date</td><td>A date, displayed on the title page. It is automatically retrieved from the system when the slideshow is loaded if it is not provided.</td></tr>
</tbody>
</table>
</div>
</section>
<section class="content">
<h1>General options in html element</h1>
<div class="content">
<pre><code>
<html lang="en" data-notes="example_notes.html" data-synchronize="/templates/slides/slides.php">
</code></pre>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Attribute</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>lang</td><td>Language of the presentation, used to customize some automatically generated elements (like the title of the outline slides)</td></tr>
<tr><td>data-notes</td><td>URL of the presenter notes page. See also <a href="#presenter-notes">here</a></td></tr>
<tr><td>data-synchronize</td><td>URL of a synchronization script. Synchronization is turned on when this attribute is given.</td></tr>
</tbody>
</table>
</div>
</section>
<section id="body-options" class="content">
<h1>General options in body element</h1>
<div class="content">
<pre><code>
<body data-background-layer="active" data-foreground-layer="active">
</code></pre>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Attribute</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>data-background-layer</td><td>If active, the background of slides is drawn on its own div layer instead of each slide. The net effect is that it is not animated during transitions between slides. This attribute takes precedence over the CSS <code>--background-layer</code> property. See also <a href="#backfore">here</a> for more explainations about background and foreground layers.</td></tr>
<tr><td>data-foreground-layer</td><td>If active, the foreground of slides is drawn on its own div layer instead of each slide. This attribute takes precedence over the CSS <code>--foreground-layer</code> property.</td></tr>
</tbody>
</table>
</div>
</section>
<h3>The structure</h3>
<section class="content">
<h1>Headings and slides</h1>
<div class="content">
<pre><code style="height: 30vh">
<h2>Outer structure</h2>
<h3 data-short="Templates">Slides templates</h3>
<section class="content">
<h1>A content slide</h1>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</section>
<section class="content">
<h1>Another content slide</h1>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</section>
</code></pre>
<ul>
<li>The slideshow is structured in sections, subsections… using <code><h2></code>, <code><h3></code>,… elements</li>
<li>Each slide is represented by a <code><section></code> element. Its class defines the template of the slide (see also <a href="#slides-templates">here</a>)</li>
</ul>
</div>
</section>
<section id="heading-options" class="content">
<h1>Headings</h1>
<div class="content">
<pre><code><h2 data-short="Outer" data-outline="ClassicOutlineSlide">Outer structure</h2></code></pre>
<p>HTML attributes and CSS properties:</p>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>h2, h3, h4, h5, h6</td><td>data-outline</td><td>--outline</td><td>Name of a function to use to compose the outline</td></tr>
<tr><td>h2, h3, h4, h5, h6</td><td>data-short</td><td></td><td>Short name for the heading, used in some components</td></tr>
</tbody>
</table>
<p>The composition function should return an object that inherits the OutlineSlide class. It has one mandatory member function:
<pre><code>compose(entry, structure)</code></pre>
where:
<ul>
<li><code>entry</code> is the structure node of the current heading</li>
<li><code>structure</code> is the structure of the document (usually a global variable named structure with the tree of headings and slides)</li>
</ul>
</div>
</section>
<section class="content">
<h1>Headings</h1>
<div class="content">
<p>Currenty, two outline styles (which can be used in <code>data-outline</code>) are defined:</p>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Composition function</td><td>Outline style</td></tr>
</thead>
<tbody>
<tr><td>ClassicOutlineSlide()</td><td>The title is a generic name (like "Outline" or "Sommaire"), the contents are a tree of sections and subsections</td></tr>
<tr><td>FocusOutlineSlide()</td><td>The title is the name of the current heading, the contents are the list of subsections at the level immediately below the heading level</td></tr>
</tbody>
</table>
<p>All outline slides have the <code>outline</code> and a <code>data-level</code> attribute with the nesting level of the current heading (1 for h1, 2 for h2…).</p>
</div>
</section>
<section id="slide-options" class="content">
<h1>Slides</h1>
<div class="content">
<pre><code><section id="myslide" data-animation="fade">…</section></code></pre>
<p>HTML attributes and CSS properties:</p>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>section</td><td>id</td><td></td><td>Identifier of the slide. If none is provided, it is automatically generated.</td></tr>
<tr><td>section</td><td>data-animation</td><td>--animation</td><td>Name of the animation. See also <a href="#animation">here</a></td></tr>
<tr><td>section</td><td>data-components</td><td>--components</td><td>Array of components constructors. See also <a href="#components">here</a></td></tr>
<tr><td>section</td><td>data-background</td><td>--background</td><td>Array of components constructors to add to the background layer. See also <a href="#backfore">here</a></td></tr>
<tr><td>section</td><td>data-foreground</td><td>--foreground</td><td>Array of components constructors to add to the foreground layer. See also <a href="#backfore">here</a></td></tr>
<tr><td>section</td><td>data-numfragment</td><td></td><td>Number of fragment. See also <a href="#fragment">here</a></td></tr>
<tr><td>section</td><td>data-autofragment</td><td></td><td>Auto-fragment specification. See also <a href="#fragment">here</a></td></tr>
<tr><td>section</td><td>data-groups</td><td></td><td>Comma-separated list of groups the current slide belongs to. See also <a href="#subsets">here</a></td></tr>
</tbody>
</table>
</div>
</section>
<h3>Transitions</h3>
<section id="animation" class="content">
<h1>Transitions between slides</h1>
<div class="content">
The transition between two slides is defined in the destination slide. It can be setup either inline or in the CSS stylesheet.
<pre><code><section data-animation="convex"></code></pre>
HTML attributes and CSS properties:
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>section</td><td>data-animation</td><td>--animation</td><td>Name of an animation</td></tr>
</tbody>
</table>
The name of the animation may be:
<ul>
<li>A function <code>animate(source, dest, increasing, callback)</code>: in this case, the function is executed with <code>source</code> being the DOM object for the source slide, <code>dest</code> the DOM object for the destination slide, <code>increasing</code> a boolean indicating if the direction of the animation and <code>callback</code> a callback function to execute after the end of the animation</li>
<li>A string <code>name</code>: the animation is done in four steps
<ul>
<li>apply the anim-<em>name</em>-transitions class to both the source and destination slide (generally this class should only define transitions)</li>
<li>apply the anim-<em>name</em>-to class to the source slide</li>
<li>apply the anim-<em>name</em>-from class to the destination slide</li>
<li>remove the classes on both slides after the transitions are complete</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="content" data-animation="none">
<h1>Predefined transition "none"</h1>
<div class="content">
<code>data-animation="none"</code>
Implementation through Javascript function:
<pre><code>
function animate_none(source,dest,increasing,callback) {
source.style.visibility=null;
if (source.dataset["onhide"]) window[source.dataset["onhide"]](source);
dest.style.visibility='visible';
if (dest.dataset["onshow"]) window[dest.dataset["onshow"]](dest);
program_hashchange=true;
location.hash="#"+dest.id;
dest.style.visibility=null;
callback();
}
</code></pre>
</div>
</section>
<section class="content" data-animation="fade">
<h1>Predefined transition "fade"</h1>
<div class="content">
<code>data-animation="fade"</code>
Implementation with CSS classes:
<pre><code>
.anim-fade-transitions {
opacity: 1;
transition: opacity 1s ease-in-out;
}
.anim-fade-from {
opacity: 0 !important;
}
.anim-fade-to {
opacity: 0 !important;
}
</code></pre>
</div>
</section>
<section class="content" data-animation="sweep">
<h1>Predefined transition "sweep"</h1>
<div class="content">
<code>data-animation="sweep"</code>
Implementation with CSS classes:
<pre><code>
.anim-sweep-transitions {
transition: left 1s ease-in-out;
}
.anim-sweep-from {
left: 100%;
}
.anim-sweep-to {
left: -100%;
}
</code></pre>
</div>
</section>
<section class="content" data-animation="rotate">
<h1>Predefined transition "rotate"</h1>
<div class="content">
<code>data-animation="rotate"</code>
Implementation with CSS classes:
<pre><code>
.anim-rotate-transitions {
transform-origin: -50% 50%;
transition: transform 1s ease-in-out;
}
.anim-rotate-from {
transform: rotate(-90deg);
}
.anim-rotate-to {
transform: rotate(90deg);
}
</code></pre>
</div>
</section>
<section class="content" data-animation="convex">
<h1>Predefined transition "convex"</h1>
<div class="content">
<code style="background-color: transparent">data-animation="convex"</code>
Implementation with CSS classes:
<pre><code>
.anim-convex-transitions {
opacity: 1;
transform-origin: center center 250px;
transition-property: transform, opacity;
transition-duration: 1s;
transition-timing-function: ease-in-out;
}
.anim-convex-from {
transform: rotateY(-120deg) scale(0.5);
opacity: 0 !important;
}
.anim-convex-to {
transform: rotateY(120deg) scale(0.5);
opacity: 0 !important;
}
</code></pre>
</div>
</section>
<section class="content" data-animation="takeoff">
<h1>Predefined transition "takeoff"</h1>
<div class="content">
<code>data-animation="takeoff"</code>
Implementation with CSS classes:
<pre><code>
.anim-takeoff-transitions {
opacity: 1;
transform-origin: center center;
transition-property: transform, opacity;
transition-duration: 1s;
transition-timing-function: ease-in-out;
}
.anim-takeoff-from {
transform: scale(0.2);
opacity: 0 !important;
}
.anim-takeoff-to {
transform: scale(5);
opacity: 0 !important;
}
</code></pre>
</div>
</section>
<section class="content" data-animation="sponge">
<h1>Predefined transition "sponge"</h1>
<div class="content">
<code>data-animation="sponge"</code>
Implementation with Javascript and CSS classes (see the source code).
To use this animation, you have to add the following code at the beginning of your body. (Unfortunately, it is not possible to add it dynamically with Javascript because the mask-image CSS property requires an existing url.)
<pre><code>
<svg viewBox="0 0 1 1" width="0" height="0">
<mask id="tempmask" maskContentUnits="objectBoundingBox"></mask>
<mask id="tempmaskb" maskContentUnits="objectBoundingBox"></mask>
</svg>
</code></pre>
</div>
</section>
<h2 data-short="Slide">The slide structure</h2>
<h3 id="slides-templates">Slides templates</h3>
<section class="title">
<h1>A title slide</h1>
<div class="authordate">John Doe<br/>July 14<sup>th</sup>, 1789</div>
<pre><code>
<section class="title">
<h1>A title slide<br/><span class="subtitle">The subtitle</span></h1>
<div class="authordate">John Doe<br/>July 14<sup>th</sup>, 1789</div>
</section>
</code></pre>
</section>
<section class="content">
<h1>A content slide</h1>
<div class="content">
<ul>
<li>This is the main type of slide</li>
<li>The content will be centered vertically</li>
</ul>
<pre><code>
<section class="content">
<h1>A content slide</h1>
<div class="content">
<ul>
<li>This is the main type of slide</li>
<li>The content will be centered vertically</li>
</ul>
</div>
</section>
</code></pre>
</div>
</section>
<section class="content">
<h1>A two-columns content slide</h1>
<div class="content twocolumns">
<div>
<ul>
<li>Make room for more content with two columns</li>
<li>The columns will be automatically centered</li>
</ul>
</div>
<div>
<pre><code>
<section class="content">
<h1>A content slide</h1>
<div class="content twocolumns">
<div>
<ul>
<li>Make room for more content with two columns</li>
<li>The columns will be automatically centered</li>
</ul>
</div>
<div>
<pre><code>
</code></pre>
</div>
</div>
</section>
</code></pre>
</div>
</div>
</section>
<section class="plain">
<h1>A plain slide</h1>
<div class="content">
<ul>
<li>When you want more place, just remove everything</li>
<li>Now you can use the full page for your content</li>
</ul>
<pre><code>
<section class="plain">
<h1>A plain slide</h1>
<div class="content">
<ul>
<li>When you want more place, just remove everything</li>
<li>Now you can use the full page for your content</li>
</ul>
<pre><code>
</code></pre>
</div>
</section>
</code></pre>
</div>
</section>
<section class="focus">
<h1>A focus slide</h1>
</section>
<section class="chessboard">
<h1>A chessboard slide</h1>
<div class="content">
<div>
<div>
<ul>
<li>A chessboard slide holds any number of divs with alternating colors</li>
<li>The divs are automatically arranged on a chessboard</li>
<li>The dimensions are computed so that each square has the same width and an optimal height</li>
<li>But you have to take care to have the same numbers of cells in each row</li>
</ul>
</div>
<div>
<pre><code>
<section class="chessboard">
<h1>A chessboard slide</h1>
<div class="content">
<div> <div>
<ul>
<li>A chessboard slide holds any number of divs with alternating colors</li>
<li>The divs are automatically arranged on a chessboard</li>
<li>The dimensions are computed so that each square has the same width and an optimal height</li>
<li>But you have to take care to have the same numbers of cells in each row</li>
</ul>
</div> <div>
<pre><code>
</code></pre>
</div> </div>
<div> <div>
<ul> <li>Put each cell in a div</li>
<li>Then put each row of cells in a parent div</li> </ul>
</div> <div>
<ul> <li>The template takes care of everything else</li> </ul>
</div> </div>
</div>
</section>
</code></pre>
</div>
</div>
<div>
<div>
<ul>
<li>Put each cell in a div</li>
<li>Then put each row of cells in a parent div</li>
</ul>
</div>
<div>
<ul>
<li>The template takes care of everything else</li>
</ul>
</div>
</div>
</div>
</section>
<h3>Components of slides</h3>
<section class="content">
<h1>What are components?</h1>
<div class="content">
Components are dynamically-generated pieces of contents that are automatically added to each slide based on their CSS properties. Components are updated when needed when slides are switched.
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Component</td><td>Constructor function</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>Mini-Toc</td>
<td><code>Minitoc()</code></td>
<td>A small clickable outline of the slideshow at the top of the slide</td>
</tr>
<tr>
<td>Footer</td>
<td><code>ClassicFooter()</code></td>
<td>A footer line at the bottom of the slideshow with three part: the date, the title of the slideshow and the page number</td>
</tr>
<tr>
<td>Image background</td>
<td><code>ImageBackground(path)</code></td>
<td>A background image for a slide. <code>path</code> can be either a single string which holds the URL of the background image, or an array of strings in which case the image is randomly chosen from the array</td>
</tr>
<tr>
<td>Color background</td>
<td><code>ColorBackground(color)</code></td>
<td>A color background for a slide. <code>color</code> is the name of the color and must be supported by CSS</td>
</tr>
<tr>
<td>HTML Element</td>
<td><code>SimpleElement(string)</code></td>
<td>An element prepended to the slide. <code>string</code> may be any valid HTML code. Classes defined in the CSS slideshow will apply to the new element.</td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="components" class="content">
<h1>Adding components to the slides</h1>
<div class="content">
Components can be added either inline in the HTML file or in the CSS stylesheet. If set in both, the inline attribute takes precedence over the CSS property.<br/>
HTML attributes and CSS properties:
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>section</td><td>data-components</td><td>--components</td><td>Array of components constructors</td></tr>
</tbody>
</table>
Example of adding components inline:
<pre><code>
<section data-components="[Minitoc(), ClassicFooter()]">
</code></pre>
The same configuration in the CSS stylesheet:
<pre><code>
--components: "[Minitoc(), ClassicFooter()]";
</code></pre>
</div>
</section>
<section id="backfore" data-components="[Minitoc(),ClassicFooter()]" data-foreground="[]" class="content">
<h1>Background and foreground layers</h1>
<div class="content">
<p>Background and foreground layers are two special layers that are automatically added when the <a href="#body-options">corresponding option</a> is set in the body element.</p>
Components can be added to foreground and background layers for each slide.
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>section</td><td>data-background</td><td>--background</td><td>Array of components constructors to add to the background layer</td></tr>
<tr><td>section</td><td>data-foreground</td><td>--foreground</td><td>Array of components constructors to add to the foreground layer</td></tr>
</tbody>
</table>
<p>When the background or foreground layer is not active, adding a component to this layer has no different effect than adding it as a component of the slide (using the data-components attribute or the --components CSS property). But when those layers are active, they are added to the corresponding layer. The net effect is that they stay in place when the slides are animated during a transition.</p>
<p>For this slide, the Minitoc and footer are removed from the foreground layer and attached to the slide components. This is why they're taken with the slide when you switch it.</p>
</div>
</section>
<h3 id="fragment">Fragments</h3>
<section class="content">
<h1>Fragments</h1>
<div class="content">
<p data-fragment="{'0':['invisible'],'2-':['semivisible']}">Fragments are pieces of slides which are displayed or animated when browsing the slideshow. Every HTML element can be animated.</p>
<p data-fragment="{'0-1':['invisible'],'3-':['semivisible']}">Fragments are added with the <code>data-fragment</code> attribute on the element. This attribute holds a <strong>fragment specification</strong>, which is a JSON dictionary (where double quotes are replaced by single quotes). The key is a slide specification and the value if an array of classes to apply to the corresponding elements.</p>
<pre data-fragment="{'0-2':['invisible'],'4-':['semivisible']}"><code>
<p data-fragment="{'0':['invisible'],'2-':['semivisible']}">Fragments are pieces of slides which are displayed or animated when browsing the slideshow. Every HTML element can be animated.</p>
<p data-fragment="{'0-1':['invisible'],'3-':['semivisible']}">Fragments are added with the <var>data-fragment</var> attribute on the element. This attribute may hold a <strong>fragment specification</strong>, which is a JSON dictionary (where double quotes are replaced by single quotes). The key is a slide specification and the value if an array of classes to apply to the corresponding elements.</p>
<pre data-fragment="{'0-2':['invisible']}"><code>
</code></pre>
</code></pre>
<p data-fragment="{'0-3':['invisible'],'5-':['semivisible']}">The <strong>slide specification</strong> is a string with a comma-separated list of intervals ; each interval has the form <code>min-max</code> or can hold a single <code>num</code> value. The classes are applied when the fragment number is between <code>min</code> and <code>max</code>, or when the fragment number is <code>num</code>. Fragment number 0 is the first fragment. The slide specification may also be the keyword <code>"start"</code> ; in this case, the classes are applied to the slide <em>before</em> it appears on the screen. This is mostly useful when applying an animation to the first fragment, in order to set the initial state.</p>
<p data-fragment="{'0-4':['invisible']}">When <code>data-numfragment</code> is included in the slide <code>section</code> attribute, it stands for the number of fragments in the current slide. If it is not given, it is automatically calculated as the maximum fragment number in the fragment specifications (but it may be wrong).</p>
</div>
</section>
<section class="content">
<h1>Fragments</h1>
<div class="content">
<p>When <code>data-numfragment</code> is included in the slide <code>section</code> attribute, it stands for the number of fragments in the current slide. If it is not given, it is automatically calculated as the maximum fragment number in the fragment specifications (but it may be wrong).</p>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>Any</td><td>data-fragment</td><td></td><td>Fragment specification, classes to apply on the element based on the fragment number</td></tr>
<tr><td>section</td><td>data-numfragment</td><td></td><td>Number of fragments in the slide</td></tr>
</tbody>
</table>
</div>
</section>
<section class="content">
<h1>Fragments animation</h1>
<div class="content">
<p class="pulse" data-fanim="{'0': 'fragment_cssanim'}">Fragments can also be animated.</p>
<table class="shadowed" style="width:80%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>Any</td><td>data-fanim</td><td></td><td>Fragment animation specification, function to animate the element based on the fragment number</td></tr>
</tbody>
</table>
<p class="pulse" data-fanim="{'1': 'fragment_cssanim'}">The <strong>fragment animation specification</strong> is a JSON dictionary which keys are slides specifications and which values are names of animation functions. Currently, a single animation function is defined: <code>fragment_cssanim</code>, which runs the CSS animations defined on the element.</p>
<div class="pulse" data-fanim="{'2': 'fragment_cssanim'}">
CSS stylesheet:
<pre><code>
@keyframes pulsebox {
from { transform: scale(1); }
50% { transform: scale(1.2); }
to { transform: scale(1); }
}
.pulse { animation: 1s ease-in-out pulsebox running; }
</code></pre>
HTML code:
<pre><code>
<p class="pulse" data-fanim="{'0': 'fragment_cssanim'}">Fragments can also be animated.</p>
<p class="pulse" data-fanim="{'1': 'fragment_cssanim'}">The <strong>fragment animation specification</strong> is a JSON dictionary which keys are slides specifications and which values are names of animation functions. Currently, a single animation function is defined: <code>fragment_cssanim</code>, which runs the CSS animations defined on the element</p>
</code></pre>
</div>
</div>
</section>
<section class="content" data-autofragment="['.content ul>li',{'before':['semivisible'],'current':['pulse'],'animation':'fragment_cssanim'}]">
<h1>Auto-fragments</h1>
<div class="content">
<ul>
<li>Auto-fragments automatically generate fragments on slides based on CSS selectors or data-attributes</li>
<li>Auto-fragments may be added on any element below and including the slide <code>section</code> element
<ul>
<li>When they are added in the slide <code>section</code> element, they are specified by a two elements array. The first element is a CSS selector to identify all the elements in the slide for which a fragment has to be generated. The second is an auto-fragment specification</li>
<li>When they are added to an element below the <code>section</code> element, they are specified by a single auto-fragment specification. A fragment is generated only for the corresponding element. In this case, it is mostly useful when added in the CSS stylesheet.</li>
</ul>
</li>
</ul>
<table class="shadowed" style="width:90%; margin-left: auto; margin-right: auto">
<thead>
<tr><td>Elements</td><td>HTML attribute</td><td>CSS property</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr><td>section</td><td>data-autofragment</td><td>--autofragment</td><td>JSON array with two elements: a CSS selector and an auto-fragment specification</td></tr>
<tr><td>Any below section</td><td>data-autofragment</td><td>--autofragment</td><td>Auto-fragment specification</td></tr>
</tbody>
</table>
</div>
</section>
<section class="content" data-autofragment="['.content ul>li',{'before':['semivisible'],'current':['pulse'],'animation':'fragment_cssanim'}]">
<h1>Auto-fragments for slides element</h1>
<div class="content">
<ul>
<li>An <strong>auto-fragment specification</strong> is a JSON dictionary which may hold four keys:
<ul>
<li><code>before</code>: Array of names of classes to apply on the element before the current fragment is active</li>
<li><code>current</code>: Array of names of classes to apply when the current fragment is active</li>
<li><code>after</code>: Array of names of classes to apply after the current fragment has been active</li>
<li><code>animation</code>: Name of function used to activate an animation when the current fragment has just been active</li>
</ul>
</li>
<li>Fragments are generated in four steps:
<ul>
<li>Browse all elements in the current slide matching the given selector ;</li>
<li>Each element is made « active » in turn in a numbered fragment ;</li>
<li>Generate a fragment specification for the active element: for all previous fragments, the classes in <code>before</code> are applied ; for the current fragment, the classes in <code>current</code> are applied ; and for the next fragments, the classes in <code>after</code> are applied ;</li>
<li>Generate a fragment animation specification for the active element.</li>
</ul>
</li>
</ul>
<pre><code>
<section class="content" data-autofragment="['.content ul>li',{'before':['semivisible'],'current':['pulse'],'animation':'fragment_cssanim'}]">
<h1>Auto-fragments for slides element</h1>
<div class="content">
<ul>
<li>An <strong>auto-fragment specification</strong> is a JSON dictionary which may hold four keys:
<ul>
<li><code>before</code>: Array of names of classes to apply on the element before the current fragment is active</li>
<li><code>current</code>: Array of names of classes to apply when the current fragment is active</li>
</code></pre>
</div>
</section>
<section id="autofragments-elements" class="content">
<h1>Auto-fragments for elements inside slides</h1>
<div class="content">
<ul>
<li>Auto-fragments may also be applied on elements inside slides</li>
<li>In this case, they are set by a single auto-fragment specification (without the CSS selector used in slides auto-fragment specifications)</li>
<li>Fragments are generated in the same way as for slides auto-fragment specifications, but this way offers more accurate fine-tuning</li>
<li>While it is possible, there is absolutely no benefit of using <code>data-autofragment</code> attributes inline in HTML code when you can also use <code>data-fragment</code> which offers even more customization. On the other hand, this attribute is well suited for CSS stylesheets.</li>
</ul>
CSS stylesheet:
<pre><code>
#autofragments-elements ul > li {
--autofragment: "{'before':['semivisible'],'current':['pulse'],'animation':'fragment_cssanim'}";
}
</code></pre>
HTML code:
<pre><code>
<section id="autofragments-elements" class="content">
<h1>Auto-fragments for elements inside slides</h1>
<div class="content">
<ul>
<li>Auto-fragments may also be applied on elements inside slides</li>
<li>In this case, they are set by a single auto-fragment specification (without the CSS selector used in slides auto-fragment specifications)</li>
</code></pre>
</div>
</section>
<h2 data-short="Widgets">The inner widgets</h2>
<h3>Blocks</h3>
<section class="content">
<h1>Colored blocks</h1>
<div class="content">
<div class="block">
<h1>A standard block</h1>
<div class="content">
This is a standard block to highlight some content.
</div>
</div>
<pre><code>
<div class="block">
<h1>A standard block</h1>
<div class="content">
This is a standard block to highlight some content.
</div>
</div>
</code></pre>
<div class="infoblock">
<h1>An information block</h1>
<div class="content">
This is an informative block.
</div>
</div>
<pre><code>
<div class="infoblock">
<h1>An information block</h1>
<div class="content">
This is an information block.
</div>
</div>
</code></pre>
</div>
</section>
<section class="content">
<h1>Colored blocks</h1>
<div class="content">
<div class="warningblock">
<h1>A warning block</h1>
<div class="content">
This is a warning block.
</div>
</div>
<pre><code>
<div class="warningblock">
<h1>A warning block</h1>
<div class="content">
This is a warning block.
</div>
</div>
</code></pre>
</div>
</section>
<section class="content">
<h1>Citations</h1>
<div class="content">
<div class="block">
<h1>De l'intérêt des citations</h1>
<div class="content">
<blockquote>
Une citation sans références est à peu près aussi utile qu'une horloge sans aiguilles.
</blockquote>
<cite>Samuel Johnson</cite>
</div>
</div>
<pre><code>
<div class="block">
<h1>De l'intérêt des citations</h1>
<div class="content">
<blockquote>
Une citation sans références est à peu près aussi utile qu'une horloge sans aiguilles.
</blockquote>
<cite>Samuel Johnson</cite>
</div>
</code></pre>
</div>
</section>
<h3>Images and tables</h3>
<section class="content">
<h1>Images</h1>
<div class="content">
<p>Images can be automatically centered with the class <code>centered</code>. A shadow may be added with the class <code>shadowed</code></p>
<figure class="centered">