-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (78 loc) · 2.88 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
<!DOCTYPE html>
<html>
<head>
<title>NixCon 2024 intro generator</title>
<style>
body { background-color: black; }
@font-face {
font-family: 'oxanium';
src: url('fonts/Oxanium-Bold.woff2');
}
* { color: white; }
p { font-family: "oxanium"; }
h1 { font-family: "oxanium"; }
</style>
</head>
<body>
<canvas id="canvas" height="1080" width="1920"></canvas>
<video autoplay controls download id="video"></video>
<script type="application/javascript" src="socket.io.js"></script>
<script type="application/javascript" src="code.js"></script>
<script type="application/javascript">
const socket = io();
socket.on("connect", () => {
console.log("connected");
});
socket.on("disconnect", () => {
console.log("disconnected");
});
const talks = new Object;
loadSchedule().then((ts) => ts.forEach((t) => {
talks[t.id] = t;
}));
socket.on("talk", (talk_id) => {
console.log("Received message:", talk_id);
const talk = talks[talk_id];
const animation = new IntroAnimation("logo.svg", talk.title, "" + talk.persons.map((p) => p.public_name));
var animator = new Animator(document.getElementById('canvas'), null, width, height, animation);
animator.run().then(() => {
console.log('Done recording');
animator = null;
});
});
const width = 1920, height = 1080;
//var init = false;
//var button = document.getElementById('button');
//button.disabled = true;
//const what = document.getElementById('what');
//const talksList = document.getElementById('talks');
//loadSchedule().then((talks) => talks.forEach((t) => {
// const ele = document.createElement('option');
// ele.talk = t;
// ele.value = t.id;
// ele.text = t.id + " - " + t.title;
// talksList.appendChild(ele);
//}));
//document.onreadystatechange = () => {
// if (init) return;
// init =true;
// button.disabled = false;
// button.onclick = () => fontReadyP.then(() => {
// button.disabled = true;
// const w = what.selectedOptions[0].value;
// const talk = talksList.selectedOptions[0].talk;
// var animation;
// if (w == "intro") animation = new IntroAnimation("logo.svg", talk.title, "" + talk.persons.map((p) => p.public_name));
// //if (w == "outro") animation = new OutroAnimation("template.svg", "by.svg");
// //if (w == "pause") animation = new PauseAnimation("template.svg"); // FIXME
// var animator = new Animator(document.getElementById('canvas'), document.getElementById('video'), width, height, animation);
// animator.run().then(() => {
// button.disabled = false;
// console.log('Done recording');
// animator = null;
// });
// });
//}
</script>
</body>
</html>