-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
238 lines (220 loc) · 11.7 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WEB API COMPONENT DEMO</title>
<meta name="viewport" content="initial-scale=1, user-scalable=no"/>
<style>
@font-face {font-family: 'AvenirNextPro';font-weight: 700;font-style: normal;src: url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_0_0.eot");src: url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_0_0.eot?#iefix") format("embedded-opentype"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_0_0.woff2") format("woff2"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_0_0.woff") format("woff"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_0_0.ttf") format("truetype"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_0_0.svg#wf") format("svg");}
@font-face {font-family: 'AvenirNextPro';font-weight: 500;font-style: normal;src: url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_2_0.eot");src: url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_2_0.eot?#iefix") format("embedded-opentype"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_2_0.woff2") format("woff2"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_2_0.woff") format("woff"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_2_0.ttf") format("truetype"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_2_0.svg#wf") format("svg");}
@font-face {font-family: 'AvenirNextPro';font-weight: 400;font-style: normal;src: url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_3_0.eot");src: url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_3_0.eot?#iefix") format("embedded-opentype"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_3_0.woff2") format("woff2"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_3_0.woff") format("woff"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_3_0.ttf") format("truetype"), url("https://storage.googleapis.com/microblink-data-public/general-static-assets/webfonts/3573C4_3_0.svg#wf") format("svg");}
</style>
<!-- For desktop to mobile ("Use remote phone camera" feature) Firebase (Firestore) is required to exchange data between two devices -->
<!-- Firebase App is always required and must be first -->
<script src="https://www.gstatic.com/firebasejs/7.9.3/firebase-app.js"></script>
<!-- Add additional services that you want to use -->
<script src="https://www.gstatic.com/firebasejs/7.9.3/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.9.3/firebase-storage.js"></script>
<script>
// Initialize Firebase
// TODO: Replace with your project's customized code snippet
// var config = {
// apiKey: "<API_KEY>",
// authDomain: "<PROJECT_ID>.firebaseapp.com",
// databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
// projectId: "<PROJECT_ID>",
// storageBucket: "<BUCKET>.appspot.com",
// messagingSenderId: "<SENDER_ID>",
// };
var config = {
apiKey: "AIzaSyC2EeRiAwTGj4Gv28RVjYLkU_sUYLafCqg",
authDomain: "microblink-api-exchanger.firebaseapp.com",
databaseURL: "https://microblink-api-exchanger.firebaseio.com",
projectId: "microblink-api-exchanger",
storageBucket: "microblink-api-exchanger.appspot.com",
messagingSenderId: "902458803135"
};
firebase.initializeApp(config);
</script>
<!-- In desktop to mobile feature exchange link can be delivered as QR code if dependency to the `soldair/node-qrcode` is present, otherwise link as QR code will not be generated -->
<script src="https://unpkg.com/[email protected]/build/qrcode.min.js" ></script>
<!-- Include dependency to the Microblink SDK -->
<!-- <script src="../dist/microblink.min.js" ></script> -->
<script src="https://unpkg.com/[email protected]/dist/microblink.min.js"></script>
<script>
/*
* Use this method if using Self-hosted API
* Multiple recognizers are allowed here if using Self-hosted API
*/
//Microblink.SDK.SetRecognizers(['MRTD']);
/*
* Setting endpoint is required
* It is required to set endpoint where request is being sent
*/
//Microblink.SDK.SetEndpoint('http://localhost:8081');
Microblink.SDK.SetEndpoint('https://demoapi.microblink.com');
/*
* Set request parameters for desired recognizer
* Setup this method only if you want to use our Cloud API, otherwise just put this methods inside comment
* This method will override Microblink.SDK.SetRecognizers() method if Microblink.SDK.SetRecognizers() is set
* Only one recognizer iz allowed to be used
* Available recognizers are (BLINK_ID, ID_BARCODE, MRTD, PASSPORT, VISA, MRZ_ID)
* Examples:
* Microblink.SDK.SetupRecognizerRequest('BLINK_ID');
* or
* Microblink.SDK.SetupRecognizerRequest('ID_BARCODE');
* or
* Microblink.SDK.SetupRecognizerRequest('PASSPORT');
* ...
*/
Microblink.SDK.SetupRecognizerRequest('MRTD');
Microblink.SDK.SetUserId('[email protected]');
//Microblink.SDK.SetAuthorization('Bearer MDY0YWNlMGNiN2IzNGUwZTk4YWVmMDVhZDEyOGJjY2E6Mzk5NzNkNDUtYjg4MS00OWE1LTlhMTItYmEzYTRkNmYzY2Fj');
Microblink.SDK.RegisterListener({
onScanSuccess: (data) => {
console.log('Data from Microblink API is', data);
},
onScanError: (error) => {
console.error('Error from Microblink API is', error);
// Display generic alert
if (error.summary) {
alert(error.summary);
}
}
});
</script>
<style type="text/css" >
body {
margin: 0;
padding: 0;
font-size: 20px;
}
.microblink-ui-component-wrapper {
/* max-width: 901px; */
/* height: 545px; */
width: 100vw;
height: 100vh;
position: relative;
margin: 0;
box-sizing: border-box;
overflow: hidden;
}
microblink-ui-web {
--mb-widget-font-family: 'Avenir Next';
--mb-hem: 20px;
--mb-widget-border-width: 4px;
/* Defaults */
--mb-widget-border-color: black;
--mb-widget-background-color: white;
--mb-default-font-color: black;
--mb-alt-font-color: #575757;
--mb-btn-font-color: white;
--mb-btn-background-color: #48b2e8;
--mb-btn-background-color-hover: #26a4e4;
--mb-btn-flip-color: white;
--mb-btn-alt-font-color: black;
--mb-btn-alt-background-color: white;
--mb-btn-border-radius: 0;
--mb-btn-intro-stroke-color: black;
--mb-btn-intro-stroke-color-hover: white;
--mb-btn-intro-circle-color: #f2f2f2;
--mb-btn-intro-circle-color-hover: #48b2e8;
--mb-btn-container-border-color: lightgrey;
--mb-spinner-border-width: 6px;
--mb-tabs-background-color: black;
--mb-tabs-font-color: white;
--mb-tabs-border-width: 4px;
--mb-btn-icon-cancel-color: white;
--mb-dropzone-hover-color: rgba(72, 178, 232, 0.2);
--mb-dropzone-circle-color: #48b2e8;
--mb-dropzone-icon-color: black;
--mb-loader-font-color: black;
--mb-loader-background-color: #48b2e8;
--mb-card-layout-border-color: black;
--mb-tabs-hover-color: #26a4e4;
--mb-tabs-active-color: #48b2e8;
--mb-json-color-key: black;
--mb-json-color-string: #48b2e8;
--mb-json-color-boolean: #26a4e4;
--mb-json-color-number: black;
--mb-json-color-null: #26a4e4;
--mb-results-border-color: #dee2e6;
--mb-results-image-border-radius: 6px;
--mb-results-image-background-color: #f2f2f2;
--mb-dialog-title-color: black;
--mb-dialog-message-color: #575757;
--mb-photo-icon-primary: white;
--mb-photo-icon-accent: #48b2e8;
}
</style>
<!-- Remove bad UI of the flashed loader-image which will be injected on the
slot name "loader-image" when component is ready -->
<style>
microblink-ui-web .hide-until-component-is-loaded {
visibility: hidden;
}
</style>
<script>
setTimeout(function () {
document.querySelectorAll('.hide-until-component-is-loaded').forEach(function(element) {
element.classList.remove('hide-until-component-is-loaded');
})
}, 1000)
</script>
</head>
<body>
<div class="microblink-ui-component-wrapper">
<microblink-ui-web tabs autoscroll>
<!-- Croatian translation -->
<!-- <template class="localization json">
{
"buttons" : {
"browse": "Prolistaj",
"cameraRemote": "Koristi mobilnu kameru",
"cameraLocalDesktop": "Koristi web kameru",
"cameraLocalMobile": "Koristi kameru",
"dropFiles": "Ispusti datoteke za slanje",
"tryAgain": "POKUŠAJTE PONOVO",
"takePhoto": "Uslikaj",
"copy": "Kopiraj u međuspremnik",
"confirm": "POTVRDI",
"retake": "PONOVNO"
},
"labels" : {
"chooseInputMethod": "Odaberite način unosa",
"generatingExchangeLink": "Generiranje linka za razmjenu...",
"exchangeLinkTitle": "Link za razmjenu je",
"remoteCameraIsPending": "Čeka se kamera na mobilnom uređaju...",
"remoteCameraIsOpen": "Kamera na mobilnom uređaju je otvorena...",
"imageIsUploading": "Slika se šalje...",
"imageIsProcessing": "Slika se obrađuje...",
"videoTagUnsupported": "Vaš preglednik ne podržava video tag",
"uploading" : "Slanje",
"processing" : "Procesiranje",
"analyzing" : "Analiziranje",
"extracting" : "Ekstrakcija",
"almostDone" : "Uskoro gotovo",
"errorMsg": "Nešto je pošlo po krivu. Molimo pokušajte opet.",
"permissionMsg": "Molimo omogućite kameru",
"notFoundErrorMsg": "Kamera nije pronađena na vašem uređaju",
"notAllowedErrorMsg": "Odbili ste pristup kameri",
"scanningFinishedNoDataTitle": "Dokument nije prepoznat",
"scanningFinishedNoDataMessage": "Molimo pokušajte ponovno sa drugim dokumentom ili odaberite drugi recognizer",
"unsupportedFileType": "Nepodržan tip datoteke",
"selectRecognizers": "Molimo odaberite jedan ili više recognizera da biste započeli",
"noRecognizersSelected": "Nijedan recognizer nije odabran",
"webRtcUnsupported": "Vaš predglednik ne podržava WebRTC"
},
"tabs" : {
"back": "Natrag",
"results": "Rezultati",
"json": "JSON"
}
}
</template>
<img slot="loader-image" class="hide-until-component-is-loaded" src="https://microblink.com/bundles/microblinkmicroblink/images/loading-animation-on-blue.gif" />
<span slot="labels.openLinkAtSmartphone" class="hide-until-component-is-loaded">Molimo otvorite <b>link za razmjenu</b> na mobilnom uređaju sa <b>QR</b> čitačem</span> -->
</microblink-ui-web>
</div>
</body>
</html>