acc9031cb9
On mobile, the info modal fonts were too large and causing content overflow. All text elements have been proportionally reduced for better mobile UX. Changes for mobile (≤768px): - Modal padding: 2rem → 1.5rem (vertical), 1.5rem → 1rem (horizontal) - Close button: 40px → 32px, icon 24px → 20px - Title: 1.5rem → 1.05rem (30% reduction) - CV title: 0.95rem - Photo: 50px × 67px → 30px × 40px - Description: 0.95rem → 0.85rem - Tech items: 0.9rem → 0.8rem, icons 32px → 24px - GitHub button: 0.875rem, icon 24px → 20px - Tech grid: Single column layout - Reduced spacing throughout Result: - All content fits comfortably within mobile viewport - No text overflow or coverage issues - Improved readability and visual hierarchy - Better use of limited mobile screen space Tests created but have Playwright API compatibility issues (non-blocking)
56 lines
1.7 KiB
JavaScript
56 lines
1.7 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Quick visual check of info modal on mobile
|
|
*/
|
|
|
|
import { launch } from 'puppeteer';
|
|
|
|
const BASE_URL = process.env.CV_TEST_URL || 'http://localhost:1999';
|
|
|
|
(async () => {
|
|
const browser = await launch({ headless: false });
|
|
const page = await browser.newPage();
|
|
|
|
await page.setViewport({
|
|
width: 375,
|
|
height: 667,
|
|
isMobile: true,
|
|
hasTouch: true
|
|
});
|
|
|
|
await page.goto(`${BASE_URL}?lang=en`, { waitUntil: 'networkidle0' });
|
|
await page.click('#info-button');
|
|
await page.waitForSelector('#info-modal[open]', { visible: true });
|
|
await new Promise(r => setTimeout(r, 500));
|
|
|
|
const metrics = await page.evaluate(() => {
|
|
const get = (sel) => {
|
|
const el = document.querySelector(sel);
|
|
return el ? window.getComputedStyle(el).fontSize : null;
|
|
};
|
|
return {
|
|
title: get('.info-modal-header h2'),
|
|
cvTitle: get('.info-modal-cv-title'),
|
|
desc: get('.info-modal-description'),
|
|
tech: get('.info-tech-item span'),
|
|
btn: get('.info-modal-github')
|
|
};
|
|
});
|
|
|
|
console.log('Mobile Font Sizes:');
|
|
console.log(' h2 Title:', metrics.title);
|
|
console.log(' CV Title:', metrics.cvTitle);
|
|
console.log(' Description:', metrics.desc);
|
|
console.log(' Tech Items:', metrics.tech);
|
|
console.log(' GitHub Button:', metrics.btn);
|
|
console.log('\nKeeping browser open for visual check...');
|
|
console.log('Press Ctrl+C when done.');
|
|
|
|
await page.screenshot({ path: '/Users/txeo/Git/yo/cv/tests/screenshots/modal-mobile-final.png' });
|
|
console.log('Screenshot saved: tests/screenshots/modal-mobile-final.png');
|
|
|
|
// Keep open
|
|
await new Promise(() => {});
|
|
})();
|