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 @@ -290,6 +290,7 @@ img {
290290}
291291
292292.result-container .scanned-image {
293+ flex : 1 ;
293294 max-height : 200px ;
294295}
295296
@@ -301,6 +302,7 @@ img {
301302}
302303
303304.result-container .parsed-result-area {
305+ flex : 1 ;
304306 width : 100% ;
305307 height : 84% ;
306308 padding : 15px 15px 5px 30px ;
@@ -585,7 +587,7 @@ img {
585587}
586588
587589/* Media query for mobile phones */
588- @media screen and (orientation : landscape) and (max-width : 1500 px ) {
590+ @media screen and (orientation : landscape) and (max-width : 900 px ) {
589591 .result-container .parsed-result-area .parsed-filed {
590592 font-size : 14px ;
591593 }
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" ;
22import { createPendingPromise , extractDocumentFields , resultToHTMLElement } from "./util.js" ;
33
44// Promise variable used to control model loading state
@@ -137,6 +137,7 @@ export const handleCapturedResult = (result, uploadedImage = null) => {
137137} ;
138138
139139const displayResults = ( recognizedText , parsedResult ) => {
140+ changeMobileLayout ( ) ; // Update mobile layout to support horizontal view
140141 parsedResultArea . innerText = "" ;
141142
142143 // Display MRZ text
Original file line number Diff line number Diff line change @@ -213,6 +213,26 @@ export function shouldShowScanModeContainer() {
213213 scanModeContainer . style . display = isHomepageClosed && isResultClosed ? "flex" : "none" ;
214214}
215215
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+
216236/** Show notification banner to users
217237 * @params {string} message - noficiation message
218238 * @params {string} className - CSS class name to show notification status
You can’t perform that action at this time.
0 commit comments