fix: resize terminals to fit content with zero scrolling and zero dead spacing

This commit is contained in:
katR 2026-09-12 16:36:33 +05:30
parent e35d497b5b
commit 607e0c566a

View file

@ -289,6 +289,7 @@
color: #e5e5e5;
background: transparent !important;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
user-select: text;
}
@ -1018,29 +1019,29 @@
const H = window.innerHeight - 36; // leave room for taskbar
if (W >= 1500) {
// Broad monitor: snug fit without dead space, skills lowered below websites
setWinPos('win-about', 30, 32, 380, 215);
setWinPos('win-skills', 315, 50, 385, 248);
setWinPos('win-websites', 48, 440, 375, 248);
setWinPos('win-links', 325, 470, 350, 285);
setWinPos('win-term', 25, 895, Math.min(910, W - 935), 465);
setWinPos('win-viz', 520, 870, Math.min(935, W - 910), 285);
// Broad monitor: snug fit without dead space, content-fitted heights
setWinPos('win-about', 26, 32, 360, null);
setWinPos('win-skills', 324, 44, 365, null);
setWinPos('win-websites', 38, 424, 355, null);
setWinPos('win-links', 346, 440, 340, null);
setWinPos('win-term', 24, 805, Math.min(650, W - 835), 378);
setWinPos('win-viz', 422, 805, Math.min(650, W - 835), 245);
} else if (W >= 1150) {
// Standard laptop / desktop: non-parallel coordinates & no overlap
setWinPos('win-about', 22, 22, 350, 215);
setWinPos('win-skills', 305, 40, 360, 248);
setWinPos('win-websites', 40, 400, 350, 248);
setWinPos('win-links', 315, 425, 335, 285);
setWinPos('win-term', 20, 835, Math.max(480, W - 865), 445);
setWinPos('win-viz', 495, 810, Math.max(500, W - 840), 275);
setWinPos('win-about', 18, 20, 340, null);
setWinPos('win-skills', 314, 30, 350, null);
setWinPos('win-websites', 28, 382, 345, null);
setWinPos('win-links', 334, 400, 335, null);
setWinPos('win-term', 18, 748, Math.max(580, W - 770), 378);
setWinPos('win-viz', 416, 748, Math.max(580, W - 770), 240);
} else if (W >= 800) {
// Tablet / compact
setWinPos('win-about', 18, 16, 340, 215);
setWinPos('win-skills', 295, 30, 345, 248);
setWinPos('win-websites', 35, 385, 335, 248);
setWinPos('win-links', 305, 410, 325, 285);
setWinPos('win-term', 620, 22, W - 48, 435);
setWinPos('win-viz', 1080, 38, W - 68, 270);
setWinPos('win-about', 16, 16, 340, null);
setWinPos('win-skills', 310, 25, 345, null);
setWinPos('win-websites', 24, 380, 335, null);
setWinPos('win-links', 330, 395, 325, null);
setWinPos('win-term', 650, 20, W - 44, 378);
setWinPos('win-viz', 1048, 20, W - 44, 240);
}
restoreAllWindows();
@ -1053,7 +1054,11 @@
win.style.top = top + 'px';
win.style.left = left + 'px';
if (width) win.style.width = width + 'px';
if (height) win.style.height = height + 'px';
if (height) {
win.style.height = height + 'px';
} else {
win.style.height = 'auto';
}
}
// ── Window Dragging & State ──────────────────────────────────────────────
@ -1173,20 +1178,20 @@
const fastfetchLines = [
` ▄`,
` ▟█▙`,
` ▟███▙ <b style="color:#ffffff; text-shadow:var(--glow-subtle);">oiupoyt</b><span style="opacity:0.4">@</span><b style="color:#ffffff;">archlinux</b>`,
` ▟█████▙ <span style="opacity:0.35">────────────────────────</span>`,
` ▟███████▙ ${fa('fas fa-laptop')} <span style="opacity:0.45;font-size:10px">OS</span> Arch Linux x86_64`,
` ▂▔▀▜██████▙ ${fa('fas fa-microchip')} <span style="opacity:0.45;font-size:10px">Kernel</span> Linux 6.19.8-arch1-1`,
` ▟██▅▂▝▜█████▙ ${fa('fas fa-box-open')} <span style="opacity:0.45;font-size:10px">Packages</span> 1254 (pacman), 60 (flatpak)`,
` ▟█████████████▙ ${fa('fas fa-terminal')} <span style="opacity:0.45;font-size:10px">Shell</span> fish 4.5.0`,
` ▟███████████████▙ ${fa('fas fa-display')} <span style="opacity:0.45;font-size:10px">Terminal</span> kitty 0.46.1`,
` ▟█████████████████▙ ${fa('fas fa-window-restore')} <span style="opacity:0.45;font-size:10px">WM</span> Hyprland 0.54.2 (Wayland)`,
` ▟███████████████████▙ ${fa('fas fa-palette')} <span style="opacity:0.45;font-size:10px">Theme</span> monochrome-dark`,
` ▟█████████▛▀▀▜████████▙ ${fa('fas fa-font')} <span style="opacity:0.45;font-size:10px">Font</span> JetBrains Mono (11pt)`,
` ▟████████▛ ▜███████▙ ${fa('fas fa-clock')} <span style="opacity:0.45;font-size:10px">Uptime</span> <span id="dynUptime">12 hours, 42 mins</span>`,
` ▟█████████ ████████▙ ${fa('fas fa-music')} <span style="opacity:0.45;font-size:10px">Music</span> Baiaa081 - Noite Isolada`,
` ▟██████████ █████▆▅▄▃▂ ${fa('fas fa-cat')} <span style="opacity:0.45;font-size:10px">Status</span> you da real kat 🤍`,
` ▟██████████▛ ▜█████████▙ ${fa('fas fa-network-wired')} <span style="opacity:0.45;font-size:10px">Websites</span> katdrop • kats • jd • toolbox`,
` ▟███▙ <b style="color:#ffffff; text-shadow:var(--glow-subtle);">oiupoyt</b><span style="opacity:0.4">@</span><b style="color:#ffffff;">archlinux</b>`,
` ▟█████▙ <span style="opacity:0.35">────────────────────────</span>`,
` ▟███████▙ ${fa('fas fa-laptop')} <span style="opacity:0.45;font-size:10px">OS</span> Arch Linux x86_64`,
` ▂▔▀▜██████▙ ${fa('fas fa-microchip')} <span style="opacity:0.45;font-size:10px">Kernel</span> Linux 6.19.8-arch1-1`,
` ▟██▅▂▝▜█████▙ ${fa('fas fa-box-open')} <span style="opacity:0.45;font-size:10px">Packages</span> 1254 (pacman), 60 (flatpak)`,
` ▟█████████████▙ ${fa('fas fa-terminal')} <span style="opacity:0.45;font-size:10px">Shell</span> fish 4.5.0`,
` ▟███████████████▙ ${fa('fas fa-display')} <span style="opacity:0.45;font-size:10px">Terminal</span> kitty 0.46.1`,
` ▟█████████████████▙ ${fa('fas fa-window-restore')} <span style="opacity:0.45;font-size:10px">WM</span> Hyprland 0.54.2 (Wayland)`,
` ▟███████████████████▙ ${fa('fas fa-palette')} <span style="opacity:0.45;font-size:10px">Theme</span> monochrome-dark`,
` ▟█████████▛▀▀▜████████▙ ${fa('fas fa-font')} <span style="opacity:0.45;font-size:10px">Font</span> JetBrains Mono (11pt)`,
` ▟████████▛ ▜███████▙ ${fa('fas fa-clock')} <span style="opacity:0.45;font-size:10px">Uptime</span> <span id="dynUptime">12 hours, 42 mins</span>`,
` ▟█████████ ████████▙ ${fa('fas fa-music')} <span style="opacity:0.45;font-size:10px">Music</span> Baiaa081 - Noite Isolada`,
` ▟██████████ █████▆▅▄▃▂ ${fa('fas fa-cat')} <span style="opacity:0.45;font-size:10px">Status</span> you da real kat 🤍`,
` ▟██████████▛ ▜█████████▙ ${fa('fas fa-network-wired')} <span style="opacity:0.45;font-size:10px">Websites</span> katdrop • kats • jd • toolbox`,
` ▟██████▀▀▀ ▀▀██████▙`,
` ▟███▀▘ ▝▀███▙`,
` ▟▛▀ ▀▜▙`,