From 5e181e1b0731758c1bcd0a75fe5fe0a9b2901f92 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 27 Oct 2024 12:07:13 +0100 Subject: [PATCH] ui fixes --- src/lib/components/BullBearSay.svelte | 189 +++++++----- .../components/DividendAnnouncement.svelte | 162 ++++++---- src/lib/components/EarningsSurprise.svelte | 140 ++++++--- src/lib/components/News.svelte | 2 +- src/lib/components/NextEarnings.svelte | 142 ++++----- src/lib/components/WIIM.svelte | 280 ++++++++++-------- src/routes/stocks/[tickerID]/+page.svelte | 15 +- .../financials/cash-flow/+page.svelte | 14 +- .../stocks/[tickerID]/statistics/+page.svelte | 2 +- 9 files changed, 549 insertions(+), 397 deletions(-) diff --git a/src/lib/components/BullBearSay.svelte b/src/lib/components/BullBearSay.svelte index fbdb47da..68a594e4 100644 --- a/src/lib/components/BullBearSay.svelte +++ b/src/lib/components/BullBearSay.svelte @@ -1,12 +1,12 @@ - - - - {#if Object?.keys(rawData)?.length !== 0} - -
- -
- -
-
- -
- - -
- -
+ + +{#if Object?.keys(rawData)?.length !== 0} +
+ +
+
+
+ +
+ + +
- - -
+
+ + +
{#each tabs as item, i} {/each} -
- +
- - - + + + Updated {rawData?.date} - +
- -
+
{#if activeIdx === 0} -

{rawData?.bullSays}

- {:else} - - {#if data?.user?.tier === 'Pro'} +

{rawData?.bullSays}

+ {:else if data?.user?.tier === "Pro"}

{rawData?.bearSays}

- {:else} -
- - Unlock content with Pro Subscription + {:else} +
+ + Unlock content with + Pro Subscription
{/if} - - {/if}
- - -
- -
- {/if} \ No newline at end of file +
+{/if} diff --git a/src/lib/components/DividendAnnouncement.svelte b/src/lib/components/DividendAnnouncement.svelte index 1f9df38f..c15fe224 100644 --- a/src/lib/components/DividendAnnouncement.svelte +++ b/src/lib/components/DividendAnnouncement.svelte @@ -1,12 +1,11 @@ - - {#if Object?.keys(rawData)?.length !== 0} - -
+
+
+
+ +
+ + +
+
+
-
-
- -
- - -
- -
+
+
+ {$displayCompanyName} has announced its upcoming dividend details on {new Date( + rawData?.date, + )?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + })}:
-
-
{$displayCompanyName} has announced its upcoming dividend details on {new Date(rawData?.date)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}:
- -
  • - Dividend: ${rawData?.dividend} per share ({(rawData?.dividend/rawData?.dividendPrior-1) > 0 ? '+' :''}{((rawData?.dividend/rawData?.dividendPrior-1)*100)?.toFixed(2)}% YoY) -
  • -
  • - Dividend Yield: {rawData?.dividendYield?.toFixed(2)}% -
  • -
  • - Ex-Dividend Date: {new Date(rawData?.exDividendDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })} -
  • +
  • + Dividend: ${rawData?.dividend} per share + ({rawData?.dividend / rawData?.dividendPrior - 1 > 0 ? "+" : ""}{( + (rawData?.dividend / rawData?.dividendPrior - 1) * + 100 + )?.toFixed(2)}% YoY) +
  • +
  • + Dividend Yield: + {rawData?.dividendYield?.toFixed(2)}% +
  • +
  • + Ex-Dividend Date: + {new Date(rawData?.exDividendDate)?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + })} +
  • -
  • - Payable Date: {new Date(rawData?.payableDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })} -
  • - -
  • - Record Date: {new Date(rawData?.recordDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })} -
  • -
    +
  • + Payable Date: + {new Date(rawData?.payableDate)?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + })} +
  • +
  • + Record Date: + {new Date(rawData?.recordDate)?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + })} +
  • +
    - - -
    -{/if} \ No newline at end of file +
    +{/if} diff --git a/src/lib/components/EarningsSurprise.svelte b/src/lib/components/EarningsSurprise.svelte index 96d1867b..80bc3d3a 100644 --- a/src/lib/components/EarningsSurprise.svelte +++ b/src/lib/components/EarningsSurprise.svelte @@ -1,12 +1,12 @@ - - {#if Object?.keys(rawData)?.length !== 0} - -
    +
    +
    +
    + +
    + + +
    +
    +
    -
    -
    - -
    - - -
    - -
    -
    - -
    -
    {$displayCompanyName} has released their quartely earnings on {new Date(rawData?.date)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}:
    - -
  • - Revenue of {abbreviateNumber(rawData?.revenue,true)} {rawData?.revenueSurprise > 0 ? 'exceeds' : 'misses'} estimates by {abbreviateNumber(Math.abs(rawData?.revenueSurprise),true)}, with {((rawData?.revenue/rawData?.revenuePrior-1)*100)?.toFixed(2)}% YoY {(rawData?.revenue/rawData?.revenuePrior-1) < 0 ? 'decline' : 'growth'}. -
  • -
  • - EPS of ${rawData?.eps} {rawData?.epsSurprise > 0 ? 'exceeds' : 'misses'} estimates by ${rawData?.epsSurprise?.toFixed(2)}, with {(((rawData?.eps - rawData?.epsPrior) / Math.abs(rawData?.epsPrior)) * 100)?.toFixed(2)}% YoY {((rawData?.eps - rawData?.epsPrior) / Math.abs(rawData?.epsPrior)) < 0 ? 'decline' : 'growth'}. -
  • +
    +
    + {$displayCompanyName} has released their quartely earnings on {new Date( + rawData?.date, + )?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + daySuffix: "2-digit", + })}:
    +
  • + Revenue of {abbreviateNumber(rawData?.revenue, true)} + {rawData?.revenueSurprise > 0 ? "exceeds" : "misses"} estimates by {abbreviateNumber( + Math.abs(rawData?.revenueSurprise), + true, + )}, with + {((rawData?.revenue / rawData?.revenuePrior - 1) * 100)?.toFixed( + 2, + )}% + YoY {rawData?.revenue / rawData?.revenuePrior - 1 < 0 + ? "decline" + : "growth"}. +
  • +
  • + EPS of ${rawData?.eps} + {rawData?.epsSurprise > 0 ? "exceeds" : "misses"} estimates by ${rawData?.epsSurprise?.toFixed( + 2, + )}, with + {( + ((rawData?.eps - rawData?.epsPrior) / + Math.abs(rawData?.epsPrior)) * + 100 + )?.toFixed(2)}% + YoY {(rawData?.eps - rawData?.epsPrior) / + Math.abs(rawData?.epsPrior) < + 0 + ? "decline" + : "growth"}. +
  • +
    - - -
    -{/if} \ No newline at end of file +
    +{/if} diff --git a/src/lib/components/News.svelte b/src/lib/components/News.svelte index 5be4d28a..58554828 100644 --- a/src/lib/components/News.svelte +++ b/src/lib/components/News.svelte @@ -72,7 +72,7 @@
    diff --git a/src/lib/components/NextEarnings.svelte b/src/lib/components/NextEarnings.svelte index cc6e2f2c..3cf9e618 100644 --- a/src/lib/components/NextEarnings.svelte +++ b/src/lib/components/NextEarnings.svelte @@ -1,81 +1,87 @@ - - {#if Object?.keys(rawData)?.length !== 0} - -
    +
    - -
    -
    - -
    - - -
    - -
    +
    +
    + +
    + + +
    +
    -
    - {$displayCompanyName} is scheduled to release its earnings on {new Date(rawData?.date ?? null)?.toLocaleString('en-US', { - month: 'short', - day: 'numeric', - year: 'numeric', - timeZone: 'Europe/Berlin' - })}, - {#if compareTimes(rawData?.time, '16:00') > 0} - after market closes. - {:else if compareTimes(rawData?.time, '09:30') < 0} - before market opens. - {:else} - during market hours. - {/if} -
    Analysts project revenue of {abbreviateNumber(rawData?.revenueEst,true)}, reflecting a - {revenueRatio}% YoY {revenueRatio > 0 ? 'growth' : revenueRatio < 0 ? 'shrinking' : ''} and earnings per share of - {rawData?.epsEst}, making a {epsRatio}% {epsRatio > 0 ? 'increase' : epsRatio < 0 ? 'decrease' : ''} YoY. -
    - - +
    + {$displayCompanyName} is scheduled to release its earnings on {new Date( + rawData?.date ?? null, + )?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + timeZone: "Europe/Berlin", + })}, + {#if compareTimes(rawData?.time, "16:00") > 0} + after market closes. + {:else if compareTimes(rawData?.time, "09:30") < 0} + before market opens. + {:else} + during market hours. + {/if} +
    Analysts project revenue of + {abbreviateNumber(rawData?.revenueEst, true)}, + reflecting a + {revenueRatio}% YoY {revenueRatio > 0 + ? "growth" + : revenueRatio < 0 + ? "shrinking" + : ""} and earnings per share of + {rawData?.epsEst}, making a + {epsRatio}% + {epsRatio > 0 ? "increase" : epsRatio < 0 ? "decrease" : ""} YoY. +
    - - -
    -{/if} \ No newline at end of file +
    +{/if} diff --git a/src/lib/components/WIIM.svelte b/src/lib/components/WIIM.svelte index 4dc8fbda..c5dec5e4 100644 --- a/src/lib/components/WIIM.svelte +++ b/src/lib/components/WIIM.svelte @@ -1,146 +1,178 @@ + - - - -
    -
    - -
    - - -
    - - {#if isLoaded} - {#if wiim?.length !== 0} -
    - {#each (showFullHistory ? wiim : wiim?.slice(0,2)) as item, index} - -
    - -
    -
    - -
    - - - -
    - -
    -
    -
    - Updated {item?.date} - {#if latestInfoDate(item?.date)} - - {/if} -
    - {#if item?.changesPercentage >=0} - - +{item?.changesPercentage}% - {:else if item?.changesPercentage < 0 } - - {item?.changesPercentage}% - {/if} -
    -
    +
    +
    +
    + + +
    -
    - - {item?.text } - -
    + {#if isLoaded} + {#if wiim?.length !== 0} +
    + {#each showFullHistory ? wiim : wiim?.slice(0, 2) as item, index} +
    +
    +
    +
    + - - - -
    -
    -
    - - + +
    +
    +
    +
    + Updated {item?.date} + {#if latestInfoDate(item?.date)} + + {/if} +
    + {#if item?.changesPercentage >= 0} + + +{item?.changesPercentage}% + {:else if item?.changesPercentage < 0} + + {item?.changesPercentage}% + + {/if}
    -
    -
    -
    - - {/each} -
    - - - - - {#if wiim?.length > 2} - - {/if} - - {/if} +
    - {:else} -
    -
    - +
    + + {item?.text} + +
    +
    +
    +
    + +
    +
    - {/if} - - -
    -
    - - - - - \ No newline at end of file + {/each} +
    + + {#if wiim?.length > 2} + + {/if} + {/if} + {:else} +
    +
    + +
    +
    + {/if} + + diff --git a/src/routes/stocks/[tickerID]/+page.svelte b/src/routes/stocks/[tickerID]/+page.svelte index 4f8bdad2..4aa2d9dd 100644 --- a/src/routes/stocks/[tickerID]/+page.svelte +++ b/src/routes/stocks/[tickerID]/+page.svelte @@ -4,7 +4,6 @@ import { getCache, setCache, - screenWidth, displayCompanyName, numberOfUnreadNotification, globalForm, @@ -21,7 +20,7 @@ } from "$lib/store"; import { onDestroy, onMount } from "svelte"; import BullBearSay from "$lib/components/BullBearSay.svelte"; - + import News from "$lib/components/News.svelte"; import NextEarnings from "$lib/components/NextEarnings.svelte"; import EarningsSurprise from "$lib/components/EarningsSurprise.svelte"; import DividendAnnouncement from "$lib/components/DividendAnnouncement.svelte"; @@ -891,9 +890,11 @@ -
    +
    -
    +
    @@ -1571,11 +1572,7 @@ ? '' : 'hidden'}" > - {#await import("$lib/components/News.svelte") then { default: Comp }} - - {/await} +
    -
    +
    -
    +
    -
    +

    {#if mode} @@ -412,9 +416,9 @@

    -
    +
    {rawData?.inventoryTurnover}{abbreviateNumber(rawData?.inventoryTurnover)}