diff --git a/src/lib/components/DarkPool/RealtimeTrade.svelte b/src/lib/components/DarkPool/RealtimeTrade.svelte index 6d1c5ae8..c38c3da6 100644 --- a/src/lib/components/DarkPool/RealtimeTrade.svelte +++ b/src/lib/components/DarkPool/RealtimeTrade.svelte @@ -97,25 +97,37 @@ }, xAxis: { type: "datetime", - min: startTime, - max: endTime, - tickLength: 0, + min: startTime, // Force start at 9:30 + max: endTime, // Force end at 16:10 crosshair: { - color: $mode === "light" ? "#545454" : "white", - width: 1, + color: $mode === "light" ? "black" : "white", // Set the color of the crosshair line + width: 1, // Adjust the line width as needed dashStyle: "Solid", }, labels: { style: { color: $mode === "light" ? "#545454" : "white" }, - distance: 20, + distance: 10, // Increases space between label and axis formatter: function () { const date = new Date(this?.value); - return date?.toLocaleTimeString("en-US", { - hour: "2-digit", - minute: "2-digit", + const timeString = date?.toLocaleTimeString("en-US", { + hour: "numeric", + hour12: true, }); + return `${timeString.replace(/\s/g, " ")}`; }, }, + tickPositioner: function () { + // Create custom tick positions with wider spacing + const positions = []; + const info = this.getExtremes(); + const tickCount = 5; // Reduce number of ticks displayed + const interval = (info.max - info.min) / tickCount; + + for (let i = 0; i <= tickCount; i++) { + positions.push(info.min + i * interval); + } + return positions; + }, }, yAxis: [ { @@ -203,6 +215,7 @@ ], }, color: "#4681f4", + borderColor: "4681f4", lineWidth: 1.3, yAxis: 0, // Use primary yAxis animation: false, diff --git a/src/lib/components/FinancialTable.svelte b/src/lib/components/FinancialTable.svelte index 8f07e385..8af88673 100644 --- a/src/lib/components/FinancialTable.svelte +++ b/src/lib/components/FinancialTable.svelte @@ -1,9 +1,14 @@ {#each computedFields as { label, key, isMargin } (key)} @@ -39,14 +155,69 @@ class="dark:sm:hover:bg-[#245073]/10 odd:bg-[#F6F7F8] dark:odd:bg-odd whitespace-nowrap" > - {label} + {label} + - {#each data as item, index (index)} + {#each data as item} {formatValue(item[key], isMargin)} {/each} {/each} + + + + + + + diff --git a/src/routes/pricing/+page.svelte b/src/routes/pricing/+page.svelte index e76f6d23..7f22cda6 100644 --- a/src/routes/pricing/+page.svelte +++ b/src/routes/pricing/+page.svelte @@ -7,7 +7,7 @@ export let data; export let form; - let mode = false; + let mode = true; const emailAddress = "support@stocknear.com"; function toggleMode() { diff --git a/src/routes/stocks/[tickerID]/financials/+layout.server.ts b/src/routes/stocks/[tickerID]/financials/+layout.server.ts new file mode 100644 index 00000000..4e16922d --- /dev/null +++ b/src/routes/stocks/[tickerID]/financials/+layout.server.ts @@ -0,0 +1,32 @@ + + +export const load = async ({ locals, params }) => { + const { apiKey, apiURL } = locals; + const postData = { + ticker: params.tickerID, + }; + + const getProfileData = async () => { + + + // make the POST request to the endpoint + const response = await fetch(apiURL + "/profile", { + method: "POST", + headers: { + "Content-Type": "application/json", + "X-API-KEY": apiKey, + }, + body: JSON.stringify(postData), + }); + + const output = await response.json(); + + return output; + }; + + // Make sure to return a promise + return { + getProfileData: await getProfileData(), + }; +}; + diff --git a/src/routes/stocks/[tickerID]/financials/+page.server.ts b/src/routes/stocks/[tickerID]/financials/+page.server.ts index 8af348bd..6caffc68 100644 --- a/src/routes/stocks/[tickerID]/financials/+page.server.ts +++ b/src/routes/stocks/[tickerID]/financials/+page.server.ts @@ -2,15 +2,15 @@ import { error, fail, redirect } from "@sveltejs/kit"; import { validateData } from "$lib/utils"; import { loginUserSchema, registerUserSchema } from "$lib/schemas"; - - export const load = async ({ locals, params }) => { - const getData = async () => { - const { apiKey, apiURL } = locals; + const { apiKey, apiURL } = locals; const postData = { ticker: params.tickerID, }; + + const getData = async () => { + // make the POST request to the endpoint const response = await fetch(apiURL + "/stock-income", { method: "POST", @@ -26,6 +26,8 @@ export const load = async ({ locals, params }) => { return output; }; + + // Make sure to return a promise return { getData: await getData(), diff --git a/src/routes/stocks/[tickerID]/financials/+page.svelte b/src/routes/stocks/[tickerID]/financials/+page.svelte index 427acb70..0d1be354 100644 --- a/src/routes/stocks/[tickerID]/financials/+page.svelte +++ b/src/routes/stocks/[tickerID]/financials/+page.svelte @@ -392,7 +392,7 @@
{#if financialData?.length > 0}
{:else} +
+ + Financials in {data?.getProfileData?.currency}. Fiscal year + is + {data?.getProfileData?.fiscalYearRange}. + +
+
+ + + + + + + Select time frame + + + + ($timeFrame = "5Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 5 years + + ($timeFrame = "10Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 10 years + + ($timeFrame = "MAX")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + Max + + + + +
+ +
+
@@ -513,25 +597,40 @@ class="table table-sm table-compact no-scrollbar rounded-none sm:rounded-md w-full bg-white dark:bg-table border border-gray-300 dark:border-gray-800 m-auto" > - + YearFiscal Year - {#each financialData as cash} + {#each financialData as item} {#if filterRule === "annual"} - - {"FY" + cash?.fiscalYear?.slice(-2)} + + {"FY" + " " + item?.fiscalYear} {:else} - {"FY" + - cash?.fiscalYear?.slice(-2) + - " " + - cash?.period} + {item?.period + " " + item?.fiscalYear} {/if} {/each} + + Period Ending + {#each financialData as item} + + {new Date(item?.date).toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + })} + + {/each} + diff --git a/src/routes/stocks/[tickerID]/financials/balance-sheet/+page.svelte b/src/routes/stocks/[tickerID]/financials/balance-sheet/+page.svelte index ddf312c9..a97d4da0 100644 --- a/src/routes/stocks/[tickerID]/financials/balance-sheet/+page.svelte +++ b/src/routes/stocks/[tickerID]/financials/balance-sheet/+page.svelte @@ -422,7 +422,7 @@
{#if financialData?.length > 0}
{:else} +
+ + Financials in {data?.getProfileData?.currency}. Fiscal year + is + {data?.getProfileData?.fiscalYearRange}. + +
+
+ + + + + + + Select time frame + + + + ($timeFrame = "5Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 5 years + + ($timeFrame = "10Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 10 years + + ($timeFrame = "MAX")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + Max + + + + +
+ +
+
@@ -543,25 +627,40 @@ class="table table-sm table-compact no-scrollbar rounded-none sm:rounded-md w-full bg-white dark:bg-table border border-gray-300 dark:border-gray-800 m-auto" > - + YearFiscal Year - {#each financialData as cash} + {#each financialData as item} {#if filterRule === "annual"} - - {"FY" + cash?.fiscalYear?.slice(-2)} + + {"FY" + " " + item?.fiscalYear} {:else} - {"FY" + - cash?.fiscalYear?.slice(-2) + - " " + - cash?.period} + {item?.period + " " + item?.fiscalYear} {/if} {/each} + + Period Ending + {#each financialData as item} + + {new Date(item?.date).toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + })} + + {/each} + diff --git a/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte b/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte index b6e3ca75..3e4ba882 100644 --- a/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte +++ b/src/routes/stocks/[tickerID]/financials/cash-flow/+page.svelte @@ -384,7 +384,7 @@
{#if financialData?.length > 0}
{:else} +
+ + Financials in {data?.getProfileData?.currency}. Fiscal year + is + {data?.getProfileData?.fiscalYearRange}. + +
+
+ + + + + + + Select time frame + + + + ($timeFrame = "5Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 5 years + + ($timeFrame = "10Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 10 years + + ($timeFrame = "MAX")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + Max + + + + +
+ +
+
@@ -505,25 +589,40 @@ class="table table-sm table-compact no-scrollbar rounded-none sm:rounded-md w-full bg-white dark:bg-table border border-gray-300 dark:border-gray-800 m-auto" > - + YearFiscal Year - {#each financialData as cash} + {#each financialData as item} {#if filterRule === "annual"} - - {"FY" + cash?.fiscalYear?.slice(-2)} + + {"FY" + " " + item?.fiscalYear} {:else} - {"FY" + - cash?.fiscalYear?.slice(-2) + - " " + - cash?.period} + {item?.period + " " + item?.fiscalYear} {/if} {/each} + + Period Ending + {#each financialData as item} + + {new Date(item?.date).toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + })} + + {/each} + diff --git a/src/routes/stocks/[tickerID]/financials/ratios/+page.svelte b/src/routes/stocks/[tickerID]/financials/ratios/+page.svelte index 6e04f8f5..96c6ea61 100644 --- a/src/routes/stocks/[tickerID]/financials/ratios/+page.svelte +++ b/src/routes/stocks/[tickerID]/financials/ratios/+page.svelte @@ -306,8 +306,8 @@
@@ -373,7 +373,7 @@
{#if financialData?.length > 0}
{:else} +
+ + Financials in {data?.getProfileData?.currency}. Fiscal year + is + {data?.getProfileData?.fiscalYearRange}. + +
+
+ + + + + + + Select time frame + + + + ($timeFrame = "5Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 5 years + + ($timeFrame = "10Y")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + 10 years + + ($timeFrame = "MAX")} + class="cursor-pointer sm:hover:bg-gray-300 dark:sm:hover:bg-primary" + > + Max + + + + +
+ +
+
@@ -494,25 +578,40 @@ class="table table-sm table-compact no-scrollbar rounded-none sm:rounded-md w-full bg-white dark:bg-table border border-gray-300 dark:border-gray-800 m-auto" > - + YearFiscal Year - {#each financialData as cash} + {#each financialData as item} {#if filterRule === "annual"} - - {"FY" + cash?.fiscalYear?.slice(-2)} + + {"FY" + " " + item?.fiscalYear} {:else} - {"FY" + - cash?.fiscalYear?.slice(-2) + - " " + - cash?.period} + {item?.period + " " + item?.fiscalYear} {/if} {/each} + + Period Ending + {#each financialData as item} + + {new Date(item?.date).toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + })} + + {/each} + diff --git a/src/routes/stocks/[tickerID]/profile/+page.server.ts b/src/routes/stocks/[tickerID]/profile/+page.server.ts index 71f53b89..1d38231f 100644 --- a/src/routes/stocks/[tickerID]/profile/+page.server.ts +++ b/src/routes/stocks/[tickerID]/profile/+page.server.ts @@ -5,7 +5,6 @@ import { loginUserSchema, registerUserSchema } from "$lib/schemas"; export const load = async ({ params, locals }) => { const getData = async () => { - let newsList; const { apiURL, apiKey } = locals; @@ -23,9 +22,9 @@ export const load = async ({ params, locals }) => { body: JSON.stringify(postData), }); - newsList = await response.json(); + const output = await response.json(); - return newsList; + return output; }; // Make sure to return a promise diff --git a/static/img/astronaut.png b/static/img/astronaut.png new file mode 100644 index 00000000..de3d55ef Binary files /dev/null and b/static/img/astronaut.png differ diff --git a/static/img/astronaut.png:Zone.Identifier b/static/img/astronaut.png:Zone.Identifier new file mode 100644 index 00000000..9e8d56b0 --- /dev/null +++ b/static/img/astronaut.png:Zone.Identifier @@ -0,0 +1,4 @@ +[ZoneTransfer] +ZoneId=3 +ReferrerUrl=https://www.canva.com/ +HostUrl=https://export-download.canva.com/UUB-4/DAGjgDUUB-4/15/0/0001-8423318452819072229.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQYCGKMUH5AO7UJ26%2F20250402%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250402T140745Z&X-Amz-Expires=17707&X-Amz-Signature=761feacdef49bdff3e2ad98387de9793c888669042037eefeb34735ca106cdbb&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27Kopie%2520von%2520Kopie%2520von%2520Beige%2520Gr%25C3%25BCn%2520Neutral%2520Organisch%2520Pitch%2520Deck%2520Marketing%2520Pr%25C3%25A4sentation.png&response-expires=Wed%2C%2002%20Apr%202025%2019%3A02%3A52%20GMT