Skip to content

Commit 52124fd

Browse files
fix: mobile
1 parent d1a7796 commit 52124fd

5 files changed

Lines changed: 52 additions & 10 deletions

File tree

.tmp-check-overflow.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { chromium } from '@playwright/test'
2+
3+
const browser = await chromium.launch({ headless: true })
4+
const page = await browser.newPage({ viewport: { width: 280, height: 844 } })
5+
await page.goto('http://localhost:4322/', { waitUntil: 'networkidle' })
6+
7+
const selectors = [
8+
'main[data-page-content]',
9+
'div.reveal.relative.overflow-hidden.bg-primary\\/70',
10+
'section.relative.mb-24.px-2.pt-20',
11+
'.vt-content-shell.grid.grid-cols-12.items-end.gap-8',
12+
'div.col-span-12.lg\\:col-span-7.pr-0.sm\\:pr-4',
13+
'div.relative.overflow-hidden.rounded-xl.px-4.py-8',
14+
'div.relative.z-10',
15+
'h1',
16+
'h1 + p',
17+
]
18+
19+
const data = await page.evaluate((sel) => {
20+
return sel.map((s) => {
21+
const el = document.querySelector(s)
22+
if (el === null) {
23+
return { s, missing: true }
24+
}
25+
26+
const r = el.getBoundingClientRect()
27+
return {
28+
s,
29+
left: r.left,
30+
right: r.right,
31+
width: r.width,
32+
scrollWidth: el.scrollWidth,
33+
clientWidth: el.clientWidth,
34+
className: typeof el.className === 'string' ? el.className : '',
35+
}
36+
})
37+
}, selectors)
38+
39+
console.log(JSON.stringify(data, null, 2))
40+
await browser.close()

src/components/home/HeroSection.astro

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,21 @@ const titleHtml = renderTitleMarkdown(t.titleMarkdown)
4343
style="--reveal-delay: 20ms;"
4444
>
4545
<HeroShader />
46-
<section class="relative mb-24 px-4 pt-26 sm:px-8 sm:pt-28 xl:px-12">
47-
<div class="vt-content-shell grid grid-cols-12 items-end gap-8 lg:gap-12">
48-
<div class="col-span-12 lg:col-span-7 pr-6 sm:pr-4">
46+
<section class="relative mb-24 px-2 pt-20 sm:px-8 sm:pt-28 xl:px-12">
47+
<div
48+
class="vt-content-shell grid grid-cols-1 items-end gap-8 lg:grid-cols-12 lg:gap-12"
49+
>
50+
<div class="min-w-0 w-full overflow-hidden pr-0 sm:pr-4 lg:col-span-7">
4951
<div
5052
class="relative overflow-hidden rounded-xl px-4 py-8 sm:px-8 sm:py-12"
5153
>
5254
<div class="relative z-10">
5355
<h1
54-
class="font-headline text-4xl tracking-tight text-white drop-shadow-[0_6px_24px_rgba(0,0,0,0.65)] sm:text-6xl lg:text-8xl lg:leading-[0.9]"
56+
class="max-w-full text-balance wrap-break-word font-headline text-4xl leading-[1.02] tracking-tight text-white drop-shadow-[0_6px_24px_rgba(0,0,0,0.65)] sm:text-6xl sm:leading-[0.95] lg:text-8xl lg:leading-[0.9]"
5557
set:html={titleHtml}
5658
/>
5759
<p
58-
class="mt-6 max-w-2xl text-base leading-relaxed text-white sm:text-xl"
60+
class="mt-6 max-w-2xl wrap-break-word text-base leading-relaxed text-white sm:text-xl"
5961
>
6062
{t.description}
6163
</p>

src/components/home/UpcomingEventsPanel.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ const activeUpcomingEvents = upcomingEvents.filter(
2121
{
2222
activeUpcomingEvents.length > 0 && (
2323
<aside
24-
class="col-span-12 h-full lg:col-span-5 lg:block lg:pt-8"
24+
class="h-full min-w-0 max-w-full lg:block lg:col-span-5 lg:pt-8"
2525
data-upcoming-events-panel
2626
data-buffer-ms="7200000"
2727
>
28-
<div class="flex h-[32rem] flex-col overflow-hidden rounded-xl bg-white/25 p-5 text-ink backdrop-blur-xl">
28+
<div class="flex h-[32rem] min-w-0 w-full max-w-full flex-col overflow-hidden rounded-xl bg-white/25 p-5 text-ink backdrop-blur-xl">
2929
<div class="mb-4 flex items-center justify-between">
3030
<p class="text-xs font-semibold tracking-[0.14em] text-ink-contrast uppercase">
3131
{t.upcomingEvents} ({activeUpcomingEvents.length})
3232
</p>
3333
</div>
34-
<div class="flex flex-1 flex-col gap-3 overflow-y-auto pr-1">
34+
<div class="flex min-w-0 flex-1 flex-col gap-3 overflow-y-auto pr-1">
3535
{activeUpcomingEvents.map((event) => (
3636
<div data-event-card data-event-date={event.data.date}>
3737
<UpcomingEventCard event={event} />

src/components/home/upcoming-event-card/UpcomingEventCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { event } = Astro.props
1313
const t = homeHeroT[LANG]
1414
1515
const cardClass =
16-
'block rounded-lg bg-white/40 p-3 text-ink-contrast transition-transform hover:-translate-y-0.5'
16+
'block rounded-lg bg-white/40 p-3 text-ink-contrast transition-transform hover:-translate-y-0.5 max-w-full'
1717
---
1818

1919
{

src/components/home/upcoming-event-card/UpcomingEventCardContent.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const formatTime = (dateValue: number): string =>
2727
.replace(/\./g, '')
2828
---
2929

30-
<div class="flex items-start justify-between gap-3">
30+
<div class="flex items-start justify-between gap-3 max-w-full">
3131
<div>
3232
<div class="mb-3 flex items-start gap-3">
3333
<GroupLogo

0 commit comments

Comments
 (0)