-
Notifications
You must be signed in to change notification settings - Fork 0
/
hotdesk.html
222 lines (195 loc) · 5.49 KB
/
hotdesk.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
<html>
<head>
<title>Desk name sign</title>
<!-- <link rel="stylesheet" href="https://use.typekit.net/ooq5ezx.css"> -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Noto+Sans+Mono:wght@700&family=Roboto+Condensed:wght@700&display=swap"
rel="stylesheet"
/>
<style>
body {
/* font-family: neue-haas-grotesk-text, sans-serif; */
font-family: "Inter", sans-serif;
max-width: 10in;
max-height: 7.5in;
}
.nametag {
height: 64mm;
width: 215mm;
margin: 3em auto;
position: relative;
border: 0.5em solid white;
display: flex;
outline: 1em solid white;
outline-offset: -1em;
}
.nametag:before,
.nametag:after {
position: absolute;
content: "";
border: solid black;
z-index: -1;
}
.nametag:before {
top: -2em;
bottom: -2em;
left: 0;
right: 0;
border-width: 0 0.5px;
}
.nametag:after {
left: -2em;
right: -2em;
top: 0;
bottom: 0;
border-width: 0.5px 0;
}
.name {
align-self: stretch;
flex-grow: 1;
font-size: 1.1cm;
font-weight: 700;
line-height: 105%;
margin: 0.7cm 1.5cm 0.7cm 0.8cm;
}
.name div {
margin: 0 0 0.7cm;
border-bottom: 1px dotted #2e74b66d;
white-space: nowrap;
}
.name div.noborder {
border: none;
}
.name div.condensed {
font-family: "Roboto Condensed", sans-serif;
}
.details {
width: 5cm;
font-weight: 600;
color: #2e75b6;
}
.labpi {
margin: 0.8cm 0 0;
font-size: 0.7cm;
line-height: 105%;
}
.desknote {
margin-top: 0.1cm;
font-size: 0.5cm;
text-transform: uppercase;
}
.location {
font-size: 2.75cm;
margin: 6mm 0 0 -1.7mm;
line-height: 100%;
/* font-family: interstate-mono, monospace; */
font-family: "Noto Sans Mono", monospace;
font-weight: 700;
font-style: normal;
letter-spacing: -2mm;
text-transform: uppercase;
}
.instructions {
text-align: center;
margin-top: 10mm;
}
.hidden {
opacity: 25%;
}
@media not screen {
.instructions {
display: none;
}
.hidden {
display: none;
}
}
@media print {
/* html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
} */
@page {
size: letter landscape;
height: 100%;
width: 100%;
}
}
</style>
</head>
<body>
<div class="nametag">
<div class="name">
<div contenteditable="True">Wednesday Addams</div>
<div contenteditable="True">Enid Sinclair</div>
<div contenteditable="True">Bianca Barclay</div>
</div>
<div class="details">
<div class="labpi">
<span contenteditable="true" style="font-weight: 700">Ibrahim</span>
<span contenteditable="true" style="font-weight: normal">Lab</span>
</div>
<div class="desknote" contenteditable="true">Shared Desk</div>
<div class="location" contenteditable="true">P1</div>
</div>
</div>
<div class="nametag">
<div class="name">
<div contenteditable="True">Xavier Thorpe</div>
<div contenteditable="True">Eugene Otinger</div>
<div contenteditable="True">Tyler Galpin</div>
</div>
<div class="details">
<div class="labpi">
<span contenteditable="true" style="font-weight: 700">Ibrahim</span>
<span contenteditable="true" style="font-weight: normal">Lab</span>
</div>
<div class="desknote" contenteditable="true">Shared Desk</div>
<div class="location" contenteditable="true">P1</div>
</div>
</div>
<p class="instructions">
This template was optimized for Chromium browsers like Edge and Chrome.<br />Print
in Landscape at 100% size. Final output should be 215 x 64 mm.<br /><br />
If there's trouble with rendering, try this page in Incognito / Private
browsing mode to exclude interference from add-ons.
</p>
<script>
function hideIfEmpty(el) {
let sibs = el.parentNode.childNodes;
let empty = true;
for (const e of sibs.values()) {
if (e.nodeName == "DIV" && e.innerText.trim() != "") {
empty = false;
break;
}
}
if (empty) {
el.closest("div.nametag").classList.add("hidden");
} else {
el.closest("div.nametag").classList.remove("hidden");
}
}
document.querySelectorAll(".name div").forEach((el) => {
el.addEventListener("input", (e) => {
const el = e.target;
if (el.innerText.trim() == "") {
el.classList.add("noborder");
} else {
el.classList.remove("noborder");
}
hideIfEmpty(el);
el.classList.remove("condensed");
if (el.scrollWidth > 537) {
el.classList.add("condensed");
}
});
});
</script>
</body>
</html>