Skip to content

add intro generator #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions intro-generator/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[*.js]
indent_type = space
tab_width = 4
155 changes: 155 additions & 0 deletions intro-generator/by.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
488 changes: 488 additions & 0 deletions intro-generator/code.js

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions intro-generator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html>
<head>
<title>NixCon 2023 intro generator</title>
<link rel="preload" href="https://2023.nixcon.org/fonts/Behrensschrift-SH.otf" as="font" type="font/otf" crossorigin>
<style>
body { background-color: black; }
@font-face {
font-family: 'Behrensschirft';
src: url('https://2023.nixcon.org/fonts/Behrensschrift-SH.otf');
}
p { font-family: 'Behrensschrift'; }
</style>
</head>

<body>
<p>Test</p>
<button id="button">Render</button>
<select name="talks" id="talks">
</select>
<select name="what" id="what">
<option value="intro">intro</option>
<option value="outro">outro</option>
<option value="pause">pause</option>
</select>
<br />
<canvas id="canvas" height="1080" width="1920"></canvas>
<video autoplay controls download id="video"></video>

<script type="application/javascript" src="code.js"></script>
<script type="application/javascript">
var fontReadyP = (new FontFace('Behrensschrift', 'url(https://2023.nixcon.org/fonts/Behrensschrift-SH.otf)').load().then((f) => {
console.log('font loaded');
document.fonts.add(f);
}));
const width = 1920, height = 1080;
//var animation = new Animation("template.svg");
//var outroAnimation = ;

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("intro.png", 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');
});
});
}
</script>
</body>
</html>
Binary file added intro-generator/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,451 changes: 1,451 additions & 0 deletions intro-generator/intro.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
203 changes: 203 additions & 0 deletions intro-generator/template.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.