Fix 300 million and 5

This commit is contained in:
Reece 2025-07-03 22:45:55 +01:00
parent 583b7e84c8
commit 9f26456faa
2 changed files with 5 additions and 2 deletions

View File

@ -77,6 +77,8 @@
navbar.classList.remove('navbar-expand-lg'); navbar.classList.remove('navbar-expand-lg');
} }
navbar.style.overflowX = 'hidden';
console.log('DPR:', currentDPR, 'isHighDPI:', isHighDPI, 'baseScale:', baseScale, 'navScale:', navScale, 'effective width:', effectiveWidth); console.log('DPR:', currentDPR, 'isHighDPI:', isHighDPI, 'baseScale:', baseScale, 'navScale:', navScale, 'effective width:', effectiveWidth);
} }
@ -94,6 +96,7 @@
let lastDPR = window.devicePixelRatio; let lastDPR = window.devicePixelRatio;
document.addEventListener('DOMContentLoaded', scaleNav); document.addEventListener('DOMContentLoaded', scaleNav);
window.addEventListener('resize', scaleNav);
setInterval(() => { setInterval(() => {
const currentDPR = window.devicePixelRatio; const currentDPR = window.devicePixelRatio;

View File

@ -9,7 +9,7 @@
<body> <body>
<div class="page-container" style="max-height:100vh;"> <div class="page-container" style="max-height:100vh;">
<th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block> <th:block th:insert="~{fragments/navbar.html :: navbar}"></th:block>
<div style="transform-origin: center top; flex:0 1 auto; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; " id="scale-wrap"> <div style="transform-origin: center top; flex:0 1 auto; display:flex; flex-direction:column; align-items:center; justify-content:flex-start;" id="scale-wrap">
<br class="d-md-none"> <br class="d-md-none">
<!-- Features --> <!-- Features -->
<script th:src="@{'/js/homecard.js'}"></script> <script th:src="@{'/js/homecard.js'}"></script>
@ -237,7 +237,7 @@
const tallScreenBonus = Math.max(0, (1.8 - aspectRatio) * 0.15); // More bonus for taller screens const tallScreenBonus = Math.max(0, (1.8 - aspectRatio) * 0.15); // More bonus for taller screens
let finalS = Math.min(s * 0.75, (space * (0.98 + tallScreenBonus)) / origH); let finalS = Math.min(s * 0.75, (space * (0.98 + tallScreenBonus)) / origH);
finalS = Math.max(0.7, finalS); finalS = Math.max(0.7, Math.min(1.0, finalS)); // Never scale above 100%
el.style.transform = `scale(${finalS})`; el.style.transform = `scale(${finalS})`;
el.style.transformOrigin = 'top center'; el.style.transformOrigin = 'top center';