forked from Jugendhackt/Badges-Improved
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuilder.html
70 lines (66 loc) · 2.6 KB
/
builder.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Badge Builder</title>
<style type="text/css">
body {
font-family: "Noto Sans", "Verdana", "Open Sans", sans-serif;
}
.container {
padding: 20px;
}
</style>
</head>
<body>
<div class="container">
<label for="event">Event:</label><br>
<select id="event" onchange="handleFormSubmit();">
<option value="" selected>Please select</option>
<option value="ffm">Frankfurt</option>
<option value="ber">Berlin</option>
<option value="hh">Hamburg</option>
<option value="asia">Asia</option>
<option value="hd">Heidelberg</option>
<option value="ulm">Ulm</option>
<option value="mv">Mecklenburg-Vorpommern</option>
<option value="at">Österreich</option>
<option value="ch">Schweiz</option>
<option value="rem">Remote</option>
</select><br>
<label for="year">Year:</label><br>
<input type="number" id="year" min="2013" max="" oninput="handleFormSubmit();" /><br>
<label for="noyear">Hide Year:</label><br>
<input type="checkbox" id="noyear" onchange="handleFormSubmit()" />
<p>
<b>URL:</b><br>
<code id="url">
https://jhbadge.com/?year=&evt=
</code>
</p>
<p>
<b>Badge:</b><br><br>
<img src="https://jhbadge.com/?year=&evt=" id="image">
</p>
<br>
<p>
<small>
<a href="https://github.com/Jugendhackt/Badges-Improved" target="_blank">Github</a> | <a
href="https://jugendhackt.org" target="_blank">Jugend hackt</a>
</small>
</p>
</div>
<script type="application/javascript">
document.querySelector('#year').setAttribute('max', new Date().getFullYear());
function handleFormSubmit() {
var year = document.querySelector("#year").value;
var event = document.querySelector("#event").value;
var hideYear = document.querySelector("#noyear").checked;
document.querySelector("#url").innerHTML = "https://jhbadge.com/?year=" + year + "&evt=" + event + ((hideYear) ? "&noyear=true" : "");
document.querySelector("#image").src = "https://jhbadge.com/?year=" + year + "&evt=" + event + ((hideYear) ? "&noyear=true" : "");
};
</script>
</body>
</html>