Tweak 476

This commit is contained in:
Reece 2025-07-03 21:48:41 +01:00
parent 7a8eeb59e3
commit 583b7e84c8
2 changed files with 8 additions and 10 deletions

View File

@ -36,11 +36,10 @@
// Counter-scale to maintain same visual size // Counter-scale to maintain same visual size
const isMobile = window.innerWidth <= 768 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); const isMobile = window.innerWidth <= 768 || /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
let baseScale = isMobile ? 3 : 1.1; let baseScale = isMobile ? 3 : (isHighDPI ? 2.2 : 1.1); // Prioritize mobile scaling over high DPI
if (isHighDPI) baseScale *= 2; // Double base size on high DPI screens (determined at page load)
const navScale = baseScale / currentDPR; const navScale = baseScale / currentDPR;
// Dropdowns at 100% (no additional scaling) // Dropdowns at 80% (20% smaller)
const dropdownScale = 1.0; const dropdownScale = 0.8;
const navbar = document.querySelector('.navbar'); const navbar = document.querySelector('.navbar');
@ -84,12 +83,11 @@
setTimeout(() => { setTimeout(() => {
const dropdowns = document.querySelectorAll('.dropdown-menu'); const dropdowns = document.querySelectorAll('.dropdown-menu');
dropdowns.forEach(dropdown => { dropdowns.forEach(dropdown => {
// Scale content, not container dropdown.style.transform = `scale(${dropdownScale})`;
dropdown.style.fontSize = `${dropdownScale}em`; dropdown.style.transformOrigin = 'top left';
// Reset any container scaling
dropdown.style.transform = '';
}); });
console.log('Applied dropdown content scale:', dropdownScale);
console.log('Applied dropdown scale:', dropdownScale);
}, 100); }, 100);
} }

View File

@ -247,7 +247,7 @@
const featuresContainer = document.querySelector('.features-container'); const featuresContainer = document.querySelector('.features-container');
if (featuresContainer) { if (featuresContainer) {
const isRTL = document.documentElement.dir === 'rtl' || document.documentElement.getAttribute('dir') === 'rtl'; const isRTL = document.documentElement.dir === 'rtl' || document.documentElement.getAttribute('dir') === 'rtl';
const dynamicWidth = Math.min(140, 100 / finalS); const dynamicWidth = Math.min(120, 100 / finalS);
const offset = (dynamicWidth - 100) / 2; const offset = (dynamicWidth - 100) / 2;
featuresContainer.style.width = `${dynamicWidth}%`; featuresContainer.style.width = `${dynamicWidth}%`;