From 41b4fd652f0740402db67bed878d4e62b4830ea2 Mon Sep 17 00:00:00 2001 From: Logen <79722764+btcforplebs@users.noreply.github.com> Date: Fri, 21 Mar 2025 03:54:35 -0400 Subject: [PATCH] cleanup --- public/assets/css/main.css | 2 ++ public/assets/js/scripts.js | 40 ------------------------------------- public/index.html | 14 ++++++------- public/sitemap.xml | 8 ++++---- 4 files changed, 13 insertions(+), 51 deletions(-) diff --git a/public/assets/css/main.css b/public/assets/css/main.css index a859e26..b843e02 100644 --- a/public/assets/css/main.css +++ b/public/assets/css/main.css @@ -53,6 +53,7 @@ body { margin: auto; padding: 10px; + padding-top: 10px; box-sizing: border-box; text-align: center; background: var(--container-background); @@ -64,6 +65,7 @@ body { @media (max-width: 768px) { .container { max-width: 96%; /* Full width for mobile */ + padding-top: 10px; } } diff --git a/public/assets/js/scripts.js b/public/assets/js/scripts.js index fd5ca28..7b82de9 100644 --- a/public/assets/js/scripts.js +++ b/public/assets/js/scripts.js @@ -1,43 +1,3 @@ -// Fetch Bitcoin Price, Percentage Change, and Block Time -async function fetchBitcoinData() { - try { - // Fetch Bitcoin price and percentage change from CoinDesk API - const priceResponse = await fetch('https://api.coindesk.com/v1/bpi/currentprice.json'); - if (!priceResponse.ok) { - throw new Error('Failed to fetch Bitcoin price'); - } - const priceData = await priceResponse.json(); - - const price = parseFloat(priceData.bpi.USD.rate.replace(',', '')); // Remove commas - const percentageChange = Math.random() * 4 - 2; // Mock % change as CoinDesk doesn't provide it - const updatedAt = new Date(priceData.time.updatedISO).toLocaleString(); - - // Fetch block height (Mocked API) - const blockResponse = await fetch('https://mempool.space/api/blocks/tip/height'); - if (!blockResponse.ok) { - throw new Error('Failed to fetch block height'); - } - const blockHeight = await blockResponse.json(); - - // Update the banner - const banner = document.getElementById('btc-price-banner'); - banner.innerHTML = ` - $${price.toFixed(2)} - - ${percentageChange >= 0 ? '⬆' : '⬇'} ${percentageChange.toFixed(2)}% - - | Block #${blockHeight} - `; - } catch (error) { - console.error('Error fetching Bitcoin data:', error); - document.getElementById('btc-price-banner').textContent = 'Unable to fetch Bitcoin data.'; - } -} - -// Refresh Bitcoin data every 60 seconds -fetchBitcoinData(); -setInterval(fetchBitcoinData, 60000); - // Folder Toggle Function function toggleFolder(folderId, buttonId) { const folder = document.getElementById(folderId); diff --git a/public/index.html b/public/index.html index 43abbc6..ee9d9f2 100644 --- a/public/index.html +++ b/public/index.html @@ -3,8 +3,8 @@ BTCforPlebs - - + + @@ -18,14 +18,14 @@ + + + + - - - -
Bitcoin price loading...

Welcome to BTCforPlebs

@@ -57,7 +57,7 @@ diff --git a/public/sitemap.xml b/public/sitemap.xml index a4b4a94..9ccf98d 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -7,25 +7,25 @@ 1.0 - https://btcforplebs.com/learn-bitcoin.html + https://btcforplebs.com/learn-bitcoin 2024-11-19 weekly 0.8 - https://btcforplebs.com/learn-bitcoin/nodes.html + https://btcforplebs.com/learn-bitcoin/nodes 2024-11-19 weekly 0.8 - https://btcforplebs.com/learn-nostr.html + https://btcforplebs.com/learn-nostr 2024-11-19 weekly 0.8 - https://btcforplebs.com/learn-bitcoin/wallets.html + https://btcforplebs.com/learn-bitcoin/wallets 2024-11-19 weekly 0.8