Skip to content

Commit 59232f7

Browse files
authored
Merge pull request #149 from Unity-Lab-AI/develop
Fix weird mobile browser quirks
2 parents 6c77341 + 2c9a309 commit 59232f7

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

ai/demo/demo.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,20 @@ body {
1515
font-family: 'Trajan Pro', serif;
1616
background: var(--primary-black, #0a0a0a);
1717
color: var(--light-grey, #cccccc);
18+
/* Mobile safe area insets - prevents content from being obscured by browser UI */
19+
padding-top: env(safe-area-inset-top);
20+
padding-bottom: env(safe-area-inset-bottom);
21+
padding-left: env(safe-area-inset-left);
22+
padding-right: env(safe-area-inset-right);
1823
}
1924

2025
/* Main Demo Container - 3 Panel Layout */
2126
.demo-container {
2227
display: flex;
2328
height: 100vh;
29+
height: 100dvh; /* Dynamic viewport height - excludes browser UI on mobile */
2430
width: 100vw;
31+
width: 100dvw; /* Dynamic viewport width - excludes browser UI on mobile */
2532
position: relative;
2633
z-index: 1;
2734
}

styles.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ body {
5656
position: relative;
5757
-webkit-font-smoothing: antialiased;
5858
-moz-osx-font-smoothing: grayscale;
59+
/* Mobile safe area insets - prevents content from being obscured by browser UI */
60+
padding-top: env(safe-area-inset-top);
61+
padding-bottom: env(safe-area-inset-bottom);
62+
padding-left: env(safe-area-inset-left);
63+
padding-right: env(safe-area-inset-right);
5964
}
6065

6166
/* Background Effects */
@@ -192,6 +197,10 @@ body {
192197
-moz-transition: all 0.3s ease;
193198
-o-transition: all 0.3s ease;
194199
transition: all 0.3s ease;
200+
/* Mobile safe area insets for navigation */
201+
padding-top: calc(1rem + env(safe-area-inset-top));
202+
padding-left: env(safe-area-inset-left);
203+
padding-right: env(safe-area-inset-right);
195204
}
196205

197206
.navbar.scrolled {
@@ -295,6 +304,11 @@ body {
295304
background: -moz-linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #0a0a0a 100%);
296305
background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #0a0a0a 100%);
297306
overflow: hidden;
307+
/* Mobile safe area insets for hero section */
308+
padding-top: max(80px, env(safe-area-inset-top));
309+
padding-bottom: env(safe-area-inset-bottom);
310+
padding-left: env(safe-area-inset-left);
311+
padding-right: env(safe-area-inset-right);
298312
}
299313

300314
.hero-section::before {
@@ -763,6 +777,10 @@ body {
763777
background: var(--primary-black);
764778
border-top: 1px solid rgba(220, 20, 60, 0.3);
765779
color: var(--light-grey);
780+
/* Mobile safe area insets for footer */
781+
padding-left: env(safe-area-inset-left);
782+
padding-right: env(safe-area-inset-right);
783+
padding-bottom: env(safe-area-inset-bottom);
766784
}
767785

768786
.footer-title {
@@ -1273,6 +1291,10 @@ body {
12731291
background: var(--gradient-dark);
12741292
background: -webkit-linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #0a0a0a 100%);
12751293
background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #0a0a0a 100%);
1294+
/* Mobile safe area insets for page header */
1295+
padding-top: max(150px, calc(150px + env(safe-area-inset-top)));
1296+
padding-left: env(safe-area-inset-left);
1297+
padding-right: env(safe-area-inset-right);
12761298
}
12771299

12781300
/* Stats Section */

0 commit comments

Comments
 (0)