Skip to content

Commit 1167fec

Browse files
authored
feat: mobile-friendly refactor (#256)
1 parent 55111e5 commit 1167fec

10 files changed

Lines changed: 60 additions & 51 deletions

File tree

src/components/marketing/Hero.astro

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { content } = Astro.props;
1515
---
1616

1717
<section
18-
class="from-base-100 via-base-200/40 to-base-100 relative overflow-hidden border-b border-base-300/60 bg-linear-to-br py-28 md:py-36"
18+
class="from-base-100 via-base-200/40 to-base-100 relative overflow-hidden border-b border-base-300/60 bg-linear-to-br py-16 md:py-28 lg:py-36"
1919
aria-labelledby="hero-heading"
2020
>
2121
<div
@@ -25,17 +25,17 @@ const { content } = Astro.props;
2525
>
2626
</div>
2727

28-
<div class="relative mx-auto grid grid-cols-2 max-w-6xl gap-10 px-4 py-16 md:flex-row md:items-center md:py-24 lg:gap-16">
29-
<div class="flex-1">
30-
<p class="text-primary mb-3 text-sm font-semibold tracking-wide uppercase">{content.eyebrow}</p>
31-
<h1 id="hero-heading" class="mb-5 text-4xl leading-tight font-bold tracking-tight md:text-5xl lg:text-6xl">
28+
<div class="relative mx-auto flex flex-col md:flex-row max-w-6xl gap-8 md:gap-10 lg:gap-16 px-4 py-12 md:py-16 lg:py-24 items-center">
29+
<div class="flex-1 text-center md:text-left">
30+
<p class="text-primary mb-2 md:mb-3 text-xs md:text-sm font-semibold tracking-wide uppercase">{content.eyebrow}</p>
31+
<h1 id="hero-heading" class="mb-4 md:mb-5 text-3xl md:text-5xl lg:text-6xl leading-tight font-bold tracking-tight">
3232
{content.headline}
3333
</h1>
34-
<p class="text-base-content/90 mb-8 text-lg leading-relaxed md:text-xl">
34+
<p class="text-base-content/90 mb-6 md:mb-8 text-base md:text-lg leading-relaxed md:text-xl">
3535
{content.subhead}
3636
</p>
3737
{(content.primaryCta ?? content.secondaryCta) && (
38-
<div class="flex flex-wrap gap-3">
38+
<div class="flex flex-wrap gap-3 justify-center md:justify-start">
3939
{content.primaryCta && (
4040
<a href={content.primaryCta.href} class="btn btn-primary btn-lg no-underline">
4141
{content.primaryCta.label}
@@ -50,6 +50,6 @@ const { content } = Astro.props;
5050
)}
5151
</div>
5252

53-
<Logo size="full" showTitle={false} class="mb-4 scale-scale"/>
53+
<Logo size="full" showTitle={false} class="mb-4 scale-scale hidden md:block"/>
5454
</div>
5555
</section>

src/components/marketing/HowToHelp.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { items } = Astro.props;
1010
const t = useTranslations();
1111
---
1212

13-
<div class="grid gap-6 md:grid-cols-3">
13+
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
1414
{
1515
items.map((item) => (
1616
<article class="card border-base-300 bg-base-100 border shadow-sm">

src/components/marketing/Section.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ const bg =
1919
---
2020

2121
<section id={id} class:list={[bg, 'scroll-mt-28 border-b border-base-300/60', className]}>
22-
<div class="mx-auto max-w-6xl px-4 py-16 md:py-24">
22+
<div class="mx-auto max-w-6xl px-4 py-12 md:py-16 lg:py-24">
2323
{
2424
eyebrow && (
25-
<p class="text-primary mb-2 text-sm font-semibold tracking-wide uppercase">{eyebrow}</p>
25+
<p class="text-primary mb-2 text-xs md:text-sm font-semibold tracking-wide uppercase">{eyebrow}</p>
2626
)
2727
}
28-
<h2 class="mb-4 text-3xl font-bold tracking-tight md:text-4xl">{title}</h2>
29-
{subtitle && <p class="text-base-content/85 mb-8 max-w-3xl text-lg leading-relaxed">{subtitle}</p>}
28+
<h2 class="mb-3 md:mb-4 text-2xl md:text-3xl lg:text-4xl font-bold tracking-tight">{title}</h2>
29+
{subtitle && <p class="text-base-content/85 mb-6 md:mb-8 max-w-3xl text-base md:text-lg leading-relaxed">{subtitle}</p>}
3030
<slot />
3131
</div>
3232
</section>

src/components/marketing/TestimonialGrid.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { items } = Astro.props;
1010
const t = useTranslations();
1111
---
1212

13-
<div class="grid gap-8 md:grid-cols-2">
13+
<div class="grid gap-4 md:gap-8 grid-cols-1 md:grid-cols-2">
1414
{
1515
items.map((item) => (
1616
<figure class="border-base-300 bg-base-100/80 flex flex-col gap-4 rounded-2xl border p-6 shadow-sm">

src/components/ui/CallToAction.astro

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,24 @@ import { Icon } from 'astro-icon/components';
44
interface Props {
55
icon: string;
66
title: string;
7-
description: string;
7+
description?: string;
88
class?: string;
99
}
1010
1111
const { icon, title, description, class: className = '' } = Astro.props;
1212
---
1313

14-
<section class={`py-16 md:py-24 relative overflow-hidden ${className}`}>
15-
<div class="absolute inset-0 bg-gradient-to-br from-primary/5 via-base-100 to-secondary/5"></div>
16-
<div class="absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,_var(--tw-gradient-stops))] from-primary/10 via-transparent to-transparent"></div>
14+
<section class={`relative overflow-hidden bg-linear-to-br from-primary/5 via-base-100 to-secondary/5 py-12 md:py-16 lg:py-24 ${className}`}>
15+
<div class="absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-primary/10 via-transparent to-transparent"></div>
1716

18-
<div class="relative mx-auto max-w-6xl px-4">
19-
<div class="max-w-2xl mx-auto text-center">
20-
<div class="w-16 h-16 rounded-2xl bg-gradient-to-br from-primary to-primary/70 flex items-center justify-center shadow-lg shadow-primary/20 mx-auto mb-6">
21-
<Icon name={icon} class="w-8 h-8 text-primary-content" />
22-
</div>
23-
<h2 class="text-3xl font-bold mb-4">{title}</h2>
24-
<p class="text-lg text-base-content/70 mb-8">{description}</p>
17+
<div class="relative mx-auto max-w-4xl px-4 text-center">
18+
<div class="w-12 h-12 md:w-16 md:h-16 rounded-2xl bg-gradient-to-br from-primary to-primary/70 flex items-center justify-center shadow-lg shadow-primary/20 mx-auto mb-4 md:mb-6">
19+
<Icon name={icon} class="w-6 h-6 md:w-8 md:h-8 text-primary-content" />
20+
</div>
21+
<h2 class="text-xl md:text-2xl lg:text-3xl font-bold mb-3 md:mb-4">{title}</h2>
22+
{description && <p class="text-base-content/70 mb-6 md:mb-8 max-w-2xl mx-auto text-base md:text-lg leading-relaxed">{description}</p>}
23+
<div class="flex flex-col sm:flex-row gap-3 md:gap-4 justify-center">
2524
<slot />
2625
</div>
27-
<slot name="footer" />
2826
</div>
2927
</section>

src/components/ui/HeroSection.astro

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ const { eyebrow, title, subtitle, stats, class: className = '' } = Astro.props;
2727
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-gradient-to-r from-primary/3 to-secondary/3 rounded-full blur-3xl"></div>
2828
</div>
2929

30-
<div class="relative mx-auto max-w-6xl px-4 py-24 md:py-32">
30+
<div class="relative mx-auto max-w-6xl px-4 py-16 md:py-20 lg:py-32">
3131
{eyebrow && (
32-
<div class="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 text-primary text-sm font-medium mb-6">
32+
<div class="inline-flex items-center gap-2 px-3 py-1.5 md:px-4 md:py-2 rounded-full bg-primary/10 text-primary text-xs md:text-sm font-medium mb-4 md:mb-6">
3333
<slot name="eyebrow-icon" />
3434
<span>{eyebrow}</span>
3535
</div>
3636
)}
3737

38-
<h1 class="text-5xl md:text-6xl font-bold tracking-tight mb-6 bg-gradient-to-r from-base-content via-base-content to-base-content/70 bg-clip-text">
38+
<h1 class="text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold tracking-tight mb-4 md:mb-6 bg-gradient-to-r from-base-content via-base-content to-base-content/70 bg-clip-text">
3939
{title}
4040
</h1>
4141

4242
{subtitle && (
43-
<p class="text-xl text-base-content/70 max-w-2xl leading-relaxed">
43+
<p class="text-base md:text-lg lg:text-xl text-base-content/70 max-w-2xl leading-relaxed">
4444
{subtitle}
4545
</p>
4646
)}
4747

4848
{stats.length > 0 && (
49-
<div class="flex flex-wrap gap-6 mt-10">
49+
<div class="flex flex-wrap gap-4 md:gap-6 mt-8 md:mt-10">
5050
{stats.map((stat) => {
5151
const colorClasses = {
5252
primary: 'bg-primary/10 text-primary',
@@ -56,13 +56,13 @@ const { eyebrow, title, subtitle, stats, class: className = '' } = Astro.props;
5656
};
5757
const color = stat.color ?? 'blue';
5858
return (
59-
<div class="flex items-center gap-3">
60-
<div class={`w-12 h-12 rounded-xl ${colorClasses[color]} flex items-center justify-center`}>
61-
<Icon name={stat.icon} class="w-6 h-6" />
59+
<div class="flex items-center gap-2 md:gap-3">
60+
<div class={`w-10 h-10 md:w-12 md:h-12 rounded-xl ${colorClasses[color]} flex items-center justify-center`}>
61+
<Icon name={stat.icon} class="w-5 h-5 md:w-6 md:h-6" />
6262
</div>
6363
<div>
64-
<span class="block text-2xl font-bold">{stat.value}</span>
65-
<span class="text-sm text-base-content/60">{stat.label}</span>
64+
<span class="block text-xl md:text-2xl font-bold">{stat.value}</span>
65+
<span class="text-xs md:text-sm text-base-content/60">{stat.label}</span>
6666
</div>
6767
</div>
6868
);

src/components/ui/SectionHeader.astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const colorGradients = {
1919
};
2020
---
2121

22-
<div class={`flex items-center gap-4 ${className}`}>
23-
<div class={`w-14 h-14 rounded-2xl bg-gradient-to-br ${colorGradients[color]} flex items-center justify-center shadow-lg`}>
24-
<Icon name={icon} class="w-7 h-7 text-primary-content" />
22+
<div class={`flex items-center gap-3 md:gap-4 ${className}`}>
23+
<div class={`w-12 h-12 md:w-14 md:h-14 rounded-2xl bg-gradient-to-br ${colorGradients[color]} flex items-center justify-center shadow-lg`}>
24+
<Icon name={icon} class="w-6 h-6 md:w-7 md:h-7 text-primary-content" />
2525
</div>
2626
<div>
27-
<h2 class="text-3xl font-bold">{title}</h2>
28-
{subtitle && <p class="text-base-content/60">{subtitle}</p>}
27+
<h2 class="text-2xl md:text-3xl font-bold">{title}</h2>
28+
{subtitle && <p class="text-sm md:text-base text-base-content/60">{subtitle}</p>}
2929
</div>
3030
</div>

src/components/ui/StepItem.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ const COLORS: Record<StepColor, { text: string; gradient: string; gradientHover:
3939
const c = COLORS[color];
4040
---
4141

42-
<li class="group relative pl-16">
43-
<div class={`absolute left-0 top-0 w-12 h-12 rounded-xl bg-gradient-to-br ${c.gradient} flex items-center justify-center group-hover:scale-110 ${c.gradientHover} transition-all duration-300`}>
44-
<Icon name={icon} class={`w-5 h-5 ${c.text}`} />
42+
<li class="group relative pl-14 md:pl-16">
43+
<div class={`absolute left-0 top-0 w-10 h-10 md:w-12 md:h-12 rounded-xl bg-gradient-to-br ${c.gradient} flex items-center justify-center group-hover:scale-110 ${c.gradientHover} transition-all duration-300`}>
44+
<Icon name={icon} class={`w-4 h-4 md:w-5 md:h-5 ${c.text}`} />
4545
</div>
46-
<div class="absolute left-5 top-12 bottom-0 w-px bg-gradient-to-b from-base-300 to-transparent"></div>
46+
<div class="absolute left-4 md:left-5 top-10 md:top-12 bottom-0 w-px bg-gradient-to-b from-base-300 to-transparent"></div>
4747
<div>
48-
<h3 class="text-lg font-semibold flex items-center gap-2">
49-
<span class={`${c.text} font-mono text-sm`}>{step}</span>
48+
<h3 class="text-base md:text-lg font-semibold flex items-center gap-2">
49+
<span class={`${c.text} font-mono text-xs md:text-sm`}>{step}</span>
5050
{title}
5151
</h3>
5252
<p class="text-base-content/70 text-sm leading-relaxed mt-1">{desc}</p>

src/pages/about.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const description = t('about.hero.subtitle');
6161
class="mb-12"
6262
/>
6363

64-
<ul class="grid gap-6 md:grid-cols-1 lg:grid-cols-3">
64+
<ul class="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
6565
{coreValues.map((value, index) => {
6666
const cards = [
6767
{ from: 'from-blue-500/5', to: 'to-blue-600/10', border: 'hover:border-blue-500/30', gradient: 'from-blue-500 to-blue-600', icon: 'lucide:users' },
@@ -127,7 +127,7 @@ const description = t('about.hero.subtitle');
127127
class="mb-8"
128128
/>
129129

130-
<ul class="grid gap-4 md:grid-cols-1 lg:grid-cols-3">
130+
<ul class="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
131131
{communicationChannels.map((ch) => (
132132
<ChannelCard icon={ch.icon} title={t(ch.nameKey)} subtitle={t(ch.descKey)} color={ch.color} />
133133
))}

src/styles/global.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,19 @@
209209
}
210210
}
211211

212-
@media (max-width: 720px) {
212+
/* Reduced text size on mobile to keep content readable without aggressive scaling */
213+
@media (max-width: 640px) {
213214
body {
214-
@apply text-lg;
215+
@apply text-base;
216+
}
217+
218+
h1 {
219+
@apply text-4xl;
220+
}
221+
h2 {
222+
@apply text-3xl;
223+
}
224+
h3 {
225+
@apply text-2xl;
215226
}
216227
}

0 commit comments

Comments
 (0)