- लाइव स्टॉक
📈 - लाइव स्टॉक मार्केट
AAPL $226.84 +1.23 (+0.54%)
TSLA $248.12 -2.45 (-0.98%)
GOOGL $168.95 +3.12 (+1.88%)
RELIANCE ₹2,456.75 +18.50 (+0.76%)
TCS ₹4,128.90 -12.30 (-0.30%)
${stock.symbol}
${stock.name}
${isPositive ? '+' : ''}${stock.change} (${isPositive ? '+' : ''}${stock.percent}%)
₹${stock.price.toLocaleString('en-IN')}
`;
document.getElementById('dashboard').appendChild(card);
// सिंपल लाइन चार्ट (Canvas)
setTimeout(() => {
const canvas = document.getElementById(`chart-${stock.symbol}`);
if (!canvas) return;
const ctx = canvas.getContext('2d');
ctx.strokeStyle = stock.color;
ctx.lineWidth = 3;
ctx.beginPath();
ctx.moveTo(0, 80);
ctx.quadraticCurveTo(75, 40, 150, 90);
ctx.quadraticCurveTo(225, 60, 300, 70);
ctx.stroke();
// छोटे डॉट्स
ctx.fillStyle = stock.color;
ctx.fillRect(50, 65, 4, 4);
ctx.fillRect(200, 75, 4, 4);
}, 100);
}
// सभी स्टॉक कार्ड्स बनाएं
stocks.forEach(stock => createStockCard(stock));
// लाइव अपडेट सिमुलेशन (हर 5 सेकंड में प्राइस चेंज)
setInterval(() => {
const cards = document.querySelectorAll('.card');
cards.forEach((card, index) => {
const priceEl = card.querySelector('.price');
let currentPrice = parseFloat(priceEl.textContent.replace(/[^0-9.]/g, ''));
const randomChange = (Math.random() * 2 - 0.8).toFixed(2);
currentPrice = (currentPrice + parseFloat(randomChange)).toFixed(2);
priceEl.textContent = `₹${parseFloat(currentPrice).toLocaleString('en-IN')}`;
});
}, 5000);
// टिकर को डुप्लिकेट करें ताकि स्मूथ स्क्रॉल हो
const tickerContent = document.getElementById('tickerContent');
tickerContent.innerHTML += tickerContent.innerHTML; // डुप्लिकेट
</script>
</!doctype>
0 $type={blogger}:
Post a Comment