Skip to content

Commit cd93bd1

Browse files
committed
alternative banner for mobile
1 parent f194e67 commit cd93bd1

File tree

5 files changed

+95
-25
lines changed

5 files changed

+95
-25
lines changed

public/img/alternative-banner.png

1.46 MB
Loading

public/img/alternative-banner.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/Hero.astro

Lines changed: 77 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,101 @@ const { title, text, imgSrc } = Astro.props;
1010
min-height: 100vh;
1111
background-attachment: scroll;`}
1212
>
13-
<!-- Responsive background positioning and sizing -->
13+
<!-- Responsive background with alternative banner for mobile -->
1414
<style>
1515
.hero-section {
1616
background-image: url('${imgSrc}');
1717
}
1818

1919
@media (max-width: 768px) {
2020
.hero-section {
21+
background-image: url('/img/alternative-banner.png') !important;
2122
background-position: center center !important;
2223
background-size: cover !important;
2324
min-height: 100vh !important;
25+
height: 100vh !important;
2426
}
25-
}
26-
27-
@media (max-width: 640px) {
28-
.hero-section {
29-
background-position: center center !important;
30-
background-size: cover !important;
31-
min-height: 100vh !important;
27+
28+
.hero-section .text-center {
29+
text-align: left !important;
30+
font-size: 3.5rem !important;
31+
line-height: 1.2 !important;
32+
height: 100vh !important;
33+
display: flex !important;
34+
align-items: center !important;
35+
padding: 2rem !important;
36+
justify-content: flex-start !important;
37+
transform: none !important;
3238
}
33-
}
34-
35-
@media (max-width: 480px) {
36-
.hero-section {
37-
background-position: center center !important;
38-
background-size: cover !important;
39-
min-height: 100vh !important;
39+
40+
.hero-section .mobile-text-container {
41+
justify-content: flex-start !important;
42+
align-items: center !important;
43+
transform: none !important;
44+
max-width: none !important;
45+
width: 100% !important;
4046
}
41-
}
42-
43-
@media (max-width: 320px) {
44-
.hero-section {
45-
background-position: center center !important;
46-
background-size: cover !important;
47-
min-height: 100vh !important;
47+
48+
.hero-section h1,
49+
.hero-section h2,
50+
.hero-section h3,
51+
.hero-section p,
52+
.hero-section span,
53+
.hero-section div {
54+
font-size: 4rem !important;
55+
line-height: 1.1 !important;
56+
}
57+
58+
/* More specific targeting for the actual h1 content */
59+
.hero-section .text-center h1,
60+
.hero-section .mobile-text-container h1,
61+
.hero-section h1.text-3xl,
62+
.hero-section h1.sm\:text-4xl,
63+
.hero-section h1.md\:text-5xl,
64+
.hero-section h1.lg\:text-6xl {
65+
font-size: 8rem !important;
66+
line-height: 0.9 !important;
67+
font-weight: 700 !important;
68+
width: 100% !important;
69+
height: 100vh !important;
70+
display: flex !important;
71+
align-items: center !important;
72+
justify-content: flex-start !important;
73+
padding: 1rem !important;
74+
}
75+
76+
/* Target the specific hero-title class */
77+
.hero-section .hero-title {
78+
font-size: 8rem !important;
79+
line-height: 0.9 !important;
80+
font-weight: 700 !important;
81+
width: 100% !important;
82+
height: 100vh !important;
83+
display: flex !important;
84+
align-items: center !important;
85+
justify-content: flex-start !important;
86+
padding: 1rem !important;
87+
}
88+
89+
/* Override all Tailwind text sizing classes for mobile */
90+
.hero-section .hero-title.text-3xl,
91+
.hero-section .hero-title.sm\:text-4xl,
92+
.hero-section .hero-title.md\:text-5xl,
93+
.hero-section .hero-title.lg\:text-6xl {
94+
font-size: 8rem !important;
95+
line-height: 0.9 !important;
96+
font-weight: 700 !important;
97+
}
98+
99+
/* Force override any inline styles */
100+
.hero-section .hero-title[style*="line-height"] {
101+
line-height: 0.9 !important;
48102
}
49103
}
50104
</style>
51105

52106
<div class="absolute inset-0 flex items-center justify-center px-6 sm:px-8 lg:px-8">
53-
<div class="w-full max-w-screen-xl text-center transform -translate-y-4 sm:-translate-y-8 md:-translate-y-12">
107+
<div class="w-full max-w-screen-xl text-center sm:text-center transform -translate-y-4 sm:-translate-y-8 md:-translate-y-12 mobile-text-container">
54108
<slot />
55109
</div>
56110
</div>

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import ContactSection from "../components/ContactSection.astro";
3535
<header class="landing-header">
3636
<Hero imgSrc="img/header-banner.png">
3737
<h1
38-
class="text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-chivo tracking-tight leading-tight"
38+
class="hero-title text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-chivo tracking-tight leading-tight"
3939
style="line-height: 1.1; color: #3C4228;"
4040
>
4141
Empowering the <br/>

src/styles/global.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,21 @@ section {
1717
main > section {
1818
margin: 0;
1919
padding: 0;
20+
}
21+
22+
/* Mobile hero text styling - override Tailwind responsive sizing */
23+
@media (max-width: 768px) {
24+
.hero-title {
25+
font-size: 3rem !important;
26+
line-height: 1.2 !important;
27+
font-weight: 400 !important;
28+
font-family: 'Chivo', sans-serif !important;
29+
width: 100% !important;
30+
height: 100vh !important;
31+
display: flex !important;
32+
align-items: center !important;
33+
justify-content: flex-start !important;
34+
padding: 1rem !important;
35+
color: #3C4228 !important;
36+
}
2037
}

0 commit comments

Comments
 (0)