-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.html
332 lines (319 loc) Β· 14.6 KB
/
profile.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 29.7cm; /* height of A4 paper */
width: 21cm; /* width of A4 paper */
gap: 10px;
padding: 10px;
box-sizing: border-box;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.profiles {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
height: 29.7cm; /* height of A4 paper */
width: 21cm; /* width of A4 paper */
gap: 10px;
padding: 10px;
box-sizing: border-box;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.profile {
display: grid;
grid-template-columns: 1fr;
align-items: center;
height: 25%; /* 1/4 of the height of A4 paper */
}
.profile p {
line-height: 0.2;
margin: 0.5em 0;
}
.profile .profile-img {
width: 100%;
height: 10cm;
object-fit: cover;
}
.profile-info {
border : 1px solid rgba(80, 77, 77, 0.329);
}
.profile-text {
display: flex;
justify-content: space-between;
margin-left: 1mm;
margin-right: 1mm;
}
.logo {
width: 100%;
height: auto;
object-fit: cover;
align-self: end;
}
.forms {
display: flex;
flex-wrap: wrap;
gap: 20px;
width: 21cm;
}
.forms form {
flex: 1 0 7cm;
}
.buttons {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
}
#updateForm input[type="submit"] {
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
font-weight: bolder;
}
button {
padding: 10px;
background-color: #b6542e;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
font-weight: bolder;
}
</style>
</head>
<body>
<svg id="logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="300" height="100" viewBox="0 0 300 90" xml:space="preserve">
<g transform="matrix(0 0 0 0 0 0)" id="fc2d7efd-3c5b-4efe-b565-93bd3f4feb0c">
</g>
<g transform="matrix(1 0 0 1 150 45)" id="23700c87-12f1-4875-9c89-71d99d2e79c4">
<rect class="logo" style="fill: none;" vector-effect="non-scaling-stroke" x="-150"
y="-45" rx="0" ry="0" width="300" height="90" />
</g>
<g transform="matrix(0.65 0 0 0.65 63.63 61.77)">
<text class="logo" xml:space="preserve" font-family="Lato" font-size="105"
font-style="normal" font-weight="900"
style="fill: rgb(223,111,5); white-space: pre;">
<tspan x="-30.45" y="32.98">u</tspan>
</text>
</g>
<g transform="matrix(0.65 0 0 0.65 183.54 61.39)">
<text class="logo" xml:space="preserve" font-family="Lato" font-size="105"
font-style="normal" font-weight="900"
style="fill: rgb(79,119,233); white-space: pre;">
<tspan x="-154.77" y="32.98">stesen</tspan>
</text>
</g>
<g transform="matrix(0.65 0 0 0.75 32.48 58)">
<text class="logo" xml:space="preserve" font-family="Lato" font-size="105"
font-style="normal" font-weight="900"
style="fill: rgb(79,119,233); white-space: pre;">
<tspan x="-22.57" y="32.98">J</tspan>
</text>
</g>
<g transform="matrix(1.03 0 0 1 64.02 38.88)">
<text class="logo" xml:space="preserve" font-family="Lato" font-size="21"
font-style="normal" font-weight="700"
style="fill: rgb(79,119,233); white-space: pre;">
<tspan x="-15.87" y="6.6">ΓΈrn</tspan>
</text>
</g>
</svg>
<div class="forms">
<form id="profileForm1">
<label for="name">Navn:</label><br>
<input type="text" id="name1" name="name"><br>
<label for="phone">Telefon:</label><br>
<input type="text" id="phone1" name="phone"><br>
<label for="email">Email:</label><br>
<input type="text" id="email1" name="email"><br>
<label for="attribute1">Ekstra info (felt 1):</label><br>
<input type="text" id="attribute1_1" name="attribute1"><br>
<label for="attribute2">Ekstra info (felt 2):</label><br>
<input type="text" id="attribute2_1" name="attribute2"><br>
<label for="image">Profil billede:</label><br>
<input type="file" id="image1" name="image" accept="image/*"><br>
</form>
<form id="profileForm2">
<label for="name">Navn:</label><br>
<input type="text" id="name2" name="name"><br>
<label for="phone">Telefon:</label><br>
<input type="text" id="phone2" name="phone"><br>
<label for="email">Email:</label><br>
<input type="text" id="email2" name="email"><br>
<label for="attribute1">Ekstra info (felt 1):</label><br>
<input type="text" id="attribute1_2" name="attribute1"><br>
<label for="attribute2">Ekstra info (felt 2):</label><br>
<input type="text" id="attribute2_2" name="attribute2"><br>
<label for="image">Profil billede:</label><br>
<input type="file" id="image2" name="image" accept="image/*"><br>
</form>
<form id="profileForm3">
<label for="name">Navn:</label><br>
<input type="text" id="name3" name="name"><br>
<label for="phone">Telefon:</label><br>
<input type="text" id="phone3" name="phone"><br>
<label for="email">Email:</label><br>
<input type="text" id="email3" name="email"><br>
<label for="attribute1">Ekstra info (felt 1):</label><br>
<input type="text" id="attribute1_3" name="attribute1"><br>
<label for="attribute2">Ekstra info (felt 2):</label><br>
<input type="text" id="attribute2_3" name="attribute2"><br>
<label for="image">Profil billede:</label><br>
<input type="file" id="image3" name="image" accept="image/*"><br>
</form>
<form id="profileForm4">
<label for="name">Navn:</label><br>
<input type="text" id="name4" name="name"><br>
<label for="phone">Telefon:</label><br>
<input type="text" id="phone4" name="phone"><br>
<label for="email">Email:</label><br>
<input type="text" id="email4" name="email"><br>
<label for="attribute1">Ekstra info (felt 1):</label><br>
<input type="text" id="attribute1_4" name="attribute1"><br>
<label for="attribute2">Ekstra info (felt 2):</label><br>
<input type="text" id="attribute2_4" name="attribute2"><br>
<label for="image">Profil billede:</label><br>
<input type="file" id="image4" name="image" accept="image/*"><br>
</form>
</div>
<div class="buttons">
<form id="updateForm">
<input type="submit" value="Opdater" />
</form>
<button onclick="printDiv()">Print</button>
</div>
<div class="profiles">
<div class="profile" id="profile1">
<img class="profile-img" id="profile1image" />
<img class="logo" src="logo.png" alt="Logo" />
<div class="profile-info">
<div class="profile-text">
<p id="profile1Name"></p>
<p id="profile1Attribute1"></p>
</div>
<div class="profile-text">
<p id="profile1Phone"></p>
<p id="profile1Attribute2"></p>
</div>
<div class="profile-text">
<p id="profile1Email"></p>
</div>
</div>
</div>
<div class="profile" id="profile2">
<img class="profile-img" id="profile2image" />
<img class="logo" src="logo.png" alt="Logo" />
<div class="profile-info">
<div class="profile-text">
<p id="profile2Name"></p>
<p id="profile2Attribute1"></p>
</div>
<div class="profile-text">
<p id="profile2Phone"></p>
<p id="profile2Attribute2"></p>
</div>
<div class="profile-text">
<p id="profile2Email"></p>
</div>
</div>
</div>
<div class="profile" id="profile3">
<img class="profile-img" id="profile3image" />
<img class="logo" src="logo.png" alt="Logo" />
<div class="profile-info">
<div class="profile-text">
<p id="profile3Name"></p>
<p id="profile3Attribute1"></p>
</div>
<div class="profile-text">
<p id="profile3Phone"></p>
<p id="profile3Attribute2"></p>
</div>
<div class="profile-text">
<p id="profile3Email"></p>
</div>
</div>
</div>
<div class="profile" id="profile4">
<img class="profile-img" id="profile4image" />
<img class="logo" src="logo.png" alt="Logo" />
<div class="profile-info">
<div class="profile-text">
<p id="profile4Name"></p>
<p id="profile4Attribute1"></p>
</div>
<div class="profile-text">
<p id="profile4Phone"></p>
<p id="profile4Attribute2"></p>
</div>
<div class="profile-text">
<p id="profile4Email"></p>
</div>
</div>
</div>
</div>
<script>
document.getElementById('updateForm').addEventListener('submit', function(event) {
event.preventDefault();
document.getElementById('profile1Name').textContent = document.getElementById('name1').value;
document.getElementById('profile1Attribute1').textContent = document.getElementById('attribute1_1').value;
document.getElementById('profile1Phone').textContent = 'π ' + document.getElementById('phone1').value;
document.getElementById('profile1Attribute2').textContent = document.getElementById('attribute2_1').value;
document.getElementById('profile1Email').textContent = 'βοΈ ' + document.getElementById('email1').value;
document.getElementById('profile2Name').textContent = document.getElementById('name2').value;
document.getElementById('profile2Attribute1').textContent = document.getElementById('attribute1_2').value;
document.getElementById('profile2Phone').textContent = 'π ' + document.getElementById('phone2').value;
document.getElementById('profile2Attribute2').textContent = document.getElementById('attribute2_2').value;
document.getElementById('profile2Email').textContent = 'βοΈ ' + document.getElementById('email2').value;
document.getElementById('profile3Name').textContent = document.getElementById('name3').value;
document.getElementById('profile3Attribute1').textContent = document.getElementById('attribute1_3').value;
document.getElementById('profile3Phone').textContent = 'π ' + document.getElementById('phone3').value;
document.getElementById('profile3Attribute2').textContent = document.getElementById('attribute2_3').value;
document.getElementById('profile3Email').textContent = 'βοΈ ' + document.getElementById('email3').value;
document.getElementById('profile4Name').textContent = document.getElementById('name4').value;
document.getElementById('profile4Attribute1').textContent = document.getElementById('attribute1_4').value;
document.getElementById('profile4Phone').textContent = 'π ' + document.getElementById('phone4').value;
document.getElementById('profile4Attribute2').textContent = document.getElementById('attribute2_4').value;
document.getElementById('profile4Email').textContent = 'βοΈ ' + document.getElementById('email4').value;
var reader = new FileReader();
reader.onload = function(e) {
document.querySelector('#profile1image').src = e.target.result;
}
reader.readAsDataURL(document.getElementById('image1').files[0]);
var reader = new FileReader();
reader.onload = function(e) {
document.querySelector('#profile2image').src = e.target.result;
}
reader.readAsDataURL(document.getElementById('image2').files[0]);
var reader = new FileReader();
reader.onload = function(e) {
document.querySelector('#profile3image').src = e.target.result;
}
reader.readAsDataURL(document.getElementById('image3').files[0]);
var reader = new FileReader();
reader.onload = function(e) {
document.querySelector('#profile4image').src = e.target.result;
}
reader.readAsDataURL(document.getElementById('image4').files[0]);
});
function printDiv() {
var divContents = document.querySelector('.profiles').outerHTML;
var style = document.querySelector('style');
var printWindow = window.open('', '_blank');
printWindow.document.write('<html><head><title>Print</title>');
printWindow.document.write(style.outerHTML);
printWindow.document.write('</head><body>');
printWindow.document.write(divContents);
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
}
</script>
</body>
</html>