-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html
458 lines (298 loc) · 13.9 KB
/
main.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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
<!DOCTYPE html>
<!-- V1.0 202409300500 -->
<html>
<head>
<meta charset="utf-8">
<meta name="theme-color" content="#B3E5FC">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/camera_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/control_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/drawing_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/[email protected]/face_detection.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.16.9/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>
<script src="https://unpkg.com/pdf-lib"></script>
<script src="https://unpkg.com/fontkit"></script>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="pdf_style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.6.0/jszip.min.js"></script>
</head>
<body>
<div class="container">
<div class="column-leftBar">
<button id="home-page-bt" class="left-round-button-main" style="margin-top: 10%;">
<span class="material-icons">
home
</span>
</button>
<hr style="margin-top: 20%; margin-bottom: 4%; margin-left: 2%; margin-right: 2%;">
<button id="shot-page-bt" class="left-round-button" style="margin-top: 16%;">
<span class="material-icons">
photo_camera
</span>
</button>
<button id="check-page-bt" class="left-round-button" style="margin-top: 16%;">
<span class="material-icons">
fact_check
</span>
</button>
<button id="rename-page-bt" class="left-round-button" style="margin-top: 16%;">
<span class="material-icons">
manage_accounts
</span>
</button>
</div>
<div class="columns-home" id="home-page" style="display: flex; flex-direction:column">
<div class="app-title">
TYCAM 拍照系統
</div>
<div class="app-title" style="font-size: 30; margin: 1%;">
一個完整的流程,協助拍攝新生證件照。
</div>
<div class="teach-container">
<div class="teach-block">
<div class="teach-title">
步驟1
</div>
<div class="teach-text">
拍攝證件照 並自動裁切規定比例
</div>
<div class="teach-text" style="font-size: 20px; margin-top: 10px;">
1.上傳符合格式之學生資料Excel檔案。 <a href="https://github.com/ivan17lai/IDphotoCam-TY/raw/main/excel_file/%E6%9B%B4%E6%96%B0%E5%BE%8C%E7%9A%84%E5%AD%B8%E7%94%9F%E8%B3%87%E6%96%99_%E9%9A%A8%E6%A9%9F%E6%95%B8%E5%AD%97.xlsx
" class="button">範例檔案</a>
<br>
2.選擇班級及學生。<br>
3.打開鏡頭,系統會自動辨識人臉,按下拍照按鈕即可拍攝。<br>
4.下載的證件照比例為 1:1.2 ,檔案名稱可以自行勾選設定。<br>
注意事項:<br>
1.請確認拍攝完成後有確實存檔且照無誤。<br>
2.如果需要列印確認單,檔案名稱至少勾選班級、姓名、身分證,預設為建議選項。<br>
</div>
</div>
<div class="teach-block">
<div class="teach-title">
步驟2
</div>
<div class="teach-text">
列印確認單 確認照片與資料無誤
</div>
<div class="teach-text" style="font-size: 20px; margin-top: 10px;">
1.上傳檔名開頭為X班、Y班的所有學生照片。<br>
2.按下下載或列印按鈕即可下載或列印確認單。<br>
</div>
</div>
<div class="teach-block">
<div class="teach-title">
步驟3
</div>
<div class="teach-text">
將檔案名稱轉換為身分證字號
</div>
<div class="teach-text" style="font-size: 20px; margin-top: 10px;">
1.選擇所有學生的照片,其中檔名必須包括身分證字號。<br>
2.下載檔案<br>
</div>
</div>
</div>
</div>
<div class="micro-set" style="margin-top: 2%; display: none;">
<fieldset>
<legend>檔案名稱組合</legend>
<div>
<input type="checkbox" id="class" name="class" checked />
<label for="class">班級</label>
</div>
<div>
<input type="checkbox" id="sid" name="sid" />
<label for="sid">學號</label>
</div>
<div>
<input type="checkbox" id="sitnu" name="sitnu" checked/>
<label for="sitnu">座號</label>
</div>
<div>
<input type="checkbox" id="name" name="name" checked/>
<label for="name">姓名</label>
</div>
<div style="display: none;">
<input type="checkbox" id="id" name="id" checked/>
<label for="id">身分證</label>
</div>
</fieldset>
</div>
<div class="columns" id="shot-page" style="display: none;">
<div class="column column-input_video" style="display: none;">
<article class="panel is-info">
<div class="panel-block">
<video class="input_video1" ></video>
<video class="video_in" id="video1">
<div id="videoContainer" class="column column-input_video"></div>
</div>
</article>
</div>
<div class="column-classBar">
<div class="classbar-title">
<div class="classbar-text">
班級
</div>
<button id="openfile2" class="openfile-samll" style="display: none;">
<span class="material-icons" style="font-size: 20px">
folder_open
</span>
</button>
</div>
<button id="openfile" class="openfile-button" style="display: block;">
選擇檔案
<span class="material-icons">
folder_open
</span>
</button>
<input type="file" id="fileInput" style="display: none;">
<div class="classbuttom-Bar" id="classbuttom-Bar"></div>
</div>
<div class="column-information">
<div id="student-list"></div>
<div class="student-Bar" id="student-Bar"></div>
</div>
<div class="column-canvas">
<div class="camera-view">
<div class="cap-inf">
<div class="canvas-block">
<canvas class="output1" width="480" height="480" style="display: block;"></canvas>
<div class="shoted" id="shoted" style="display: none;">
<div id="capturedImageContainer"></div>
</div>
</div>
<div class="student-information" id="student-information">
尚未選擇學生
</div>
</div>
<div class="shot-bar" style="margin-left: 5%;">
<button id="captureBtn" class="button is-primary round-button" style="margin-bottom: 10%;">
<span class="material-icons">
photo_camera
</span>
</button>
<button id="size-change" class="button is-primary round-button" style="margin-bottom: 10%; font-size: medium; font-weight: bold;">
5:6
</button>
<div class="slider-container">
<!-- 垂直滑動條 -->
<input type="range" min="0" max="80" value="30" id="vertical-slider">
</div>
</div>
<div class="shoted-bar" style="display: none;">
<button id="reshot" class="button is-primary round-button">
<span class="material-icons">
refresh
</span>
</button>
<button id="savephoto" class="button is-primary round-button" style="margin-top: 10%;">
<span class="material-icons">
save
</span>
</button>
</div>
</div>
</div>
</div>
<div class="columns-home" id="rename-page" style="display: none;">
<div class="column-checkpage-updatefile">
<div class="classbar-title">
<div class="just-column">
<div class="classbar-text">
上傳所有照片<br>
(檔名轉換)
</div>
</div>
<button id="openfile2-rename" class="openfile-samll" style="display: none;">
<span class="material-icons" style="font-size: 20px">
folder_open
</span>
</button>
</div>
<button id="openfile-rename" class="openfile-button" style="display: block;">
選擇檔案
<span class="material-icons">
folder_open
</span>
</button>
<input type="file" id="fileInput-rename" style="display: none;" multiple>
<div class="classbuttom-Bar" id="buttom-Bar-check">
</div>
</div>
<div class="column-checkpage" style="padding: 1%; display: flex; flex-direction: column;">
<div class="buttom-bar" style="display: flex; flex-direction: row;">
<button id="download-all" style="display: none" class="button is-primary round-button-download" style="margin-top: 10%;">
<span class="material-icons" style="margin-bottom: 2%; margin-left: 2%;">
download
</span>
</button>
<button id="delete" style="display: none" class="button is-primary round-button-download" style="margin-top: 10%; margin-left: 20px">
<span class="material-icons">
delete
</span>
</button>
</div>
<div class="overview">
</div>
</div>
</div>
<!-- next page -->
<div class="columns-home" id="check-page" style="display: none;">
<div class="column-checkpage-updatefile">
<div class="classbar-title">
<div class="just-column">
<div class="classbar-text">
上傳所有照片<br>(列印確認單)
</div>
</div>
<button id="openfile2-check" class="openfile-samll" style="display: none;">
<span class="material-icons" style="font-size: 20px">
folder_open
</span>
</button>
</div>
<button id="openfile-check" class="openfile-button" style="display: block;">
選擇檔案
<span class="material-icons">
folder_open
</span>
</button>
<input type="file" id="fileInput-check" style="display: none;" multiple>
<div class="classbuttom-Bar" id="buttom-Bar-check">
</div>
</div>
<div class="column-checkpage" style="padding: 1%;">
<div class="column-buttom" style="display: flex; flex-direction: column;">
<button id="download-pdf" class="button is-primary round-button-download" style="margin-top: 10%;">
<span class="material-icons">
download
</span>
</button>
<button id="print-pdf" class="button is-primary round-button-download" style="margin-top: 10%;">
<span class="material-icons">
print
</span>
</button>
</div>
<div class="pdf-view">
<div id="pages"></div>
</div>
</div>
</div>
<!-- 偷偷放個乖乖 拜託不要出BUG 我已經快忘記我之前在寫甚麼了 -->
<img src="https://www.kuai.com.tw/uploads/product/tw/%E4%B9%96%E4%B9%96%E7%8E%89%E7%B1%B3%E8%84%86%E6%A2%9D_%E5%A5%B6%E6%B2%B9%E6%A4%B0%E5%AD%90.webp" style="display: none;">
</div>
<script type="text/javascript" src="./face1.js"></script>
<script type="text/javascript" src="./excel_read.js"></script>
<script type="text/javascript" src="./randomColor.js"></script>
<script type="text/javascript" src="./page_change.js"></script>
<script type="text/javascript" src="./check_pdf.js"></script>
<script type="text/javascript" src="./rename.js"></script>
<script type="text/javascript" src="./cam.js"></script>
</body>
</html>