Skip to content

Commit 2bb7c7b

Browse files
feat: update v1 (#15)
- updated home page - updated template - updated to dcv 2.4.2000 - removed redundant MRZ formatter (already in template) - add validation status icons to result from DCP
1 parent dca5ca5 commit 2bb7c7b

14 files changed

+531
-230
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 [support@dynamsoft.com](mailto:support@dynamsoft.com).
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/video-camera.svg

Lines changed: 28 additions & 0 deletions
Loading

css/index.css

Lines changed: 99 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ 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;
@@ -71,15 +71,45 @@ img {
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 {
@@ -89,12 +119,13 @@ img {
89119
max-height: 60px;
90120
background-color: #fe8e14;
91121
font-family: Oswald-Regular;
92-
font-size: 20px;
122+
font-size: 16px;
93123
margin: 0 auto;
94-
display: flex;
124+
display: none;
95125
justify-content: center;
96126
align-items: center;
97127
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
128+
padding: 2rem;
98129
}
99130

100131
.home-page .description .start-btn:hover {
@@ -185,8 +216,8 @@ img {
185216
}
186217

187218
.scanner-container .header .music-container {
188-
width: 30px;
189-
height: 30px;
219+
width: 24px;
220+
height: 24px;
190221
cursor: pointer;
191222
display: flex;
192223
align-items: center;
@@ -208,6 +239,20 @@ img {
208239
display: none;
209240
}
210241

242+
.scanner-container .header .upload-img-btn {
243+
width: 24px;
244+
height: 24px;
245+
cursor: pointer;
246+
display: flex;
247+
align-items: center;
248+
cursor: pointer;
249+
}
250+
251+
.scanner-container .header .upload-img-icon {
252+
width: 24px;
253+
height: 24px;
254+
}
255+
211256
.result-container {
212257
position: absolute;
213258
width: 100%;
@@ -239,6 +284,16 @@ img {
239284
color: #aaaaaa;
240285
}
241286

287+
.result-container .scanned-image {
288+
max-height: 200px;
289+
}
290+
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;
@@ -462,8 +540,18 @@ img {
462540
box-shadow: none;
463541
}
464542

543+
.home-page .description .desktop-qr-container {
544+
display: none;
545+
}
546+
547+
.home-page .description .desktop-start-btn {
548+
display: none;
549+
}
550+
465551
.home-page .description .start-btn {
552+
display: flex;
466553
font-size: 20px;
554+
padding: 1.5rem;
467555
}
468556
}
469557

0 commit comments

Comments
 (0)