返回 reveal.js
multiple-presentations.html
根目录 / examples / multiple-presentations.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8" />
5
6 <title>reveal.js - Multiple Presentations</title>
7
8 <meta
9 name="viewport"
10 content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
11 />
12
13 <link rel="stylesheet" href="../dist/reveal.css" />
14 <link rel="stylesheet" href="../dist/theme/white.css" id="theme" />
15 <link rel="stylesheet" href="../dist/plugin/highlight/monokai.css" />
16 </head>
17
18 <body style="background: #ddd">
19 <div style="display: flex; flex-direction: row">
20 <div class="reveal deck1" style="width: 100%; height: 50vh; margin: 10px">
21 <div class="slides">
22 <section>Deck 1, Slide 1</section>
23 <section>Deck 1, Slide 2</section>
24 <section>
25 <pre data-id="code-animation"><code class="hljs" data-trim data-line-numbers>
26 import React, { useState } from 'react';
27 function Example() {
28 const [count, setCount] = useState(0);
29 }
30 </code></pre>
31 </section>
32 </div>
33 </div>
34
35 <div class="reveal deck2" style="width: 100%; height: 50vh; margin: 10px">
36 <div class="slides">
37 <section>Deck 2, Slide 1</section>
38 <section>Deck 2, Slide 2</section>
39 <section data-markdown>
40 <script type="text/template">
41 ## Markdown plugin
42
43 - 1
44 - 2
45 - 3
46 </script>
47 </section>
48 <section>
49 <h3>The Lorenz Equations</h3>
50
51 <!-- prettier-ignore -->
52 \[\begin{aligned}
53 \dot{x} &amp; = \sigma(y-x) \\
54 \dot{y} &amp; = \rho x - y - xz \\
55 \dot{z} &amp; = -\beta z + xy
56 \end{aligned} \]
57 </section>
58 </div>
59 </div>
60 </div>
61
62 <style>
63 .reveal {
64 border: 4px solid #ccc;
65 }
66 .reveal.focused {
67 border-color: #94b5ff;
68 }
69 </style>
70
71 <script src="../dist/reveal.js"></script>
72 <script src="../dist/plugin/highlight.js"></script>
73 <script src="../dist/plugin/markdown.js"></script>
74 <script src="../dist/plugin/math.js"></script>
75 <script>
76 let deck1 = new Reveal(document.querySelector('.deck1'), {
77 embedded: true,
78 progress: false,
79 keyboardCondition: 'focused',
80 plugins: [RevealHighlight],
81 });
82 deck1.on('slidechanged', () => {
83 console.log('Deck 1 slide changed');
84 });
85 deck1.initialize();
86
87 let deck2 = new Reveal(document.querySelector('.deck2'), {
88 embedded: true,
89 progress: false,
90 keyboardCondition: 'focused',
91 plugins: [RevealMarkdown, RevealMath],
92 });
93 deck2.initialize().then(() => {
94 deck2.slide(1);
95 });
96 deck2.on('slidechanged', () => {
97 console.log('Deck 2 slide changed');
98 });
99 </script>
100 </body>
101 </html>
102
102 lines HTML