Skip to content

Commit 7d6729d

Browse files
feat: Allow vertical scan and add camera resolution options (#17)
* feat(VINScanner): allow vertical scan on barcode mode (#11) * feat(VINScanner): add resolution options (#10) * feat(VINScanner): add resolution select * fix: camera list width * feat: notification on camera switch * fix: judge resolution * fix: button switches --------- Co-authored-by: felixindrawan <indrawan.felix123@gmail.com> --------- Co-authored-by: felixindrawan <indrawan.felix123@gmail.com>
1 parent 3ab136f commit 7d6729d

File tree

10 files changed

+348
-218
lines changed

10 files changed

+348
-218
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
node_modules
33
dist
44
build
5+
CaptureImageModal
56

67
# local env files
78
.env.local

VINScanner/assets/phone-rotate.svg

Lines changed: 15 additions & 0 deletions
Loading

VINScanner/assets/settings.svg

Lines changed: 0 additions & 28 deletions
This file was deleted.

VINScanner/css/index.css

Lines changed: 61 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,12 @@ img {
148148
}
149149

150150
.scanner-container .header .camera-list {
151-
width: 165px;
152151
position: absolute;
153152
top: 46px;
154153
left: 0;
155154
background-color: #000000;
156155
border-right: #aaaaaa;
157-
z-index: 1;
156+
z-index: 3;
158157
display: none;
159158
}
160159

@@ -226,32 +225,6 @@ img {
226225
z-index: 1;
227226
}
228227

229-
.scanner-container .camera-view-container .scan-mode-container {
230-
display: flex;
231-
align-items: center;
232-
justify-content: center;
233-
position: absolute;
234-
bottom: -55%;
235-
left: 0;
236-
right: 0;
237-
z-index: 1;
238-
cursor: pointer;
239-
gap: 0.5rem;
240-
font-size: 24px;
241-
font-family: OpenSans-Regular;
242-
color: #ffffff;
243-
user-select: none;
244-
}
245-
246-
.scanner-container .camera-view-container .scan-mode-container:hover {
247-
opacity: 0.8;
248-
}
249-
250-
.scanner-container .camera-view-container .scan-mode-container .settings-btn {
251-
width: 24px;
252-
height: 24px;
253-
}
254-
255228
.result-container {
256229
position: absolute;
257230
width: 100%;
@@ -266,7 +239,7 @@ img {
266239
}
267240

268241
.result-container .result-btn-container {
269-
padding: 15px 15px 7.5px 30px;
242+
padding: 15px 15px 0 30px;
270243
display: flex;
271244
gap: 2rem;
272245
}
@@ -300,6 +273,10 @@ img {
300273
cursor: pointer;
301274
}
302275

276+
.result-container #result-image-container {
277+
display: flex;
278+
justify-content: center;
279+
}
303280
.result-container .parsed-result-area {
304281
width: 100%;
305282
padding: 15px 15px 0 30px;
@@ -332,6 +309,7 @@ img {
332309
align-items: center;
333310
margin-top: auto;
334311
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
312+
background-color: #2b2b2b;
335313
}
336314

337315
.result-container .restart-video .btn-restart-video {
@@ -344,59 +322,62 @@ img {
344322
font-family: "Oswald-Regular";
345323
}
346324

347-
.settings-modal {
325+
.scan-mode-container {
348326
display: none;
349-
position: fixed;
350-
top: 0;
351-
left: 0;
352-
width: 100%;
353-
height: 100%;
354-
background-color: rgba(0, 0, 0, 0.4);
355-
z-index: 2;
356327
justify-content: center;
357328
align-items: center;
329+
position: fixed;
330+
bottom: 15%;
331+
left: 5%;
332+
right: 5%;
333+
z-index: 2;
358334
}
359335

360-
.settings-modal-content {
361-
background-color: #323234;
362-
padding: 1rem 2rem 2rem;
363-
color: #ffffff;
364-
font-family: Oswald-Light;
365-
font-size: 20px;
366-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
367-
}
368-
369-
.settings-modal-top {
336+
.scan-mode-container .scan-mode-content {
337+
position: relative;
370338
display: flex;
371-
justify-content: space-between;
339+
justify-content: center;
372340
align-items: center;
373-
margin-bottom: 0.5rem;
374-
}
375-
376-
.settings-option-title {
377-
font-family: Oswald-Regular;
378-
margin: 0;
379-
margin-bottom: 0.5rem;
380-
font-weight: normal;
341+
background-color: rgb(34, 34, 34);
342+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
343+
border-radius: 8px;
344+
padding: 0.5rem;
345+
width: max-content;
346+
opacity: 0.8;
381347
}
382348

383-
.settings-option-btn {
384-
background-color: rgb(34, 34, 34);
349+
.scan-option-btn {
350+
background-color: transparent;
385351
padding: 0.5rem;
386352
font-family: OpenSans-Regular;
387353
color: white;
354+
width: 5rem;
388355
}
389356

390357
.selected {
391358
background-color: #fe8e14;
359+
color: white;
360+
border-radius: 8px;
392361
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
393362
}
394363

395-
.close-settings-btn {
396-
display: flex;
364+
.scan-orientation-btn {
365+
position: absolute;
366+
top: -90%;
367+
right: 0;
368+
padding: 0.5rem;
369+
display: none;
397370
justify-content: center;
398371
align-items: center;
399-
background: transparent;
372+
border-radius: 8px;
373+
opacity: 0.8;
374+
background-color: rgb(34, 34, 34);
375+
}
376+
377+
.scan-orientation-btn .scan-orientation-icon {
378+
width: 24px;
379+
height: 24px;
380+
filter: invert(0.4);
400381
}
401382

402383
#notification {
@@ -431,7 +412,25 @@ img {
431412
}
432413
.banner-success {
433414
background-color: rgb(124, 252, 0, 0.4);
434-
border: 1px solid #7cfc00;
415+
border: 1px solid #00fc15;
416+
}
417+
418+
.get-demo-code {
419+
display: flex;
420+
justify-content: center;
421+
align-items: center;
422+
color: #ffae38;
423+
margin-left: auto;
424+
margin-right: 1rem;
425+
font-family: Oswald-Regular;
426+
text-decoration: none;
427+
}
428+
429+
.dbr-download-code-icon {
430+
width: 16px;
431+
height: 16px;
432+
stroke: #ffae38;
433+
margin-left: 5px;
435434
}
436435

437436
@keyframes dce-rotate {
@@ -443,15 +442,6 @@ img {
443442
}
444443
}
445444

446-
@keyframes dce-scanlight {
447-
from {
448-
top: 0;
449-
}
450-
to {
451-
top: 97%;
452-
}
453-
}
454-
455445
@media screen and (max-width: 800px) {
456446
html,
457447
body {
@@ -469,27 +459,12 @@ img {
469459
.home-page .description .start-btn {
470460
font-size: 20px;
471461
}
472-
473-
.scanner-container .camera-view-container .scan-mode-container .settings-btn {
474-
width: 16px;
475-
height: 16px;
476-
}
477-
478-
.settings-modal-content {
479-
width: 100%;
480-
height: 100%;
481-
}
482462
}
483463
@media screen and (max-width: 1300px) {
484464
.scanner-container .camera-view-container .scan-help-msg {
485465
font-size: 12px;
486466
top: -35%;
487467
}
488-
489-
.scanner-container .camera-view-container .scan-mode-container {
490-
bottom: -45%;
491-
font-size: 12px;
492-
}
493468
}
494469
@media screen and (max-width: 800px) and (orientation: landscape) {
495470
.result-container .parsed-result-area .parsed-filed {

0 commit comments

Comments
 (0)