Spaces:
Running
Running
BTCUSD
Browse filesWith visualisation
Files changed (6)
- README.md+8-5
- components/footer.jsAdded+81
- components/navbar.jsAdded+86
- index.html+161-19
- script.jsAdded+204
- style.css+47-18
12345678910---title: Cryptovision Trackeremoji: 👀colorFrom: greencolorTo: bluesdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference12345678910111213---title: CryptoVision Tracker 🚀colorFrom: purplecolorTo: greenemoji: 🐳sdk: staticpinned: falsetags:- deepsite-v3---# Welcome to your new DeepSite project!This project was created with [DeepSite](https://huggingface.co/deepsite).
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081class CustomFooter extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> footer { background: rgba(17, 24, 39, 0.8); backdrop-filter: blur(8px); color: rgba(255, 255, 255, 0.7); padding: 2rem; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 4rem; } .footer-content { max-width: 1200px; margin: 0 auto; } .footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1.5rem; } .footer-links a { color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: color 0.2s; } .footer-links a:hover { color: white; } .social-links { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; } .social-links a { color: rgba(255, 255, 255, 0.7); transition: color 0.2s; } .social-links a:hover { color: #3B82F6; } .copyright { font-size: 0.875rem; color: rgba(255, 255, 255, 0.5); } </style> <footer> <div class="footer-content"> <div class="footer-links"> <a href="#">About</a> <a href="#">API</a> <a href="#">Privacy</a> <a href="#">Terms</a> <a href="#">Contact</a> </div> <div class="social-links"> <a href="#"><i data-feather="twitter"></i></a> <a href="#"><i data-feather="github"></i></a> <a href="#"><i data-feather="linkedin"></i></a> <a href="#"><i data-feather="discord"></i></a> </div> <p class="copyright">© ${new Date().getFullYear()} CryptoVision Tracker. All data provided for informational purposes only.</p> </div> </footer> `; // Replace icons after shadow DOM is rendered setTimeout(() => { if (typeof feather !== 'undefined') { feather.replace(); } }, 100); }}
customElements.define('custom-footer', CustomFooter);1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586class CustomNavbar extends HTMLElement { connectedCallback() { this.attachShadow({ mode: 'open' }); this.shadowRoot.innerHTML = ` <style> nav { background: rgba(17, 24, 39, 0.8); backdrop-filter: blur(8px); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 50; border-bottom: 1px solid rgba(255, 255, 255, 0.1); } .logo { color: white; font-weight: bold; font-size: 1.5rem; display: flex; align-items: center; } .logo-icon { color: #3B82F6; margin-right: 0.5rem; } ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; } a { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: color 0.2s; font-weight: 500; display: flex; align-items: center; } a:hover { color: white; } .active { color: #3B82F6; } .icon { margin-right: 0.25rem; } @media (max-width: 768px) { nav { flex-direction: column; padding: 1rem; } ul { margin-top: 1rem; gap: 1rem; } } </style> <nav> <div class="logo"> <i data-feather="bitcoin" class="logo-icon"></i> <span>CryptoVision</span> </div> <ul> <li><a href="/" class="active"><i data-feather="home" class="icon"></i> Home</a></li> <li><a href="#"><i data-feather="pie-chart" class="icon"></i> Markets</a></li> <li><a href="#"><i data-feather="bell" class="icon"></i> Alerts</a></li> <li><a href="#"><i data-feather="user" class="icon"></i> Account</a></li> </ul> </nav> `; // Replace icons after shadow DOM is rendered setTimeout(() => { if (typeof feather !== 'undefined') { feather.replace(); } }, 100); }}
customElements.define('custom-navbar', CustomNavbar);12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>CryptoVision Tracker - BTC/USD</title><link rel="stylesheet" href="style.css"><script src="https://cdn.tailwindcss.com"></script><script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script><script src="https://unpkg.com/feather-icons"></script><script src="https://cdn.jsdelivr.net/npm/chart.js"></script><script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script></head><body class="bg-gray-900 text-white"><custom-navbar></custom-navbar><main class="container mx-auto px-4 py-8"><section class="mb-12"><h1 class="text-4xl font-bold mb-6 text-center">BTC/USD Live Tracker</h1><div class="grid grid-cols-1 lg:grid-cols-2 gap-8"><!-- Price Card --><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><div class="flex items-center justify-between mb-4"><h2 class="text-2xl font-semibold">Bitcoin Price</h2><span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-500 text-white"><i data-feather="activity" class="mr-1"></i> LIVE</span></div><div class="flex items-end mb-2"><span class="text-4xl font-bold" id="btc-price">$--</span><span class="ml-2 text-lg" id="price-change">(--%)</span></div><p class="text-gray-400">Updated: <span id="update-time">Just now</span></p></div><!-- Market Data Card --><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><h2 class="text-2xl font-semibold mb-4">Market Data</h2><div class="grid grid-cols-2 gap-4"><div><p class="text-gray-400">24h High</p><p class="text-xl font-medium" id="high-24h">$--</p></div><div><p class="text-gray-400">24h Low</p><p class="text-xl font-medium" id="low-24h">$--</p></div><div><p class="text-gray-400">24h Volume</p><p class="text-xl font-medium" id="volume-24h">-- BTC</p></div><div><p class="text-gray-400">Market Cap</p><p class="text-xl font-medium" id="market-cap">$--</p></div></div></div></div></section><!-- Chart Section --><section class="mb-12"><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><div class="flex justify-between items-center mb-6"><h2 class="text-2xl font-semibold">Price Chart (24h)</h2><div class="flex space-x-2"><button class="px-3 py-1 rounded-lg bg-gray-700 text-sm" id="1h-btn">1H</button><button class="px-3 py-1 rounded-lg bg-gray-700 text-sm" id="24h-btn">24H</button><button class="px-3 py-1 rounded-lg bg-gray-700 text-sm" id="7d-btn">7D</button><button class="px-3 py-1 rounded-lg bg-blue-500 text-white text-sm" id="30d-btn">30D</button></div></div><div class="h-96"><canvas id="price-chart"></canvas></div></div></section><!-- Additional Data --><section class="mb-12"><h2 class="text-2xl font-semibold mb-6">Bitcoin Insights</h2><div class="grid grid-cols-1 md:grid-cols-3 gap-6"><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><div class="flex items-center mb-4"><div class="p-3 rounded-full bg-blue-500/20 mr-4"><i data-feather="trending-up" class="text-blue-500"></i></div><h3 class="text-xl font-semibold">Market Sentiment</h3></div><p class="text-gray-400">Current sentiment is <span class="text-blue-400 font-medium" id="sentiment">loading...</span></p></div><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><div class="flex items-center mb-4"><div class="p-3 rounded-full bg-purple-500/20 mr-4"><i data-feather="hash" class="text-purple-500"></i></div><h3 class="text-xl font-semibold">Blockchain Stats</h3></div><p class="text-gray-400">Hash Rate: <span class="font-medium" id="hash-rate">--</span></p><p class="text-gray-400">Difficulty: <span class="font-medium" id="difficulty">--</span></p></div><div class="bg-gray-800 rounded-xl p-6 shadow-lg"><div class="flex items-center mb-4"><div class="p-3 rounded-full bg-green-500/20 mr-4"><i data-feather="dollar-sign" class="text-green-500"></i></div><h3 class="text-xl font-semibold">Exchange Data</h3></div><p class="text-gray-400">Dominance: <span class="font-medium" id="dominance">--%</span></p><p class="text-gray-400">Supply: <span class="font-medium" id="supply">-- BTC</span></p></div></div></section><!-- News Section --><section><h2 class="text-2xl font-semibold mb-6">Latest Bitcoin News</h2><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="news-container"><!-- News items will be loaded here --><div class="animate-pulse bg-gray-800 rounded-xl p-6 shadow-lg h-48"></div><div class="animate-pulse bg-gray-800 rounded-xl p-6 shadow-lg h-48"></div><div class="animate-pulse bg-gray-800 rounded-xl p-6 shadow-lg h-48"></div></div></section></main><custom-footer></custom-footer><!-- Background Animation --><div id="vanta-bg" class="fixed top-0 left-0 w-full h-full -z-10"></div><!-- Scripts --><script src="components/navbar.js"></script><script src="components/footer.js"></script><script src="script.js"></script><script>feather.replace();// Initialize Vanta.js backgroundVANTA.NET({el: "#vanta-bg",mouseControls: true,touchControls: true,gyroControls: false,minHeight: 200.00,minWidth: 200.00,scale: 1.00,scaleMobile: 1.00,color: 0x3b82f6,backgroundColor: 0x111827,points: 10.00,maxDistance: 25.00,spacing: 17.00});</script><script src="https://huggingface.co/deepsite/deepsite-badge.js"></script></body></html>
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204// Main application scriptdocument.addEventListener('DOMContentLoaded', function() { // Initialize Chart const ctx = document.getElementById('price-chart').getContext('2d'); let priceChart = new Chart(ctx, { type: 'line', data: { labels: [], datasets: [{ label: 'BTC/USD', data: [], borderColor: '#3B82F6', backgroundColor: 'rgba(59, 130, 246, 0.1)', borderWidth: 2, tension: 0.4, pointRadius: 0, fill: true }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false }, tooltip: { mode: 'index', intersect: false, } }, scales: { x: { grid: { display: false, drawBorder: false }, ticks: { color: '#9CA3AF' } }, y: { grid: { color: 'rgba(156, 163, 175, 0.1)', drawBorder: false }, ticks: { color: '#9CA3AF' } } }, interaction: { mode: 'nearest', axis: 'x', intersect: false } } });
// Simulate fetching price data function fetchPriceData() { // In a real app, this would be an API call to CoinGecko or similar console.log('Fetching price data...'); // Simulate API delay setTimeout(() => { // Generate mock data for the chart const now = new Date(); const labels = []; const data = []; for (let i = 29; i >= 0; i--) { const date = new Date(now); date.setDate(date.getDate() - i); labels.push(date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' })); // Generate random price with some volatility const basePrice = 40000 + Math.random() * 20000; const dailyFluctuation = Math.sin(i * 0.5) * 2000; const randomNoise = (Math.random() - 0.5) * 1000; data.push(basePrice + dailyFluctuation + randomNoise); } // Update chart priceChart.data.labels = labels; priceChart.data.datasets[0].data = data; priceChart.update(); // Update current price display const currentPrice = data[data.length - 1]; const prevPrice = data[data.length - 2]; const priceChange = ((currentPrice - prevPrice) / prevPrice) * 100; document.getElementById('btc-price').textContent = `$${currentPrice.toLocaleString('en-US', {maximumFractionDigits: 2})}`; const changeElement = document.getElementById('price-change'); if (priceChange >= 0) { changeElement.textContent = `(+${priceChange.toFixed(2)}%)`; changeElement.className = 'ml-2 text-lg text-green-400'; document.getElementById('btc-price').classList.add('price-up'); setTimeout(() => document.getElementById('btc-price').classList.remove('price-up'), 1000); } else { changeElement.textContent = `(${priceChange.toFixed(2)}%)`; changeElement.className = 'ml-2 text-lg text-red-400'; document.getElementById('btc-price').classList.add('price-down'); setTimeout(() => document.getElementById('btc-price').classList.remove('price-down'), 1000); } // Update market data document.getElementById('high-24h').textContent = `$${(currentPrice + 500 + Math.random() * 1000).toLocaleString('en-US', {maximumFractionDigits: 2})}`; document.getElementById('low-24h').textContent = `$${(currentPrice - 500 - Math.random() * 1000).toLocaleString('en-US', {maximumFractionDigits: 2})}`; document.getElementById('volume-24h').textContent = `${(20000 + Math.random() * 30000).toLocaleString('en-US', {maximumFractionDigits: 0})} BTC`; document.getElementById('market-cap').textContent = `$${(currentPrice * 19400000).toLocaleString('en-US', {maximumFractionDigits: 0})}`; document.getElementById('update-time').textContent = new Date().toLocaleTimeString(); // Update sentiment const sentiments = ['Bullish', 'Bearish', 'Neutral']; const randomSentiment = sentiments[Math.floor(Math.random() * sentiments.length)]; document.getElementById('sentiment').textContent = randomSentiment; // Update blockchain stats document.getElementById('hash-rate').textContent = `${(100 + Math.random() * 50).toFixed(2)} EH/s`; document.getElementById('difficulty').textContent = `${(20 + Math.random() * 10).toFixed(2)} T`; document.getElementById('dominance').textContent = `${(40 + Math.random() * 10).toFixed(1)}%`; document.getElementById('supply').textContent = `${(19400000 + Math.random() * 1000).toLocaleString('en-US', {maximumFractionDigits: 0})}`; }, 1000); } // Fetch news articles function fetchNews() { // In a real app, this would be an API call to CryptoPanic or similar console.log('Fetching news...'); setTimeout(() => { const newsContainer = document.getElementById('news-container'); newsContainer.innerHTML = ''; const mockNews = [ { title: 'Bitcoin Adoption Grows as Major Retailer Announces Support', source: 'CryptoNews', summary: 'A leading global retailer has announced plans to accept Bitcoin payments, signaling growing mainstream adoption.', image: 'http://static.photos/technology/640x360/1' }, { title: 'Institutional Investors Increasing Bitcoin Holdings', source: 'CoinDesk', summary: 'New data shows institutional investors are accumulating Bitcoin at record levels, despite market volatility.', image: 'http://static.photos/finance/640x360/2' }, { title: 'Bitcoin Network Difficulty Reaches All-Time High', source: 'BTC Times', summary: 'The Bitcoin network difficulty adjustment has reached a new record high, indicating strong miner participation.', image: 'http://static.photos/science/640x360/3' } ]; mockNews.forEach(news => { const newsCard = document.createElement('div'); newsCard.className = 'news-card bg-gray-800 rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-200'; newsCard.innerHTML = ` <img src="${news.image}" alt="${news.title}" class="w-full h-32 object-cover"> <div class="p-6"> <h3 class="text-xl font-semibold mb-2">${news.title}</h3> <p class="text-gray-400 text-sm mb-3">Source: ${news.source}</p> <p class="text-gray-300">${news.summary}</p> </div> `; newsContainer.appendChild(newsCard); }); }, 1500); } // Time period buttons functionality document.getElementById('1h-btn').addEventListener('click', function() { // In a real app, this would fetch 1h data alert('Switching to 1-hour view (simulated)'); }); document.getElementById('24h-btn').addEventListener('click', function() { // In a real app, this would fetch 24h data alert('Switching to 24-hour view (simulated)'); }); document.getElementById('7d-btn').addEventListener('click', function() { // In a real app, this would fetch 7d data alert('Switching to 7-day view (simulated)'); }); document.getElementById('30d-btn').addEventListener('click', function() { // In a real app, this would fetch 30d data alert('Switching to 30-day view (simulated)'); }); // Initial data fetch fetchPriceData(); fetchNews(); // Set up periodic refresh (every 30 seconds in this demo) setInterval(fetchPriceData, 30000); setInterval(fetchNews, 300000);});12345678910111213141516171819202122232425262728body {padding: 2rem;font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;}h1 {font-size: 16px;margin-top: 0;}p {color: rgb(107, 114, 128);font-size: 15px;margin-bottom: 10px;margin-top: 5px;}.card {max-width: 620px;margin: 0 auto;padding: 16px;border: 1px solid lightgray;border-radius: 16px;}.card p:last-child {margin-bottom: 0;}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657/* Custom styles */@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');body {font-family: 'Inter', sans-serif;min-height: 100vh;}#vanta-bg {opacity: 0.3;}/* Chart tooltip customization */.chartjs-tooltip {background-color: rgba(31, 41, 55, 0.9) !important;border-radius: 0.5rem !important;padding: 0.5rem 1rem !important;box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;}.chartjs-tooltip-key {display: inline-block;width: 10px;height: 10px;margin-right: 5px;}/* Animation for price changes */@keyframes pulseGreen {0% { background-color: rgba(16, 185, 129, 0); }50% { background-color: rgba(16, 185, 129, 0.2); }100% { background-color: rgba(16, 185, 129, 0); }}@keyframes pulseRed {0% { background-color: rgba(239, 68, 68, 0); }50% { background-color: rgba(239, 68, 68, 0.2); }100% { background-color: rgba(239, 68, 68, 0); }}.price-up {animation: pulseGreen 1s ease-in-out;}.price-down {animation: pulseRed 1s ease-in-out;}/* News card hover effect */.news-card {transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;}.news-card:hover {transform: translateY(-4px);box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);}
README.md+8-5
components/footer.jsAdded+81
components/navbar.jsAdded+86
index.html+161-19
script.jsAdded+204
style.css+47-18