-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
222 lines (197 loc) · 5.5 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
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
<!DOCTYPE html>
<html>
<head>
<title>LSST DESC Meeting Badge Preview</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,400i,700" rel="stylesheet">
<style>
html,
body,
button,
input,
select,
textarea {
font-family: "Open Sans", Arial, Helvetica, sans-serif;
}
body>div {
width: 4in;
margin: 0.5in auto;
}
#input div {
width: 100%;
margin: 0.05in 0;
white-space: nowrap;
}
#input label {
display: inline-block;
width: 1.4in;
text-align: right;
}
#input input[type="text"] {
width: 2.35in;
padding: 0.04in;
}
input:invalid {
border: 2px dashed red;
}
#badge {
position: relative;
height: 3in;
border: 1px solid black;
}
#badge span {
font-family: "Raleway";
}
#badge div {
white-space: nowrap;
text-align: center;
width: 100%;
position: absolute;
line-height: 0.8;
}
#lname-d,
#sname-d {
font-weight: bold;
}
#lname-d {
font-size: 68pt;
bottom: 2.05in;
}
#sname-d {
font-size: 26pt;
font-weight: bold;
bottom: 1.55in;
}
#affili-d,
#pronoun-d {
font-size: 22pt;
bottom: 1.08in;
}
#pronoun-d {
font-style: italic;
bottom: 0.64in;
}
#event-d,
#location-d {
font-size: 7pt;
bottom: 0.29in;
left: 0.025in;
}
#location-d {
bottom: 0.15in;
}
.local {
color: orange;
}
#logo1 {
width: 92px !important;
height: 61px;
background-image: url('web-static/desc-logo.png');
bottom: 0.02in;
left: 0.1in;
}
#logo2 {
width: 64px !important;
height: 22px;
background-image: url('web-static/lsstc-logo.png');
bottom: 0.15in;
right: 0.2in;
}
.footer {
font-size: 75%;
line-height: 1.15;
}
</style>
</head>
<body>
<div id="input">
<h3>Preview your LSST DESC meeting badge</h3>
<div>
<label for="lname">Large-font Name</label>
<input type="text" value="Uhura" id="lname" required>
</div>
<div>
<label for="sname">Small-font Name</label>
<input type="text" value="Nyota Uhura" id="sname" required>
</div>
<div>
<label for="affili">Affiliation</label>
<input type="text" value="Starfleet" id="affili" required>
</div>
<div>
<label for="pronoun">Pronoun</label>
<input type="text" value="she/human" id="pronoun" required>
</div>
<div>
<label for="event">Event</label>
<input type="text" value="Collaboration Meeting, Feb. 5-9, 2018" id="event" required>
</div>
<div>
<label for="location">Location</label>
<input type="text" value="SLAC National Accelerator Laboratory" id="location" required>
</div>
<div>
<label for="local">Is local?</label>
<input type="checkbox" id="local">
</div>
</div>
<div id="badge">
<div id="lname-d">
<span id="lname-s"></span>
</div>
<div id="sname-d">
<span id="sname-s"></span>
</div>
<div id="affili-d">
<span id="affili-s"></span>
</div>
<div id="pronoun-d">
<span id="pronoun-s"></span>
</div>
<div id="event-d">
<span id="event-s"></span>
</div>
<div id="location-d">
<span id="location-s"></span>
</div>
<div id="logo1" class="logo"></div>
<div id="logo2" class="logo"></div>
</div>
<div class="footer">
<p>This page and the badge template are designed by
<a href="https://yymao.github.com/">Yao-Yuan Mao</a>.</p>
<p>A LaTeX template that implements this badge design can be found in the
<a href="https://github.com/LSSTDESC/name-tag-guru/">LSSTDESC/name-tag-guru GitHub repo</a>.</p>
<p>The logos on the lower left and right belong to the
<a href="http://lsstdesc.org/">LSST Dark Energy Science Collaboration</a> and the
<a href="https://www.lsstcorporation.org/">LSST Corporation</a> respectively.</p>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script>
$("input").keyup(function () {
var target = $("#" + $(this).attr("id") + "-s");
target.text($(this).val());
target.css("font-size", "100%");
var scale = 370.0 / target.width();
if (scale < 1) target.css("font-size", (scale * 100).toString() + "%");
});
$("#local").change(function () {
$("#lname-s, #sname-s").toggleClass("local");
});
const load_params = function () {
const searchParams = new URLSearchParams(window.location.search);
const keys = ['lname', 'sname', 'affili', 'pronoun'];
if (keys.reduce((accumulator, currentValue) => accumulator || searchParams.has(currentValue), false)) keys.forEach(function (currentValue) { $("#" + currentValue).val(searchParams.has(currentValue) ? searchParams.get(currentValue) : ""); });
['event', 'location'].forEach(function (currentValue) { if (searchParams.has(currentValue)) $("#" + currentValue).val(searchParams.get(currentValue)); });
if(searchParams.get('local')) {
$("#local").prop('checked', true);
$("#local").change();
}
}
load_params();
$("input").keyup();
</script>
</body>
</html>