From c2f9cde371327e2eadc71d7c260ddab7206088a0 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 25 Dec 2024 18:43:08 +0100 Subject: [PATCH] ui fixes --- src/lib/components/Infobox.svelte | 38 +- .../stocks/[tickerID]/metrics/+layout.svelte | 53 ++- .../stocks/[tickerID]/metrics/+page.svelte | 108 +++-- .../[tickerID]/metrics/[slug]/+page.svelte | 27 +- .../stocks/[tickerID]/statistics/+page.svelte | 446 ++++++++++++------ .../statistics/employees/+layout.svelte | 2 +- .../statistics/employees/+page.svelte | 95 ++-- .../statistics/market-cap/+layout.svelte | 2 +- .../statistics/market-cap/+page.svelte | 49 +- tailwind.config.cjs | 1 + 10 files changed, 486 insertions(+), 335 deletions(-) diff --git a/src/lib/components/Infobox.svelte b/src/lib/components/Infobox.svelte index c12f6a03..3199f7e1 100644 --- a/src/lib/components/Infobox.svelte +++ b/src/lib/components/Infobox.svelte @@ -1,27 +1,27 @@
- -
-
-
- {@html text} + +
+
+
+ {@html text} +
-
\ No newline at end of file diff --git a/src/routes/stocks/[tickerID]/metrics/+layout.svelte b/src/routes/stocks/[tickerID]/metrics/+layout.svelte index e956ef6c..6f3a5def 100644 --- a/src/routes/stocks/[tickerID]/metrics/+layout.svelte +++ b/src/routes/stocks/[tickerID]/metrics/+layout.svelte @@ -1,5 +1,5 @@ @@ -443,12 +449,11 @@ const htmlOutput = generateEmployeeInfoHTML(); {$stockTicker} Employees - - +
Employees @@ -515,7 +520,11 @@ const htmlOutput = generateEmployeeInfoHTML();
- {abbreviateNumber(data?.getStockQuote?.marketCap)} + {@html abbreviateNumber( + data?.getStockQuote?.marketCap, + false, + true, + )}
@@ -527,9 +536,7 @@ const htmlOutput = generateEmployeeInfoHTML(); Employees Chart {#if historyList?.length > 0} -
+
@@ -623,25 +630,25 @@ const htmlOutput = generateEmployeeInfoHTML(); - + @@ -649,9 +656,9 @@ const htmlOutput = generateEmployeeInfoHTML(); {#each historyList as item, index} - +
Date Employees Change Growth
{new Date(item?.filingDate)?.toLocaleString("en-US", { month: "short", @@ -661,12 +668,12 @@ const htmlOutput = generateEmployeeInfoHTML(); })} {new Intl.NumberFormat("en").format(item?.employeeCount)} {#if Number(item?.employeeCount - historyList[index + 1]?.employeeCount)} {new Intl.NumberFormat("en")?.format( @@ -678,7 +685,7 @@ const htmlOutput = generateEmployeeInfoHTML(); {/if} {#if index + 1 - historyList?.length === 0} n/a diff --git a/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte b/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte index 569efab7..869267f2 100644 --- a/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte +++ b/src/routes/stocks/[tickerID]/statistics/market-cap/+layout.svelte @@ -105,7 +105,7 @@ {#if similarStocks?.length > 0}

Related Stocks

diff --git a/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte b/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte index 685f7849..1c7476fb 100644 --- a/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte +++ b/src/routes/stocks/[tickerID]/statistics/market-cap/+page.svelte @@ -301,7 +301,6 @@ name: "Mkt Cap", data: filteredData?.marketCapList, type: "line", - areaStyle: { opacity: 0.2 }, smooth: true, symbol: "none", itemStyle: { @@ -416,27 +415,27 @@ {#if rawData?.length !== 0}
- - 0 - ? "increased" - : changePercentageYearAgo < 0 - ? "decreased" - : "unchanged"} by ${abbreviateNumber( + })}. Its market cap has ${ + changePercentageYearAgo > 0 + ? "increased" + : changePercentageYearAgo < 0 + ? "decreased" + : "unchanged" + } by ${abbreviateNumber( changePercentageYearAgo?.toFixed(2), - )}% in one year.`} - /> - - + )}% in one year.`} + />
@@ -446,7 +445,11 @@
- {abbreviateNumber(data?.getStockQuote?.marketCap)} + {@html abbreviateNumber( + data?.getStockQuote?.marketCap, + false, + true, + )}
@@ -660,10 +663,10 @@
- - + + @@ -679,22 +682,22 @@ {#each tableList as item, index}
Date
{item?.date} {abbreviateNumber(item?.marketCap)} {#if index + 1 - tableList?.length === 0} - @@ -740,7 +743,7 @@