Skip to content

Commit f641d1b

Browse files
committed
Modcon - Preloader update
1 parent f44ac27 commit f641d1b

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

dist/modcon.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modcon.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allowBuilds:
2+
esbuild: true

src/modcon.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,11 @@ function initHeroLogoIntro() {
916916
return;
917917
}
918918

919-
// Scale to match starter width; translate so centers align
919+
// Scale to match starter width; translate so the small logo lands at the viewport center
920+
// (was: starter's center — broke once starter stopped being 100dvh tall)
920921
const scale = starterRect.width / logoRect.width;
921-
const dx = starterRect.left + starterRect.width / 2 - (logoRect.left + logoRect.width / 2);
922-
const dy = starterRect.top + starterRect.height / 2 - (logoRect.top + logoRect.height / 2);
922+
const dx = window.innerWidth / 2 - (logoRect.left + logoRect.width / 2);
923+
const dy = window.innerHeight / 2 - (logoRect.top + logoRect.height / 2);
923924

924925
const cols = logoWrap.querySelectorAll('.modcon-hero-logo-col');
925926
const lastCol = logoWrap.querySelector('.modcon-hero-logo-col.cc-last');

0 commit comments

Comments
 (0)