fix: mobile menu now renders in front of hero banner video on mobile

- Moved mobile drawer (and AnimatePresence) out of <nav> into sibling in React fragment so its z-index is evaluated at root stacking context (was previously confined inside nav's z context).
- Raised mobile menu container to z-[9999], sliding panel to z-[10000].
- Bumped LanguageSwitcher backdrop/dropdown to z-[9998]/z-[9999] for when opened from inside mobile menu.
- Lowered hero video to z-0 and gradient to z-5 (true background).
- Nav back to z-[50] (still above normal content).
- This ensures the full mobile menu (hamburger + drawer + language dropdown when clicked inside it) always stacks above the mobile_banner video and is fully visible.
This commit is contained in:
Zeeshan Khan
2026-06-02 14:01:56 +02:00
parent 583047895f
commit f70076b482
3 changed files with 10 additions and 8 deletions
+2 -2
View File
@@ -196,7 +196,7 @@ export default function ShahiKitchenHomepage() {
muted muted
playsInline playsInline
preload="auto" preload="auto"
className="absolute inset-0 z-10 w-full h-full object-cover className="absolute inset-0 z-0 w-full h-full object-cover
object-[50%_10%] sm:object-[50%_12%] md:object-[50%_16%] object-[50%_10%] sm:object-[50%_12%] md:object-[50%_16%]
lg:object-[50%_20%] xl:object-[50%_24%]" lg:object-[50%_20%] xl:object-[50%_24%]"
onError={(e) => console.error('Hero banner video failed to load', e)} onError={(e) => console.error('Hero banner video failed to load', e)}
@@ -217,7 +217,7 @@ export default function ShahiKitchenHomepage() {
</video> </video>
{/* Subtle gradient to improve visibility of baked-in text */} {/* Subtle gradient to improve visibility of baked-in text */}
<div className="absolute inset-0 z-20 bg-gradient-to-b from-black/5 via-transparent to-black/30" /> <div className="absolute inset-0 z-5 bg-gradient-to-b from-black/5 via-transparent to-black/30" />
</section> </section>
{/* ADVANCED SIGNATURE MENU */} {/* ADVANCED SIGNATURE MENU */}
+2 -2
View File
@@ -31,12 +31,12 @@ export default function LanguageSwitcher() {
<> <>
{/* Backdrop */} {/* Backdrop */}
<div <div
className="fixed inset-0 z-[1010]" className="fixed inset-0 z-[9998]"
onClick={() => setIsOpen(false)} onClick={() => setIsOpen(false)}
/> />
{/* Dropdown */} {/* Dropdown */}
<div className="absolute right-0 top-full mt-2 z-[1020] w-44 rounded-2xl border border-[#c99a2e]/20 bg-[#fbf7ef] shadow-2xl overflow-hidden"> <div className="absolute right-0 top-full mt-2 z-[9999] w-44 rounded-2xl border border-[#c99a2e]/20 bg-[#fbf7ef] shadow-2xl overflow-hidden">
{languages.map((lang) => ( {languages.map((lang) => (
<button <button
key={lang.code} key={lang.code}
+6 -4
View File
@@ -53,8 +53,9 @@ export default function Navbar({ variant = "default" }: NavbarProps) {
const closeMenu = () => setIsOpen(false); const closeMenu = () => setIsOpen(false);
return ( return (
<>
<nav <nav
className="fixed top-0 left-0 right-0 z-[999] h-[64px] border-b border-[#c99a2e]/20 bg-[#fbf7ef] shadow-sm backdrop-blur-xl" className="fixed top-0 left-0 right-0 z-[50] h-[64px] border-b border-[#c99a2e]/20 bg-[#fbf7ef] shadow-sm backdrop-blur-xl"
> >
<div className="max-w-7xl mx-auto px-6 flex items-center justify-between h-full"> <div className="max-w-7xl mx-auto px-6 flex items-center justify-between h-full">
{/* Top subtle gold line for extra frame separation */} {/* Top subtle gold line for extra frame separation */}
@@ -177,11 +178,12 @@ export default function Navbar({ variant = "default" }: NavbarProps) {
</button> </button>
</div> </div>
</div> </div>
</nav>
{/* Modern Mobile Menu Drawer (slide-in, animated, high-contrast, touch-friendly) - high z to always appear in front of hero banner video etc. */} {/* Modern Mobile Menu Drawer (slide-in, animated, high-contrast, touch-friendly) - high z to always appear in front of hero banner video etc. */}
<AnimatePresence> <AnimatePresence>
{isOpen && ( {isOpen && (
<div className="md:hidden fixed inset-0 z-[1000]"> <div className="md:hidden fixed inset-0 z-[9999]">
{/* Backdrop */} {/* Backdrop */}
<motion.div <motion.div
className="absolute inset-0 bg-[#101724]/70 backdrop-blur-md" className="absolute inset-0 bg-[#101724]/70 backdrop-blur-md"
@@ -194,7 +196,7 @@ export default function Navbar({ variant = "default" }: NavbarProps) {
{/* Sliding Panel - modern, full-bleed on small phones, elegant on larger */} {/* Sliding Panel - modern, full-bleed on small phones, elegant on larger */}
<motion.div <motion.div
className="absolute right-0 top-0 bottom-0 w-[82%] max-w-[340px] bg-[#fbf7ef] shadow-2xl border-l border-[#c99a2e]/10 flex flex-col overflow-y-auto z-[1001]" className="absolute right-0 top-0 bottom-0 w-[82%] max-w-[340px] bg-[#fbf7ef] shadow-2xl border-l border-[#c99a2e]/10 flex flex-col overflow-y-auto z-[10000]"
initial={{ x: '100%' }} initial={{ x: '100%' }}
animate={{ x: 0 }} animate={{ x: 0 }}
exit={{ x: '100%' }} exit={{ x: '100%' }}
@@ -281,6 +283,6 @@ export default function Navbar({ variant = "default" }: NavbarProps) {
</div> </div>
)} )}
</AnimatePresence> </AnimatePresence>
</nav> </>
); );
} }