fix: comprehensive iOS Safari safe area video extension fix
All checks were successful
build-website / build (push) Successful in 1m48s

- Remove invalid safe-area-max-inset-top (not a valid CSS property)
- Use standard safe-area-inset-top with iOS Safari workarounds
- Remove white background from video container (was blocking transparency)
- Change html/body background to transparent for safe area visibility
- Update status bar style to black-translucent for content under notch
- Add hardcoded fallbacks for iOS Safari portrait bug (env returns 0)

This fixes the issue where the video wasn't extending into the iPhone notch/Dynamic Island
by addressing the root causes: invalid CSS properties, blocking backgrounds, and Safari bugs.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-21 19:32:56 +02:00
parent 84d6d58dd7
commit 8ec50fbf49
3 changed files with 26 additions and 12 deletions

View File

@@ -7,7 +7,8 @@
html, body { html, body {
margin: 0; margin: 0;
padding: 0; padding: 0;
background: #fff; /* White background fallback for safe area */ /* Transparent background to allow video in safe area */
background: transparent;
} }
/* Smooth Scroll Behavior and iOS Overscroll Prevention */ /* Smooth Scroll Behavior and iOS Overscroll Prevention */

View File

@@ -172,26 +172,26 @@ onMounted(() => {
</script> </script>
<style scoped> <style scoped>
/* Hero video container using safe-area-max-inset-top for iOS Safari */ /* Hero video container using standard safe-area-inset-top for iOS Safari */
.hero-video-container { .hero-video-container {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
width: 100vw; width: 100vw;
/* Use safe-area-max-inset-top which always returns the notch height */ /* Use standard safe-area-inset-top */
/* Pull up by the max safe area to extend under notch */ /* Pull up by the safe area to extend under notch */
top: calc(-1 * env(safe-area-max-inset-top, 0px)); top: calc(-1 * env(safe-area-inset-top, 0px));
/* Extend height to compensate */ /* Extend height to compensate */
height: calc(100vh + env(safe-area-max-inset-top, 0px)); height: calc(100vh + env(safe-area-inset-top, 0px));
z-index: 0; z-index: 0;
pointer-events: none; pointer-events: none;
background: #ffffff; /* Removed white background to allow transparency */
} }
/* Fallback for browsers that don't support safe-area-max-inset-top */ /* iOS Safari portrait bug workaround - env() returns 0 in portrait */
@supports not (padding: env(safe-area-max-inset-top)) { @supports (-webkit-touch-callout: none) {
.hero-video-container { .hero-video-container {
/* iPhone 14/15 Pro Dynamic Island fallback */ /* Hardcoded fallback for iPhone 14/15 Pro Dynamic Island */
top: -59px; top: -59px;
height: calc(100vh + 59px); height: calc(100vh + 59px);
} }
@@ -208,7 +208,20 @@ onMounted(() => {
/* Support for dynamic viewport height */ /* Support for dynamic viewport height */
@supports (height: 100dvh) { @supports (height: 100dvh) {
.hero-video-container { .hero-video-container {
height: calc(100dvh + env(safe-area-max-inset-top, 0px)); height: calc(100dvh + env(safe-area-inset-top, 0px));
}
/* iOS specific with dvh */
@supports (-webkit-touch-callout: none) {
.hero-video-container {
height: calc(100dvh + 59px); /* Dynamic Island */
}
@media screen and (max-height: 812px) {
.hero-video-container {
height: calc(100dvh + 44px); /* Notch */
}
}
} }
} }

View File

@@ -127,7 +127,7 @@ export default defineNuxtConfig({
{ name: 'robots', content: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' }, { name: 'robots', content: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' },
{ name: 'theme-color', content: '#ffffff' }, { name: 'theme-color', content: '#ffffff' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' }, { name: 'apple-mobile-web-app-capable', content: 'yes' },
{ name: 'apple-mobile-web-app-status-bar-style', content: 'default' }, { name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
// Open Graph // Open Graph
{ property: 'og:type', content: 'website' }, { property: 'og:type', content: 'website' },
{ property: 'og:url', content: 'https://harborsmith.com' }, { property: 'og:url', content: 'https://harborsmith.com' },