main
parent
c51f385927
commit
ede9937da7
|
@ -24,17 +24,16 @@
|
|||
|
||||
/* ===== Page Content ===== */
|
||||
.agent-body {
|
||||
margin-top: 60px; /* ✅ header height */
|
||||
margin-top: 60px; /* header height */
|
||||
padding: 15px;
|
||||
padding-bottom: 85px; /* ✅ bottom nav (55px) + safe gap (30px) */
|
||||
padding-bottom: 100px; /* reserve space for nav */
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* ===== Bottom Nav ===== */
|
||||
/* ===== Bottom Navigation ===== */
|
||||
.agent-bottom-nav {
|
||||
position: fixed;
|
||||
bottom: 0; /* ✅ Always stick above system bar */
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 55px;
|
||||
|
@ -42,8 +41,12 @@
|
|||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-top: 1px solid rgba(255,255,255,0.2);
|
||||
z-index: 999;
|
||||
|
||||
bottom: 0;
|
||||
padding-bottom: constant(safe-area-inset-bottom); /* old iOS */
|
||||
padding-bottom: env(safe-area-inset-bottom, 20px); /* fallback 20px gap */
|
||||
}
|
||||
|
||||
.agent-bottom-link {
|
||||
|
@ -69,14 +72,17 @@
|
|||
<div class="agent-header">
|
||||
<div>Agent Panel</div>
|
||||
<?php if(isset($_SESSION) && !empty($_SESSION['user_id'])){ ?>
|
||||
<button onclick="window.location.href='/Agent/logout'" style="background:none;border:none;color:#fff;font-size:16px;cursor:pointer;">Logout</button>
|
||||
<button onclick="window.location.href='/Agent/logout'"
|
||||
style="background:none;border:none;color:#fff;font-size:16px;cursor:pointer;">
|
||||
Logout
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<!-- ===== Content ===== -->
|
||||
<div class="agent-body">
|
||||
<h2>Dashboard Content</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque habitant morbi.</p>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
||||
<p>Scroll down to test bottom nav spacing...</p>
|
||||
<p style="margin-bottom:1000px;">Dummy long content...</p>
|
||||
</div>
|
||||
|
@ -102,3 +108,26 @@
|
|||
</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<!-- ===== JS Fix for Android Devices ===== -->
|
||||
<script>
|
||||
function fixBottomNav() {
|
||||
const nav = document.querySelector(".agent-bottom-nav");
|
||||
if (!nav) return;
|
||||
|
||||
// viewport height vs document height
|
||||
let vh = window.innerHeight;
|
||||
let docH = document.documentElement.clientHeight;
|
||||
|
||||
let extra = vh - docH;
|
||||
|
||||
if (extra > 0) {
|
||||
nav.style.bottom = extra + "px"; // lift nav above system bar
|
||||
} else {
|
||||
nav.style.bottom = "0px";
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("resize", fixBottomNav);
|
||||
window.addEventListener("load", fixBottomNav);
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue