Commit 3ddb7957 by Mac Stephens

height fixes

parent 72cb3116
...@@ -70,13 +70,14 @@ html, body { ...@@ -70,13 +70,14 @@ html, body {
overflow: hidden; overflow: hidden;
} }
/* iOS safe area: absorb status bar into top nav, home indicator into bottom nav */ @supports (-webkit-touch-callout: none) {
@supports (padding-top: env(safe-area-inset-top)) { /* CSS specific to iOS devices */
#top_nav { span.card {
padding-top: calc(0.5rem + env(safe-area-inset-top)); border: none;
/*padding-top: 2em !important;*/
} }
#bottom_nav { .vh-100 {
padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); height: 96vh !important;
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1, viewport-fit=cover" name="viewport"/> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<noscript>Your browser does not support JavaScript!</noscript> <noscript>Your browser does not support JavaScript!</noscript>
<link href="data:;base64,=" rel="icon"/> <link href="data:;base64,=" rel="icon"/>
<title>emiMobile</title> <title>emiMobile</title>
...@@ -29,6 +29,28 @@ ...@@ -29,6 +29,28 @@
</head> </head>
<body> <body>
<script type="text/javascript">rtl.run();</script> <script type="text/javascript">rtl.run();</script>
<script>
function setIOSDivHeight() {
const targetDiv = document.querySelector('body'); // Replace with your div ID
if (targetDiv) {
// Get the inner height of the window
const height = window.innerHeight ;
// Apply the height in pixels
targetDiv.style.maxHeight = (height - 100) + 'px';
//alert("set height: " + (height - 100));
}
}
// 2. Attach event listeners for Load, Resize, and Scroll
// Scroll is critical for iOS to handle the address bar expanding/collapsing
const isIOSUA = /iPad|iPhone|iPod/.test(navigator.userAgent);
if(isIOSUA){
window.addEventListener('load', setIOSDivHeight);
window.addEventListener('resize', setIOSDivHeight);
window.addEventListener('scroll', setIOSDivHeight);
}
</script>
</body> </body>
</html> </html>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment