diff --git a/src/routes/index/[tickerID]/+page.svelte b/src/routes/index/[tickerID]/+page.svelte index 9c2bca84..6cdb30fe 100644 --- a/src/routes/index/[tickerID]/+page.svelte +++ b/src/routes/index/[tickerID]/+page.svelte @@ -889,9 +889,7 @@ {stockDeck?.holdingsCount !== null - ? abbreviateNumber(stockDeck?.holdingsCount) - : "n/a"}n/a diff --git a/src/routes/options-calculator/+page.server.ts b/src/routes/options-calculator/+page.server.ts new file mode 100644 index 00000000..23aa78b1 --- /dev/null +++ b/src/routes/options-calculator/+page.server.ts @@ -0,0 +1,25 @@ +export const load = async ({ locals }) => { + const { apiKey, apiURL } = locals; + + const getData = async () => { + + // make the POST request to the endpoint + const response = await fetch(apiURL + "/potus-tracker", { + method: "GET", + headers: { + "Content-Type": "application/json", + "X-API-KEY": apiKey, + }, + }); + + const output = await response.json(); + + return output; + }; + + + // Make sure to return a promise + return { + getData: await getData(), + }; +}; diff --git a/src/routes/options-calculator/+page.svelte b/src/routes/options-calculator/+page.svelte new file mode 100644 index 00000000..e90c2643 --- /dev/null +++ b/src/routes/options-calculator/+page.svelte @@ -0,0 +1,1077 @@ + + + + +
+ + +
+
+
+
+
+
+

POTUS Tracker

+
+
+ +
+
+ = 0 ? "grown" : "declined"} by = 0 ? "text-green-800 dark:text-[#00FC50] before:content-['+']" : "text-red-800 dark:text-[#FF2F1F]"}"> + ${data?.getData?.marketPerformance[sectorDict[selectedSector]]["Inauguration"] ?? "n/a"}%.`} + /> +
+ +
+
+ + + + + + + Select Sector + + + + {#each updatedSectorList as sector} + {#if sector === "S&P500" || ["Pro", "Plus"]?.includes(data?.user?.tier)} + (selectedSector = sector)} + class="cursor-pointer sm:hover:bg-gray-200 dark:sm:hover:bg-primary" + > + {sector} + + {:else} + goto("/pricing")} + class="cursor-pointer sm:hover:bg-gray-200 dark:sm:hover:bg-primary" + > + {sector} + + + + + + {/if} + {/each} + + + +
+
+ +
+ + + + {#if activeIdx === 0} +

+ Official Presidential Schedule +

+
+
+ {#each Object?.entries(groupedByDate) as [date, items], indexA} +
+
+ + {date} + {#if items?.at(0)?.changesPercentage} +
+ S&P500 + {items.length > 0 + ? items?.at(0)?.changesPercentage + : "n/a"}% +
+ {/if} +
+ +
+ {#each items as item, indexB} +
+
+
+ + + + + + + + + {#if indexA === 0 && indexB === 0} + + {/if} +
+ + + {item.time_formatted} + {item.location !== null + ? `- ${item?.location}` + : ""} + +
+ + + {item.details} + +
+ {/each} +
+ {/each} +
+
+ {:else if activeIdx === 1} +

+ Executive Actions +

+
+
+ {#each Object.entries(groupedOrders) as [date, items], indexA} +
+
+ {date} + {#if latestInfoDate(date)} + + {/if} +
+
+ + {#each items as item, indexB} + +
+ +
+ + Trump Image + + +
+

+ Donald J. Trump +

+

+
+ {item?.title} + +
+ {item?.sentiment} +
+
+

+
+
+ + +
+ + {item?.description?.length > 300 + ? item?.description?.slice(0, 300) + "..." + : item?.description} + +
+ +
+ + +
+ + + + + + +
+
+ {/each} +
+ {/each} +
+
+ {:else if activeIdx === 2} +
+ +

+ Truth Social Posts +

+
+ +
+
+ {#each posts as item, index} +
+ + +

+ {item?.content?.length > 400 + ? item?.content?.slice(0, 400) + "..." + : item?.content} +

+ +
+ {item?.date} +
+
+ + +
+
+ {/each} +
+
+ {/if} +
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + +