aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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>