From 197d5d744261a993665ece116a45296d4fe06d22 Mon Sep 17 00:00:00 2001 From: saulteafarmer Date: Thu, 17 Apr 2025 14:11:11 +0000 Subject: [PATCH] Update index.html --- index.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 30cb0f5..c166eed 100644 --- a/index.html +++ b/index.html @@ -53,7 +53,7 @@

Bitcoin News Brief

- +
@@ -72,10 +72,8 @@
-
-

Signup for the latest Bitcoin news!

-
-
+

Signup for the latest Bitcoin news!

+
@@ -119,7 +117,10 @@ if (!newsReady || !showReady) return; const ul = document.getElementById('news-briefs'); ul.innerHTML = ''; - const maxH = document.getElementById('featured-show-container').offsetHeight; + // Conservative height: reduce featured height by 16px + const fsHeight = document.getElementById('featured-show-container').offsetHeight; + const marginBufferPx = 40; // conservative buffer + const maxH = fsHeight - marginBufferPx; ul.style.maxHeight = maxH + 'px'; for (const post of newsPosts) { const li = document.createElement('li'); li.className = 'flex items-center space-x-2'; @@ -135,7 +136,7 @@ a.target = '_blank'; a.className = 'text-blue-600 underline flex-1'; li.appendChild(a); ul.appendChild(li); - if (ul.scrollHeight > maxH) { ul.removeChild(li); ul.style.overflowY = 'auto'; break; } + if (ul.scrollHeight > maxH) { ul.removeChild(li); break; } } } @@ -168,7 +169,7 @@ fetch('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd').then(r => r.json()) ]).then(([fees, height, hrData, diffAdj, priceData]) => { const price = priceData.bitcoin?.usd ? `$${priceData.bitcoin.usd.toLocaleString()}` : 'N/A'; - const fee = fees.fastestFee ? `${fees.fastestFee} sat/vB` : 'N/A'; + const fee = fees.fastestFee ? `${fees.fastestFee} sat/vB` : 'N/A'; let difficulty = 'N/A'; if (hrData.currentDifficulty) { const exp = Math.floor(Math.log10(hrData.currentDifficulty)); @@ -191,6 +192,7 @@ } document.getElementById('network-stats').innerHTML = `${price} | ${fee} | ${height} | ${difficulty} | Next Difficulty: ${nextDate} | ${hashRate}`; }).catch(err => { console.error(err); document.getElementById('network-stats').innerText = 'Failed to load stats.'; }); +