aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-05-28 17:58:40 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-05-28 17:58:40 -0700
commit52e1c3a67a65baea5c98931baf53663a35b001ab (patch)
tree743bc3b0192370d494d8771b23d5cdee7aa62bc6
parent2ed8368a7972eda05fa1d9abb73194cfb31a1baa (diff)
aero: scale desktop to fit smaller monitors
Use a JS-driven `zoom` on <html> computed from viewport vs a 1440x900 baseline (clamped at 0.55) so absolutely-positioned windows, icons, and the taskbar stop overlapping on lower-res displays.
-rwxr-xr-xindex.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/index.html b/index.html
index 94a9633..24490b4 100755
--- a/index.html
+++ b/index.html
@@ -282,6 +282,22 @@
</head>
<body>
<script>(function(){var t=localStorage.getItem('tyler.theme')||'aero';document.body.setAttribute('data-theme',t);})();</script>
+ <script>
+ // Scale the whole desktop to fit smaller monitors. Layout is designed around
+ // ~1440x900; below that, windows overlap and icons run off the bottom edge.
+ // `zoom` scales positions, sizes, fonts, AND pointer coords together, so
+ // drag/resize math stays consistent.
+ (function(){
+ var BASE_W = 1440, BASE_H = 900, MIN = 0.55;
+ function fit(){
+ var s = Math.min(window.innerWidth / BASE_W, window.innerHeight / BASE_H);
+ s = Math.min(1, Math.max(MIN, s));
+ document.documentElement.style.zoom = s;
+ }
+ fit();
+ window.addEventListener('resize', fit);
+ })();
+ </script>
<div class="desk" id="desk">
<div class="sun" style="background: var(--sun);"></div>
<div class="lens-flare"></div>