From 666a789a1c8f7ea0d3a3f309386f008f9e1c6919 Mon Sep 17 00:00:00 2001 From: totaro <66010583+totaro@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:05:21 +0300 Subject: [PATCH] scroll ticker js json --- js/stock.js | 16 +++++++++++++ js/stocks.json | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 js/stock.js create mode 100644 js/stocks.json diff --git a/js/stock.js b/js/stock.js new file mode 100644 index 0000000..b8caf15 --- /dev/null +++ b/js/stock.js @@ -0,0 +1,16 @@ +import stocks from "/js/stocks.json" assert { type: "json" }; + +let stock = ""; + +document.getElementById("stockdata").innerHTML = stock; \ No newline at end of file diff --git a/js/stocks.json b/js/stocks.json new file mode 100644 index 0000000..4d80295 --- /dev/null +++ b/js/stocks.json @@ -0,0 +1,62 @@ +[ + { + "id": 0, + "label": "minus", + "company": "AAPL", + "price": "$169.38", + "change": "-3.31 (-1.917%)" + }, + { + "id": 1, + "label": "plus", + "company": "MSFT", + "price": "$414.58", + "change": "+0.94 (+0.227%)" + }, + + { + "id": 2, + "label": "plus", + "company": "NVDA", + "price": "$874.15", + "change": "+14.14 (+1.644%)" + }, +{ + "id": 3, + "label": "minus", + "company": "GOOG", + "price": "$156.00", + "change": "-0.33 (-0.211%)" + }, +{ + "id": 4, + "label": "minus", + "company": "AMZN", + "price": "$183.32", + "change": "-0.30 (-0.163%)" + },{ + "id": 5, + "label": "plus", + "company": "AVGO", + "price": "$1,329.06", + "change": "+18.37 (+1.402%)" + },{ + "id": 6, + "label": "minus", + "company": "META", + "price": "$499.76", + "change": "-0.47 (-0.094%)" + },{ + "id": 7, + "label": "plus", + "company": "MA", + "price": "$459.82", + "change": "+0.03 (+0.007%)" + },{ + "id": 8, + "label": "minus", + "company": "TSLA", + "price": "$157.11", + "change": "-4.37 (-2.706%)" + } +] \ No newline at end of file