feat: add responsive font sizing for mobile
- 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>
This commit is contained in:
26
src/utils/responsive.js
Normal file
26
src/utils/responsive.js
Normal file
@@ -0,0 +1,26 @@
|
||||
// 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 };
|
||||
Reference in New Issue
Block a user