summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorsimon <vesspa0330@gmail.com>2026-11-17 21:27:47 -0500
committersimon <vesspa0330@gmail.com>2026-11-17 21:27:47 -0500
commitab8d8cf7362870abf9aea17df88a7ded2bdef5a2 (patch)
treeb4c880dee0bf8190806e864785ad71c8ddf29c6f /index.html
parent13b2d9e35b6842f96234513eedc0cd1281e1eefc (diff)
fixed gallery aspect ratio
Diffstat (limited to 'index.html')
-rw-r--r--index.html20
1 files changed, 10 insertions, 10 deletions
diff --git a/index.html b/index.html
index 1e18cdf..063a2d4 100644
--- a/index.html
+++ b/index.html
@@ -402,7 +402,7 @@
window.addEventListener("resize", setImageSizes);
// initialize jiggle state
- setJiggleThreshold();
+ setJiggleThreshold();
// initialize gallery image sizes by feigning resize upon init
setImageSizes();
@@ -410,10 +410,10 @@
function setJiggleThreshold() {
isDesktop = window.innerWidth > 850;
- jiggleThreshold = document.getElementById("hero-image").offsetHeight +
- document.getElementById("intro").offsetHeight +
- document.getElementById("services").offsetHeight;
- if (isDesktop) jiggleThreshold += 450;
+ jiggleThreshold = document.getElementById("hero-image").offsetHeight +
+ document.getElementById("intro").offsetHeight +
+ document.getElementById("services").offsetHeight;
+ if (isDesktop) jiggleThreshold += 450;
}
@@ -447,19 +447,19 @@
/** override logic for 'juxtapose' image scaling based on window size changes */
function setImageSizes() {
- setJiggleThreshold();
+ setJiggleThreshold();
let newWidth, newHeight;
if (isDesktop) {
- newWidth = window.innerWidth * 0.35;
+ newWidth = Math.round(window.innerWidth * 0.35);
}
else {
- newWidth = window.innerWidth * 0.80;
+ newWidth = Math.round(window.innerWidth * 0.80);
}
- // keep all images at 1:1.2 ratio
- newHeight = newWidth * 1.2;
+ // keep consistent aspect ratio
+ newHeight = Math.round(newWidth * 1.33);
// resize iframes
let images = document.getElementsByClassName("juxtapose");