From d4d2927963d1bc2bd1510cdcf02ed69d5da07566 Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Mon, 6 Apr 2026 00:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=B0=E5=9B=BE=E6=94=BE?= =?UTF-8?q?=E5=A4=A7=E4=B9=8B=E5=90=8E=E6=B6=88=E5=A4=B1=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/style.css | 6 +++++- public/js/app.js | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 6f33339..f9fde44 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1997,6 +1997,8 @@ input:checked+.slider:before { backdrop-filter: blur(15px); animation: globeExpand 0.4s cubic-bezier(0.16, 1, 0.3, 1); margin: 0 !important; + display: flex !important; /* Force flex for proper internal layout */ + flex-direction: column; } @keyframes globeExpand { @@ -2011,7 +2013,9 @@ input:checked+.slider:before { } .globe-card.expanded .globe-body { - height: calc(100% - 130px) !important; + flex: 1; /* Allow map to fill all remaining space */ + height: auto !important; /* Override fixed height in expanded state */ + min-height: 0; } .chart-header-actions { diff --git a/public/js/app.js b/public/js/app.js index 3414e1b..a3f3421 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -185,10 +185,11 @@ dom.globeCard.classList.toggle('expanded'); dom.btnExpandGlobe.classList.toggle('active'); if (myMap2D) { - // Multiple resizes to handle animation frames - setTimeout(() => myMap2D.resize(), 50); - setTimeout(() => myMap2D.resize(), 150); - setTimeout(() => myMap2D.resize(), 400); + // Multiple resizes to handle animation phases and final layout + myMap2D.resize(); + setTimeout(() => myMap2D.resize(), 100); + setTimeout(() => myMap2D.resize(), 300); + setTimeout(() => myMap2D.resize(), 600); // Final resize after animation } }); } @@ -662,21 +663,30 @@ // Add latency routes if configured if (currentLatencies && currentLatencies.length > 0) { const countryCoords = { - 'China': [116.4074, 39.9042], - 'United States': [-95.7129, 37.0902], - 'Japan': [138.2529, 36.2048], - 'Singapore': [103.8198, 1.3521], - 'Germany': [10.4515, 51.1657], - 'United Kingdom': [-3.436, 55.3781], - 'France': [2.2137, 46.2276], - 'Hong Kong': [114.1694, 22.3193], - 'Taiwan': [120.9605, 23.6978], - 'Korea': [127.7669, 35.9078] + 'china': [116.4074, 39.9042], + 'united states': [-95.7129, 37.0902], + 'us seattle': [-122.3321, 47.6062], + 'seattle': [-122.3321, 47.6062], + 'japan': [138.2529, 36.2048], + 'singapore': [103.8198, 1.3521], + 'germany': [10.4515, 51.1657], + 'united kingdom': [-3.436, 55.3781], + 'france': [2.2137, 46.2276], + 'hong kong': [114.1694, 22.3193], + 'taiwan': [120.9605, 23.6978], + 'south korea': [127.7669, 35.9078], + 'korea': [127.7669, 35.9078] }; const getCoords = (name) => { - if (countryCoords[name]) return countryCoords[name]; - const s = servers.find(sv => sv.countryName === name || sv.country === name); + const lowerName = (name || '').toLowerCase().trim(); + if (countryCoords[lowerName]) return countryCoords[lowerName]; + + const s = servers.find(sv => + (sv.countryName || '').toLowerCase() === lowerName || + (sv.country || '').toLowerCase() === lowerName || + (sv.city || '').toLowerCase() === lowerName + ); if (s && s.lng && s.lat) return [s.lng, s.lat]; return null; };