- Add src/utils/responsive.js with fontSize() helper - Mobile fonts scale 1.4x for better readability - Update all scenes to use responsive font sizes - Update deploy-k8s.sh with full deployment steps Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
27 lines
740 B
JavaScript
27 lines
740 B
JavaScript
// Responsive utilities for mobile-friendly text sizing
|
|
|
|
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
|
|
// Font size multiplier for mobile devices
|
|
const MOBILE_SCALE = 1.4;
|
|
|
|
/**
|
|
* Get responsive font size - larger on mobile for better readability
|
|
* @param {number} baseSize - Base font size in pixels
|
|
* @returns {string} Font size string with 'px' suffix
|
|
*/
|
|
export function fontSize(baseSize) {
|
|
const size = isMobile ? Math.round(baseSize * MOBILE_SCALE) : baseSize;
|
|
return `${size}px`;
|
|
}
|
|
|
|
/**
|
|
* Check if running on mobile device
|
|
* @returns {boolean}
|
|
*/
|
|
export function checkMobile() {
|
|
return isMobile;
|
|
}
|
|
|
|
export default { fontSize, checkMobile, isMobile };
|