Skip to content

Commit 7799d64

Browse files
feat: update v1 (#14)
- updated home page - updated template - updated to dcv 2.4.2000 - add image preview and crop image to the recognized text lines - removed redundant MRZ formatter (already in template) - add validation status icons to result from DCP - add comm100 livechat
1 parent d80e03e commit 7799d64

File tree

15 files changed

+701
-237
lines changed

15 files changed

+701
-237
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ git clone https://github.com/Dynamsoft/mrz-scanner-javascript
3030

3131
## Request a Trial License
3232

33-
The key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" used in this solution (found in the js/init.js file) is a test license valid for 24 hours for any newly authorized browser. If you wish to test the SDK further, you can request a 30-day free trial license through the <a href="https://www.dynamsoft.com/customer/license/trialLicense?product=mrz&utm_source=samples&package=js" target="_blank">Request a Trial License</a> link.
33+
The key "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" used in this solution (found in the js/init.js file) is a test license valid for 24 hours for any newly authorized browser. If you wish to test the SDK further, you can request a 30-day free trial license through the <a href="https://www.dynamsoft.com/customer/license/trialLicense?product=mrz&utm_source=samples&package=js" target="_blank">Request a Trial License</a> link. For more information, see [Specify the License](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/user-guide/mrz-scanner.html#specify-the-license) or contact [[email protected]](mailto:[email protected]).
3434

3535
## Project Structure
3636

File renamed without changes.
File renamed without changes.

assets/external-link.svg

Lines changed: 17 additions & 0 deletions
Loading
File renamed without changes.

assets/qr-code.svg

Lines changed: 181 additions & 0 deletions
Loading

assets/upload-menu.svg

Lines changed: 14 additions & 0 deletions
Loading

assets/video-camera.svg

Lines changed: 28 additions & 0 deletions
Loading

css/index.css

Lines changed: 124 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,44 +57,74 @@ img {
5757
}
5858

5959
.home-page .logo {
60-
width: 150px;
61-
height: 36px;
60+
width: 112.5px;
61+
height: 27px;
6262
}
6363

6464
.home-page .description {
65-
width: 50%;
65+
width: 85%;
6666
text-align: center;
6767
background-color: #323234;
6868
margin: 0 auto;
69-
padding: 2rem;
69+
padding: 1rem 2rem 2rem;
7070
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
7171
}
7272

7373
.home-page .description .title {
74-
font-size: 30px;
74+
font-size: 26px;
7575
font-family: Oswald-Regular;
7676
}
7777

7878
.home-page .description .content {
7979
font-family: OpenSans-Regular;
8080
font-size: 16px;
8181
line-height: 26px;
82-
margin: 16px 0 25px;
82+
margin: 1rem 0 1rem;
83+
}
84+
85+
.home-page .description .desktop-qr-container {
86+
font-family: OpenSans-Regular;
87+
background-color: #2b2b2b;
88+
padding: 2rem;
89+
border-radius: 8px;
90+
display: flex;
91+
flex-direction: column;
92+
gap: 0.5rem;
93+
justify-content: center;
94+
align-items: center;
95+
}
96+
97+
.home-page .description .desktop-start-btn {
98+
font-family: OpenSans-Regular;
99+
background-color: #2b2b2b;
100+
margin-top: 1rem;
101+
padding: 2rem;
102+
border-radius: 8px;
103+
display: flex;
104+
flex-direction: column;
105+
align-items: start;
106+
gap: 1rem;
107+
text-align: start;
108+
}
109+
110+
.home-page .description .desktop-start-btn .start-btn {
111+
display: flex;
112+
width: 100%;
83113
}
84114

85115
.home-page .description .start-btn {
86-
width: 180px;
87116
height: 6vh;
88117
min-height: 40px;
89118
max-height: 60px;
90119
background-color: #fe8e14;
91120
font-family: Oswald-Regular;
92-
font-size: 20px;
121+
font-size: 16px;
93122
margin: 0 auto;
94-
display: flex;
123+
display: none;
95124
justify-content: center;
96125
align-items: center;
97126
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
127+
padding: 2rem;
98128
}
99129

100130
.home-page .description .start-btn:hover {
@@ -185,8 +215,8 @@ img {
185215
}
186216

187217
.scanner-container .header .music-container {
188-
width: 30px;
189-
height: 30px;
218+
width: 24px;
219+
height: 24px;
190220
cursor: pointer;
191221
display: flex;
192222
align-items: center;
@@ -208,6 +238,20 @@ img {
208238
display: none;
209239
}
210240

241+
.scanner-container .header .upload-img-btn {
242+
width: 24px;
243+
height: 24px;
244+
cursor: pointer;
245+
display: flex;
246+
align-items: center;
247+
cursor: pointer;
248+
}
249+
250+
.scanner-container .header .upload-img-icon {
251+
width: 24px;
252+
height: 24px;
253+
}
254+
211255
.result-container {
212256
position: absolute;
213257
width: 100%;
@@ -239,6 +283,17 @@ img {
239283
color: #aaaaaa;
240284
}
241285

286+
.result-container .scanned-image {
287+
max-height: 200px;
288+
}
289+
290+
.result-container .scanned-image img,
291+
.result-container .scanned-image canvas {
292+
object-fit: contain;
293+
width: 100%;
294+
height: 100%;
295+
}
296+
242297
.result-container .parsed-result-area {
243298
width: 100%;
244299
height: 84%;
@@ -254,15 +309,38 @@ img {
254309

255310
.result-container .parsed-result-area .parsed-filed .field-name {
256311
color: #aaaaaa;
312+
display: flex;
313+
align-items: center;
314+
gap: 0.5rem;
257315
}
258316
.result-container .parsed-result-area .parsed-filed .field-value {
259317
word-wrap: break-word;
260318
}
319+
261320
.result-container .parsed-result-area .code .field-value {
262321
font-family: monospace;
263322
}
264323

265-
.result-container .restart-video {
324+
.result-container .parsed-result-area .parsed-filed .status-icon {
325+
display: inline-flex;
326+
align-items: center;
327+
cursor: help; /* Indicates there's a tooltip */
328+
}
329+
330+
.result-container .parsed-result-area .parsed-filed .status-icon svg {
331+
width: 16px;
332+
height: 16px;
333+
}
334+
335+
.result-container .parsed-result-area .parsed-filed .status-success {
336+
color: #22c55e; /* Green */
337+
}
338+
339+
.result-container .parsed-result-area .parsed-filed .status-failed {
340+
color: #ef4444; /* Red */
341+
}
342+
343+
.result-container .scan-again {
266344
width: 100%;
267345
height: 10%;
268346
min-height: 60px;
@@ -274,7 +352,7 @@ img {
274352
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
275353
}
276354

277-
.result-container .restart-video .btn-restart-video {
355+
.result-container .scan-again .btn-scan-again {
278356
width: 160px;
279357
height: 60%;
280358
border: 0;
@@ -450,6 +528,20 @@ img {
450528
}
451529
}
452530

531+
/* LIVE CHAT */
532+
.scanner-container .header .live-chat {
533+
width: 24px;
534+
height: 24px;
535+
cursor: pointer;
536+
display: none;
537+
align-items: center;
538+
cursor: pointer;
539+
}
540+
541+
.scanner-container .header .live-chat:hover {
542+
opacity: 0.8;
543+
}
544+
453545
@media screen and (max-width: 800px) {
454546
html,
455547
body,
@@ -462,8 +554,27 @@ img {
462554
box-shadow: none;
463555
}
464556

557+
.home-page .description .desktop-qr-container {
558+
display: none;
559+
}
560+
561+
.home-page .description .desktop-start-btn {
562+
display: none;
563+
}
564+
465565
.home-page .description .start-btn {
566+
display: flex;
466567
font-size: 20px;
568+
padding: 1.5rem;
569+
}
570+
571+
/* LIVE CHAT CSS */
572+
.live-chat {
573+
display: flex !important;
574+
}
575+
576+
#comm100-float-button-20242b05-3781-4d86-9b7f-fab63ddcdde3-2 {
577+
display: none !important;
467578
}
468579
}
469580

0 commit comments

Comments
 (0)