Increase mobile web font size: target 50 cols instead of 80

At 320px viewport this gives 10px font instead of 6px,
making the TUI readable on phones.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shuki
2026-03-07 01:11:13 +02:00
parent 3292575233
commit af150f912d

View File

@@ -153,12 +153,12 @@
window.location.href = getStartUrl();
}
// Auto-select font size for mobile to fit ~80 columns
// Auto-select font size for mobile to fit ~50 columns
(function() {
var url = new URL(window.location.href);
if (!url.searchParams.has("fontsize") && window.innerWidth < 768) {
// xterm char width is ~0.6 * fontSize; target 80 cols
var fontSize = Math.max(6, Math.floor(window.innerWidth / (80 * 0.6)));
// xterm char width is ~0.6 * fontSize; target 50 cols for readability
var fontSize = Math.max(8, Math.floor(window.innerWidth / (50 * 0.6)));
url.searchParams.set("fontsize", fontSize);
window.location.replace(url.toString());
}