Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions e2e/navigation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ test.describe('Navigation', () => {
await expect(footer.locator('a[href="/feed.xml"]')).toBeVisible();
await expect(footer.locator('a[href="/feed.json"]')).toBeVisible();
});

test('footer keeps bottom clearance in preview-sized viewports', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await page.goto('/cv');
await page.evaluate(() => window.scrollTo(0, document.documentElement.scrollHeight));

const clearance = await page.evaluate(() => {
const footer = Array.from(document.querySelectorAll('footer')).at(-1);
if (!footer) return 0;

const visibleDescendants = Array.from(footer.querySelectorAll('*'))
.map((element) => element.getBoundingClientRect())
.filter((rect) => rect.width > 0 && rect.height > 0);
const lowestContentBottom = Math.max(...visibleDescendants.map((rect) => rect.bottom));

return window.innerHeight - lowestContentBottom;
});

expect(clearance).toBeGreaterThanOrEqual(88);
});
});

test.describe('About Page', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
{@render children()}
</main>

<footer class="bg-surface-100-900 border-t border-surface-300-700 py-6 text-center text-sm text-surface-500">
<footer class="bg-surface-100-900 border-t border-surface-300-700 pt-6 pb-[calc(6rem+env(safe-area-inset-bottom))] md:pb-16 text-center text-sm text-surface-500">
<div class="container mx-auto px-4 flex flex-wrap items-center justify-center gap-x-4 gap-y-2">
<p>
Dedicated to the <a
Expand Down
Loading