From f0c3f4c5dd4f35f5bee137b0f0ca9ea481f07291 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 24 Oct 2024 18:50:56 +0200 Subject: [PATCH] ui fixes --- src/lib/components/TickerInfoCard.svelte | 399 ++++++---- src/routes/dividends-calendar/+page.svelte | 886 ++++++++++++--------- src/routes/ipos/+layout.svelte | 475 +++++------ src/routes/ipos/[slug]/+page.svelte | 386 ++++----- 4 files changed, 1219 insertions(+), 927 deletions(-) diff --git a/src/lib/components/TickerInfoCard.svelte b/src/lib/components/TickerInfoCard.svelte index ca5e4ac9..a7b08407 100644 --- a/src/lib/components/TickerInfoCard.svelte +++ b/src/lib/components/TickerInfoCard.svelte @@ -1,9 +1,9 @@ -
-
- - -
- -
- {#if earningDate} -
- Earnings Call - {earningDate} -
- {/if} +
+
+ +
+
+ {#if earningDate} +
+ Earnings Call - {earningDate}
- -
- - -
-

Company Info

-
- - - + +
+

+ Company Info +

+
+
+ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Bid{$wsBidPrice !== 0 && $wsBidPrice !== null ? $wsBidPrice : (data?.getStockQuote?.bid ?? '-')}Ask{$wsAskPrice !== 0 && $wsAskPrice !== null ? $wsAskPrice : (data?.getStockQuote?.ask ?? '-')}
Mkt Cap{abbreviateNumber(data?.getStockQuote?.marketCap)}Vol{abbreviateNumber(data?.getStockQuote?.volume)}
Beta{beta}Avg. Vol{abbreviateNumber(data?.getStockQuote?.avgVolume)}
Open{data?.getStockQuote?.open?.toFixed(2)}Prev. Close{data?.getStockQuote?.previousClose?.toFixed(2) ?? '-'}
EPS (ttm){data?.getStockQuote?.eps}PE Ratio (ttm){data?.getStockQuote?.pe}
Shares Out.{abbreviateNumber(data?.getStockQuote?.sharesOutstanding)}Forward PE{(forwardPE === undefined || forwardPE === null)? '-' : forwardPE}
-
+ + EPS (ttm) + {data?.getStockQuote?.eps} + PE Ratio (ttm) + {data?.getStockQuote?.pe} + + + Shares Out. + {abbreviateNumber(data?.getStockQuote?.sharesOutstanding)} + Forward PE + {forwardPE === undefined || forwardPE === null + ? "-" + : forwardPE} + + + +
-

- Description -

+

+ Description +

- -

- {#if showFullText} +

+ {#if showFullText}

{description}
- {:else if $screenWidth <= 800} - {description} - {:else} + {:else if $screenWidth <= 800} + {description} + {:else} {snippet} - {/if} -

- {#if description.length !== 0 } + {/if} +

+ {#if description.length !== 0}
-
- - {/if} - - - - + {/if}
+
-
- - - - - - - \ No newline at end of file diff --git a/src/routes/dividends-calendar/+page.svelte b/src/routes/dividends-calendar/+page.svelte index b962e818..6d00b7c7 100644 --- a/src/routes/dividends-calendar/+page.svelte +++ b/src/routes/dividends-calendar/+page.svelte @@ -1,11 +1,16 @@ - - - + + + + + {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} Dividends + Calendar · stocknear + + - - - - {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Dividends Calendar · stocknear - - - - - - - - - - - - - - + + + + + + + + + + - - - -
- - - - -
- -
-
- - -
- -
-
+
+ - - -
-
-

- Dividends Calendar -

+
+
+
+
+
+
+ +
+
+

+ Dividends Calendar +

+
+ +
- - - - -
- - - - - - - - -
- +
- - - - - -
- - - -
+ +
+ +
-
- - - {#each weekday as day,index} +
+ + {#each weekday as day, index} {#if index === selectedWeekday} {#if day?.length !== 0} -
- +
+
- - - - - - - - + + + + + + + + {#each day as item, index} - - goto("/stocks/"+item?.symbol)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#27272A] border-b-[#09090B] cursor-pointer"> - - - - - - - + - - - - - - + + + + + + {/each} -
SymbolCompany NameMarket CapRevenueEx. Dividend DateCash AmountPayment Date
SymbolCompany NameMarket CapRevenueEx. Dividend DateCash AmountPayment Date
- {item?.symbol} - - {item?.name.length > 20 ? item?.name.slice(0,20) + "..." : item?.name} - - {item?.marketCap !== null ? abbreviateNumber(item?.marketCap,true) : '-'} + +
+ {item?.symbol} + - {item?.revenue !== null ? abbreviateNumber(item?.revenue,true) : '-'} - - {item?.date !== null ? new Date(item?.date)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' }) : '-'} + + {item?.name.length > 20 + ? item?.name.slice(0, 20) + "..." + : item?.name} - {item?.adjDividend !== null ? '$'+item?.adjDividend?.toFixed(2) : 'n/a'} + + {item?.marketCap !== null + ? abbreviateNumber(item?.marketCap) + : "-"} - {item?.paymentDate !== null ? new Date(item?.paymentDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' }) : '-'} + + + {item?.revenue !== null + ? abbreviateNumber(item?.revenue) + : "-"} + + {item?.date !== null + ? new Date(item?.date)?.toLocaleString( + "en-US", + { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + }, + ) + : "-"} + + {item?.adjDividend !== null + ? item?.adjDividend?.toFixed(2) + : "-"} + + {item?.paymentDate !== null + ? new Date(item?.paymentDate)?.toLocaleString( + "en-US", + { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + }, + ) + : "-"}
-
- - - {:else} -
- - No Dividends available for the day. -
- {/if} + +
+ {:else} +
+ + No Dividends available for the day. +
{/if} - {/each} - - - -
- - -
-
+
+ +
-
- - - - - \ No newline at end of file +
+
+ diff --git a/src/routes/ipos/+layout.svelte b/src/routes/ipos/+layout.svelte index 84fdba7e..9444eba5 100644 --- a/src/routes/ipos/+layout.svelte +++ b/src/routes/ipos/+layout.svelte @@ -1,254 +1,285 @@ - - + - {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} IPOs Calendar · stocknear - - + + {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} IPOs + Calendar · stocknear + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - -
- - -
- -
-
- - -
- - -
-
- - -
-
-

- IPO Calendar -

-
- - - Stay updated on upcoming IPOs in the stock market. - - - - -
- - - - - -
- - - - -
- - - - -
- - - -
- - +
+ +
+
+
+
+
+
+ +
+
+

+ IPO Calendar +

- + + + Stay updated on upcoming IPOs in the stock market. + +
+ + + + +
-
-
- - - - - +
+ - \ No newline at end of file + + .navmenu { + display: flex; + width: 100%; + flex-direction: row; + overflow-x: auto; + white-space: nowrap; + } + diff --git a/src/routes/ipos/[slug]/+page.svelte b/src/routes/ipos/[slug]/+page.svelte index cd5ba699..e86b589f 100644 --- a/src/routes/ipos/[slug]/+page.svelte +++ b/src/routes/ipos/[slug]/+page.svelte @@ -1,123 +1,112 @@ - - -
- - - +
{#if isLoaded} +
+
+ + There have been {totalIPOs} IPOs on the US stock market in {year}. +
-
- - -
- - There have been {totalIPOs} IPOs on the US stock market in {year}. -
- -
-
- Select Time period -
-
- @@ -132,99 +121,140 @@ $: { - + +
-
+ {#if rawData?.length !== 0} +
+ + + + + + + + + + + + + {#each ipoList as item} + + - {#if rawData?.length !== 0} -
-
IPO DateSymbolNameIPO PriceCurrent PriceReturn Since
+ {new Date(item?.date)?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + })} +
- - - - - - - - - - - - {#each ipoList as item,index} - goto("/stocks/"+item?.symbol)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#27272A] border-b-[#09090B] shake-ticker cursor-pointer"> - + - + + - + - - - - - - - - - - - - - - {/each} - - - - -
IPO DateSymbolNameIPO PriceCurrent PriceReturn Since
+ + {item?.symbol} + + - {new Date(item?.date)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })} - + {item?.name?.length > charNumber + ? formatString(item?.name?.slice(0, charNumber)) + "..." + : formatString(item?.name)} + + {item?.ipoPrice !== null ? item?.ipoPrice : "-"} + - {item?.symbol} - + {item?.currentPrice !== null ? item?.currentPrice : "-"} + - {item?.name?.length > charNumber ? formatString(item?.name?.slice(0,charNumber)) + "..." : formatString(item?.name)} - - {item?.ipoPrice !== null ? '$'+item?.ipoPrice : '-'} - - {item?.currentPrice !== null ? '$'+item?.currentPrice : '-'} - - {#if item?.return >=0 && item?.return !== null} - {abbreviateNumber(item?.return)}% - {:else if item?.return < 0 && item?.return !== null} - {abbreviateNumber(item?.return)}% - {:else} - - - - - {/if} -
- -
- {:else} -
-
- - No IPOs found. Please adjust your search timeframe for the latest {year} IPOs. -
-
- {/if} - -
- - {:else} -
-
- + + {#if item?.return >= 0 && item?.return !== null} + +{abbreviateNumber(item?.return)}% + {:else if item?.return < 0 && item?.return !== null} + {abbreviateNumber(item?.return)}% + + {:else} + + - + + {/if} + + + {/each} + + + +
+ {:else} +
+
+ + No IPOs found. Please adjust your search timeframe for the latest {year} + IPOs. +
+
+ {/if}
-
- - {/if} - - - - - -
\ No newline at end of file + {:else} +
+
+ +
+
+ {/if} +