Commit 3ddb7957 by Mac Stephens

height fixes

parent 72cb3116
......@@ -70,13 +70,14 @@ html, body {
overflow: hidden;
}
/* iOS safe area: absorb status bar into top nav, home indicator into bottom nav */
@supports (padding-top: env(safe-area-inset-top)) {
#top_nav {
padding-top: calc(0.5rem + env(safe-area-inset-top));
@supports (-webkit-touch-callout: none) {
/* CSS specific to iOS devices */
span.card {
border: none;
/*padding-top: 2em !important;*/
}
#bottom_nav {
padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
.vh-100 {
height: 96vh !important;
}
}
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<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>
<link href="data:;base64,=" rel="icon"/>
<title>emiMobile</title>
......@@ -29,6 +29,28 @@
</head>
<body>
<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>
</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