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 @@