File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,7 @@ img {
291
291
}
292
292
293
293
.result-container .scanned-image {
294
+ flex : 1 ;
294
295
max-height : 200px ;
295
296
}
296
297
@@ -301,6 +302,7 @@ img {
301
302
}
302
303
303
304
.result-container .parsed-result-area {
305
+ flex : 1 ;
304
306
width : 100% ;
305
307
height : 84% ;
306
308
padding : 15px 15px 5px 30px ;
@@ -562,7 +564,7 @@ img {
562
564
}
563
565
564
566
/* Media query for mobile phones */
565
- @media screen and (orientation : landscape) and (max-width : 1500 px ) {
567
+ @media screen and (orientation : landscape) and (max-width : 900 px ) {
566
568
.result-container .parsed-result-area .parsed-filed {
567
569
font-size : 14px ;
568
570
}
Original file line number Diff line number Diff line change 1
- import { judgeCurResolution , showNotification } from "./util.js" ;
1
+ import { changeMobileLayout , judgeCurResolution , showNotification } from "./util.js" ;
2
2
import { createPendingPromise , extractDocumentFields , resultToHTMLElement } from "./util.js" ;
3
3
4
4
// Promise variable used to control model loading state
@@ -124,6 +124,7 @@ let init = (async () => {
124
124
} ) ( ) ;
125
125
126
126
const displayResults = ( recognizedText , parsedResult ) => {
127
+ changeMobileLayout ( ) ; // Update mobile layout to support horizontal view
127
128
parsedResultArea . innerText = "" ;
128
129
129
130
// Display MRZ text
Original file line number Diff line number Diff line change @@ -213,6 +213,26 @@ export function shouldShowScanModeContainer() {
213
213
scanModeContainer . style . display = isHomepageClosed && isResultClosed ? "flex" : "none" ;
214
214
}
215
215
216
+ export const isMobile = ( ) =>
217
+ / A n d r o i d | w e b O S | i P h o n e | i P a d | i P o d | B l a c k B e r r y | I E M o b i l e | O p e r a M i n i / i. test ( navigator . userAgent ) ;
218
+
219
+ export function changeMobileLayout ( ) {
220
+ const resultArea = resultContainer . querySelector ( ".result-area" ) ;
221
+ console . log ( isMobile ( ) , checkOrientation ( ) === "landscape" ) ;
222
+ Object . assign (
223
+ resultArea . style ,
224
+ isMobile ( ) && checkOrientation ( ) === "landscape"
225
+ ? {
226
+ height : "70%" ,
227
+ flexDirection : "row" ,
228
+ }
229
+ : {
230
+ height : "84%" ,
231
+ flexDirection : "column" ,
232
+ }
233
+ ) ;
234
+ }
235
+
216
236
/** Show notification banner to users
217
237
* @params {string} message - noficiation message
218
238
* @params {string} className - CSS class name to show notification status
You can’t perform that action at this time.
0 commit comments