-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (72 loc) · 3.13 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>reveal.js</title>
<link rel="stylesheet" href="./dist/reset.css">
<link rel="stylesheet" href="./dist/reveal.css">
<link rel="stylesheet" href="./dist/theme/night.css"> <!-- This is the theme for the slides -->
<link rel="stylesheet" href="plugin/highlight/monokai.css"> <!-- This is the theme for the code highlighting -->
<!-- <link rel="stylesheet" href="plugin/highlight/github-dark.css"> --> <!-- An alternative code theme I didn't like as much -->
<link rel="stylesheet" type="text/css" href="./plugin/asciinema/asciinema-player.css" />
<!-- This is a modified theme for asciinema to git better with reveal.js's night theme -->
<link rel="stylesheet" type="text/css" href="./plugin/asciinema/reveal-asciinema-theme.css" />
<!-- An extra bit of CSS to make the code blocks a little bit bigger -->
<style>
code {
font-size: 1.2em;
line-height: 1.2em;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-markdown="slides.md"></section>
</div>
</div>
<script src="./dist/reveal.js"></script>
<script src="./plugin/notes/notes.js"></script>
<script src="./plugin/markdown/markdown.js"></script>
<script src="./plugin/highlight/highlight.js"></script>
<script src="./plugin/anything/plugin.js"></script>
<script src="./plugin/asciinema/asciinema-player.js"></script>
<script src="./plugin/countdown/countdown.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
anything: [
{className: "asciicast",
initialize: (function(container, options) {
// Defaults for the asciinema player
const defaults = {'font-size': "large", theme: "asciinema", start : 0, "idle_time_limit": 2};
options = {...defaults, ...options};
// console.log(options.URL, container, options);
const player = asciinema.player.js.CreatePlayer(container, options.URL, options);
// console.log(player);
// Add a callback to play/pause the player whenever the slide that it is on transitions
// Note this adds a separate callback for every player
// if you have many many players in a slide deck this may get slow, I haven't tested it
Reveal.on( 'slidetransitionend', event => {
// console.log(player, event.currentSlide.contains(container));
if(event.currentSlide.contains(container)) {
console.log(options.start);
player.setCurrentTime(options.start);
player.play();
}
else player.pause();
});
})
},
],
// Learn about plugins: https://revealjs.com/plugins/
dependencies: [{ src: "plugin/countdown/countdown.js" },],
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes, RevealAnything],
});
</script>
</body>
</html>