diff --git a/package.json b/package.json index b9865d6..d675f28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.37.4", + "version": "1.38.0", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/prisma/schema.prisma b/prisma/schema.prisma index c55ef5b..b33894f 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -100,6 +100,7 @@ model User { weekdayFormat String? @default("long") weekdayCase String? @default("capitalize") customWeekdayNames String? @default("") + mobileFontScale Float @default(1.0) startDayOffset Int @default(-1) quoteSourceUrls String[] @default([]) quoteLanguages String[] @default(["en", "de"]) diff --git a/src/app/api/user/profile/route.ts b/src/app/api/user/profile/route.ts index 2c9b6dd..2742659 100644 --- a/src/app/api/user/profile/route.ts +++ b/src/app/api/user/profile/route.ts @@ -96,6 +96,7 @@ export async function GET(request: NextRequest) { lightTheme: true, darkTheme: true, notificationsEnabled: true, + mobileFontScale: true, createdAt: true } }); @@ -138,7 +139,7 @@ export async function PATCH(request: NextRequest) { yearFontFamily, yearFontSize, yearFontWeight, yearColor, showTaskCheckboxes, dayHeaderGap, showCompletedTasks, showLines, startDayOffset, weekdayFormat, weekdayCase, customWeekdayNames, quoteSourceUrls, quoteLanguages, - kanbanStages, lightTheme, darkTheme, notificationsEnabled + kanbanStages, lightTheme, darkTheme, notificationsEnabled, mobileFontScale } = body; const updateData: any = { @@ -223,6 +224,7 @@ export async function PATCH(request: NextRequest) { ...(lightTheme !== undefined && { lightTheme }), ...(darkTheme !== undefined && { darkTheme }), ...(notificationsEnabled !== undefined && { notificationsEnabled }), + ...(mobileFontScale !== undefined && { mobileFontScale: parseFloat(mobileFontScale) || 1.0 }), }; if (password && password.trim() !== "") { updateData.passwordHash = await bcrypt.hash(password, 10); @@ -316,6 +318,7 @@ export async function PATCH(request: NextRequest) { lightTheme: true, darkTheme: true, notificationsEnabled: true, + mobileFontScale: true, } }); diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index c9e8a9f..293c693 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -4980,10 +4980,11 @@ export default function WeeklyView() { ); const fontSizeScale = fontSize === "S" ? 0.85 : fontSize === "L" ? 1.15 : 1; + const mobileScale = isMobile ? (profile.mobileFontScale || 1.0) : 1.0; const fontVal = (v: string | undefined) => v && v !== "__custom__" ? v : ""; const scaleRem = (base: string) => { const num = parseFloat(base); - return `${(num * fontSizeScale).toFixed(3)}rem`; + return `${(num * fontSizeScale * mobileScale).toFixed(3)}rem`; }; const activeTheme = (darkMode ? profile.darkTheme : profile.lightTheme) as Record | null; @@ -5548,7 +5549,7 @@ export default function WeeklyView() { {/* Center: Date display (tap to jump to date) */} + ))} + + + {(profile.language || "en") === "de" + ? "Skaliert alle Schriften auf Mobilgeräten (< 768px)" + : "Scales all fonts on mobile devices (< 768px)"} + + + {/* Typography Settings */}