Skip to content

Commit 4306b11

Browse files
fix(web): add mobile-responsive padding for hero section
Reduce hero section bottom padding from 10rem to 5rem on mobile while keeping 10rem on desktop for better mobile experience. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 663faae commit 4306b11

File tree

3 files changed

+54
-57
lines changed

3 files changed

+54
-57
lines changed

web/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default function Home() {
106106
<Section background={SECTION_THEMES.hero.background} hero fullViewport>
107107
<div
108108
className={cn(
109-
'codebuff-container min-h-full flex flex-col transition-all duration-1000 pb-8'
109+
'codebuff-container min-h-full flex flex-col transition-all duration-1000'
110110
)}
111111
>
112112
<div className={cn('w-full mb-8 md:mb-12 flex-shrink-0')}>

web/src/components/ui/hero.tsx

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { motion } from 'framer-motion'
44
import { useState, useEffect } from 'react'
55

66
import { HeroButtons } from './hero-buttons'
7-
import { Section } from './section'
87

98
// Typing effect component for hero headline
109
function TypingEffect({ words }: { words: string[] }) {
@@ -60,63 +59,61 @@ function TypingEffect({ words }: { words: string[] }) {
6059

6160
export function Hero() {
6261
return (
63-
<Section hero>
64-
<div className="relative z-10">
65-
<motion.div
66-
initial={{ opacity: 0, y: 30 }}
67-
animate={{ opacity: 1, y: 0 }}
68-
transition={{ duration: 0.7 }}
62+
<div className="relative z-10">
63+
<motion.div
64+
initial={{ opacity: 0, y: 30 }}
65+
animate={{ opacity: 1, y: 0 }}
66+
transition={{ duration: 0.7 }}
67+
>
68+
<motion.h1
69+
className="hero-heading text-center mb-8 text-white text-balance"
70+
initial={{ opacity: 0, scale: 0.95 }}
71+
animate={{ opacity: 1, scale: 1 }}
72+
transition={{
73+
duration: 0.8,
74+
ease: [0.165, 0.84, 0.44, 1],
75+
}}
6976
>
70-
<motion.h1
71-
className="hero-heading text-center mb-8 text-white text-balance"
72-
initial={{ opacity: 0, scale: 0.95 }}
73-
animate={{ opacity: 1, scale: 1 }}
74-
transition={{
75-
duration: 0.8,
76-
ease: [0.165, 0.84, 0.44, 1],
77-
}}
77+
<motion.span
78+
className="relative inline-block"
79+
initial={{ y: 20 }}
80+
animate={{ y: 0 }}
81+
transition={{ duration: 0.5, delay: 0.1 }}
7882
>
79-
<motion.span
80-
className="relative inline-block"
81-
initial={{ y: 20 }}
82-
animate={{ y: 0 }}
83-
transition={{ duration: 0.5, delay: 0.1 }}
84-
>
85-
<span className="relative z-10">Supercharge</span>
86-
</motion.span>{' '}
87-
Your{' '}
88-
<motion.span
89-
className="relative inline-block"
90-
initial={{ y: 20 }}
91-
animate={{ y: 0 }}
92-
transition={{ duration: 0.5, delay: 0.2 }}
93-
>
94-
<span className="relative z-10">AI Coding</span>
95-
</motion.span>
96-
</motion.h1>
97-
</motion.div>
83+
<span className="relative z-10">Supercharge</span>
84+
</motion.span>{' '}
85+
Your{' '}
86+
<motion.span
87+
className="relative inline-block"
88+
initial={{ y: 20 }}
89+
animate={{ y: 0 }}
90+
transition={{ duration: 0.5, delay: 0.2 }}
91+
>
92+
<span className="relative z-10">AI Coding</span>
93+
</motion.span>
94+
</motion.h1>
95+
</motion.div>
9896

99-
<motion.h2
100-
className="hero-subtext text-center mx-auto max-w-xl mb-6"
101-
initial={{ opacity: 0, y: 20 }}
102-
animate={{ opacity: 1, y: 0 }}
103-
transition={{ duration: 0.5, delay: 0.3 }}
104-
>
105-
<span className="whitespace-nowrap">Simple. Fast. Powerful.</span>{' '}
106-
<span className="whitespace-nowrap">
107-
Codebuff works in your terminal.
108-
</span>
109-
</motion.h2>
97+
<motion.h2
98+
className="hero-subtext text-center mx-auto max-w-xl mb-6"
99+
initial={{ opacity: 0, y: 20 }}
100+
animate={{ opacity: 1, y: 0 }}
101+
transition={{ duration: 0.5, delay: 0.3 }}
102+
>
103+
<span className="whitespace-nowrap">Simple. Fast. Powerful.</span>{' '}
104+
<span className="whitespace-nowrap">
105+
Codebuff works in your terminal.
106+
</span>
107+
</motion.h2>
110108

111-
<motion.div
112-
initial={{ opacity: 0, y: 20 }}
113-
animate={{ opacity: 1, y: 0 }}
114-
transition={{ duration: 0.5, delay: 0.5 }}
115-
className="mb-12 md:mb-4" // Added more bottom margin on mobile
116-
>
117-
<HeroButtons />
118-
</motion.div>
119-
</div>
120-
</Section>
109+
<motion.div
110+
initial={{ opacity: 0, y: 20 }}
111+
animate={{ opacity: 1, y: 0 }}
112+
transition={{ duration: 0.5, delay: 0.5 }}
113+
className="mb-12 md:mb-4" // Added more bottom margin on mobile
114+
>
115+
<HeroButtons />
116+
</motion.div>
117+
</div>
121118
)
122119
}

web/src/components/ui/section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function Section({
6767
style={{
6868
...style,
6969
paddingTop: hero ? '1rem' : '10rem',
70-
paddingBottom: hero ? '0' : '10rem',
70+
paddingBottom: isMobile && hero ? '5rem' : '10rem',
7171
}}
7272
{...props}
7373
>

0 commit comments

Comments
 (0)