forked from rajgoel/reveal.js-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseminar-demo.html
269 lines (243 loc) · 9.87 KB
/
seminar-demo.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Seminars with Reveal.js</title>
<meta name="description" content="A plugin for reveal.js">
<meta name="author" content="Asvin Goel">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="../reveal.js/dist/reveal.css">
<link rel="stylesheet" href="../reveal.js/dist/theme/black.css" id="theme">
<link rel="stylesheet" href="../reveal.js/plugin/highlight/zenburn.css">
<link rel="stylesheet" href="../reveal.js-plugins/chalkboard/style.css">
<link rel="stylesheet" href="../reveal.js-plugins/poll/style.css">
<link rel="stylesheet" href="../reveal.js-plugins/questions/style.css">
<script src="../reveal.js/dist/reveal.js"></script>
<script src="../reveal.js/plugin/markdown/markdown.js"></script>
<script src="../reveal.js/plugin/highlight/highlight.js"></script>
<script src="../reveal.js-plugins/menu/menu.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.2.0/chart.min.js"></script>
<script src="../reveal.js-plugins/chart/plugin.js"></script>
<script src="../reveal.js-plugins/chalkboard/plugin.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script>
<script src="../reveal.js-plugins/seminar/plugin.js"></script>
<script src="../reveal.js-plugins/poll/plugin.js"></script>
<script src="../reveal.js-plugins/questions/plugin.js"></script>
<!-- Font awesome -->
<link rel="stylesheet" href="../reveal.js-plugins/menu/font-awesome/css/fontawesome.css">
<script async defer src="https://buttons.github.io/buttons.js"></script>
<style>
#seminar-status {
display: block;
position: fixed;
top: 0;
z-index: 24;
height: 1em;
width: 100%;
font-size: 20px;
color: lightgray;
font-family: "courier";
text-align: center;
}
</style>
</head>
<body>
<div id="seminar-status">
TEST
</div>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section data-audio-text="This is a demo of the chalkboard plugin for Reveal js">
<h1>Seminars with Reveal.js</h1>
<p>
<small>Created by <a href="http://www.telematique.eu" >Asvin Goel</a></small>
</p>
</section>
<section>
<h3>Provide password</h3>
<div>A password is required to host a seminar.</div>
<div><input type="password" id="password" style="font-size:70%;" value="123456"></div>
<div style="font-size:24px;color:gray;"> In this demo the password is '123456'</div>
</section>
<section>
<h3>Host seminar</h3>
<div>Click <a id="host" href="#"><i class="fa fa-users"></i></a> to host the seminar.</div>
</section>
<section>
<h2>Invite clients</h2>
<div>
<canvas id="qrcode" style="width:300px;height:300px;"></canvas>
</div>
<a id="room"></a>
</section>
<section>
<h3>Q & A</h3>
<div>When connected to an open seminar room, you see a button with a <span class="fa-stack" style="margin: -10px;"><span class="fa fa-comment fa-stack-1x"></span><strong class="fa-stack-1x qna question-counter" style="color:black;font-size:0.5em;"></strong></span> symbol at the bottom left.</div>
<div> Click on that button to toggle the question dashboard, and ask questions, or upvote questions. Hosts are allowed to close questions.</div>
</section>
<section>
<h2>Chalkboard</h2>
<div>Chalkboard drawings of each host are displayed on the screens of all participants.</div>
<div>(click <i class="fa fa-pen-square"></i> or <i class="fa fa-pen"></i> below to draw)</div>
</section>
<section>
<h2>Poll</h2>
<div>Live polls can be included in presentations, allowing seminar participants to vote.</div>
<div class="poll" data-poll="1">
<button data-value="yes">Yes</button>
<br>
<button data-value="no">No</button>
</div>
<p style="font-size:24px;color:gray;">Responses: <span class="voters" data-poll="1">0</span></p>
</section>
<section>
<h2>Poll results</h2>
<div>Poll results can be shown as text.</div>
<blockquote class="results" data-poll="1">
Yes: <span data-value="yes">0</span><br>
No: <span data-value="no">0</span><br>
<p style="font-size:24px;color:gray;">Total: <span class="voters" data-poll="1">0</span></p>
</blockquote>
<div>Alternatively, results can be shown as charts (see next slides).</div>
</section>
<section>
<h2>Pie chart of poll result</h2>
<div style="height:480px">
<canvas data-chart="pie" data-poll="1">
, Yes, No
, 0, 0
</canvas>
</div>
</section>
<section>
<h2>Bar chart of poll result</h2>
<div style="height:480px">
<canvas data-chart="bar" data-poll="1">
, Yes, No
, 0, 0
</canvas>
</div>
</section>
<section>
<h3>Close seminar</h3>
<div>When the seminar has ended, any host can click <a id="close" href="#"><i class="fa fa-window-close"></i></a> to close the seminar room and kick out remaining participants.</div>
</section>
<section>
<h2>The end</h2>
<p>Check out other plugins by clicking on <a href="#" onclick="RevealMenu.toggle(); return false;"><i class="fa fa-bars"></i></a> and then on "Plugins <i class="fa fa-external-link-alt"></i>".</p>
<p>Have a look at the source code & documentation on <a href="https://github.com/rajgoel/reveal.js-plugins">Github</a>.</p>
<a aria-label="Download rajgoel/reveal.js-plugins on GitHub" data-style="mega" href="https://github.com/rajgoel/reveal.js-plugins/archive/master.zip" class="github-button">Download</a>
<a aria-label="Star rajgoel/reveal.js-plugins on GitHub" data-count-aria-label="# stargazers on GitHub" data-count-api="/repos/rajgoel/reveal.js-plugins#stargazers_count" data-count-href="/rajgoel/reveal.js-plugins/stargazers" data-style="mega" href="https://github.com/rajgoel/reveal.js-plugins" class="github-button">Star</a>
</section>
</div>
</div>
<script>
function generateToken(length) {
var token = "";
while ( token.length < length ) {
token += (Math.random() * new Date().getTime()).toString(36).replace(/\./g, '');
}
return token.substr(0,length);
}
function getParameterByName(name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function addParam(url, param, value) {
var a = document.createElement('a'), regex = /(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;
var match, str = []; a.href = url; param = encodeURIComponent(param);
while (match = regex.exec(a.search)) {
if (param != match[1]) str.push(match[1]+(match[2]?"="+match[2]:""));
}
str.push(param+(value?"="+ encodeURIComponent(value):""));
a.search = str.join("&");
return a.href;
}
/*
function updateURL() {
// document.getElementById("room").innerHTML =
alert( addParam(window.location.href, "room", document.getElementById('room').value ) );
}
*/
function logger( event ) {
document.getElementById("seminar-status").innerHTML = event;
console.log( event );
}
var room = getParameterByName("room") || generateToken(32);
var link = addParam(window.location.href, "room", room );
document.getElementById("room").innerHTML = link;
document.getElementById("room").href = link;
var qrcode = new QRious({ element: document.getElementById('qrcode'), level: 'H', padding: 25, size: 500, value: link });
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: false,
center: true,
mouseWheel: true,
menu: { // Menu works best with font-awesome installed: sudo apt-get install fonts-font-awesome
themes: false,
transitions: false,
markers: true,
hideMissingTitles: true,
custom: [
{ title: 'Plugins', icon: '<i class="fa fa-external-link-alt"></i>', src: 'toc.html' },
{ title: 'About', icon: '<i class="fa fa-info"></i>', src: 'about.html' }
]
},
chart: {
defaults: {
color: 'lightgray', // color of labels
scale: {
beginAtZero: true,
ticks: { stepSize: 1 },
grid: { color: "lightgray" } , // color of grid lines
},
},
bar: { backgroundColor: [ "rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)" ]},
pie: { backgroundColor: [ ["rgba(20,220,220,.8)" , "rgba(220,120,120,.8)", "rgba(20,120,220,.8)"] ]},
},
seminar: {
server: "https://reveal-seminar.herokuapp.com",
port: 4433,
hash: '$2a$05$hhgakVn1DWBfgfSwMihABeYToIBEiQGJ.ONa.HWEiNGNI6mxFCy8S', // password for the hash is '123456'
room: room,
logger: logger,
autoJoin: true
},
chalkboard: { // font-awesome.min.css must be available
// src: "chalkboard/chalkboard.json",
storage: "chalkboard-demo",
toggleChalkboardButton: { left: "80px" },
toggleNotesButton: { left: "130px" },
readOnly: false,
},
questions: {
toggleQnAButton: { left: "180px" },
},
plugins: [ RevealMarkdown, RevealMenu, RevealHighlight, RevealChart, RevealSeminar, RevealChalkboard, RevealPoll, RevealQnA ],
});
document.querySelector("#host").addEventListener('click', function(e) {
e.preventDefault();
RevealSeminar.open_or_join_room(document.getElementById('password').value);
});
document.querySelector("#close").addEventListener('click', function(e) {
e.preventDefault();
RevealSeminar.close_room(document.getElementById('password').value);
});
</script>
<a href="https://github.com/rajgoel/reveal.js-plugins"><img style="position: absolute; top: 0; left: 0; border: 0;" src="forkme.png"></a>
</body>
</html>