This commit is contained in:
MuslemRahimi 2024-10-28 14:45:23 +01:00
parent 6c26959106
commit 96156185e7
9 changed files with 391 additions and 382 deletions

View File

@ -1,7 +1,35 @@
<script lang="ts"> <script lang="ts">
import { stockTicker } from "$lib/store";
import ArrowLogo from "lucide-svelte/icons/move-up-right"; import ArrowLogo from "lucide-svelte/icons/move-up-right";
export let data; export let data;
const formatDate = (dateString) => {
// Create a date object for the input dateString
const inputDate = new Date(dateString);
// Create a date object for the current time in New York City
const nycTime = new Date().toLocaleString("en-US", {
timeZone: "America/New_York",
});
const currentNYCDate = new Date(nycTime);
// Calculate the difference in milliseconds
const difference = inputDate.getTime() - currentNYCDate.getTime();
// Convert the difference to minutes
const minutes = Math.abs(Math.round(difference / (1000 * 60)));
if (minutes < 60) {
return `${minutes} minutes`;
} else if (minutes < 1440) {
const hours = Math.round(minutes / 60);
return `${hours} hour${hours !== 1 ? "s" : ""}`;
} else {
const days = Math.round(minutes / 1440);
return `${days} day${days !== 1 ? "s" : ""}`;
}
};
</script> </script>
<section class="w-auto overflow-hidden min-h-screen"> <section class="w-auto overflow-hidden min-h-screen">
@ -25,7 +53,7 @@
> >
<div class="w-full flex justify-between items-center p-3 mt-3"> <div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3"> <h2 class="text-start text-xl font-semibold text-white ml-3">
Pro Subscription 🔥 Pro Subscription
</h2> </h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" /> <ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div> </div>
@ -36,43 +64,31 @@
</div> </div>
{/if} {/if}
<div {#if data?.getNews?.length !== 0}
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer" <div
> class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
<a
href={"/price-alert"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
> >
<div class="w-full flex justify-between items-center p-3 mt-3"> <div class="p-4 text-sm">
<h2 class="text-start text-xl font-semibold text-white ml-3"> <h3 class="text-lg text-white font-semibold mb-3">
Price Alert ⏰ {$stockTicker} News
</h2> </h3>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" /> <ul class="text-gray-200">
{#each data?.getNews?.slice(0, 10) as item}
<li class="mb-3 last:mb-1">
{formatDate(item?.publishedDate)} ago -
<a
class="sm:hover:text-white text-blue-400"
href={item?.url}
target="_blank"
rel="noopener noreferrer nofollow">{item?.title}</a
>
- {item?.site}
</li>
{/each}
</ul>
</div> </div>
<span class="text-white p-3 ml-3 mr-3"> </div>
Customize your alerts to never miss out again {/if}
</span>
</a>
</div>
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/stock-screener"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Stock Screener 🔎
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Build your Stock Screener to find profitable stocks.
</span>
</a>
</div>
</aside> </aside>
</div> </div>
</div> </div>

View File

@ -1,7 +1,9 @@
<script lang="ts"> <script lang="ts">
import { stockTicker, screenWidth } from "$lib/store"; import { stockTicker, screenWidth, coolMode } from "$lib/store";
import { page } from "$app/stores"; import ArrowLogo from "lucide-svelte/icons/move-up-right";
import { page } from "$app/stores";
export let data;
let displaySubSection = "income"; let displaySubSection = "income";
function changeSubSection(state) { function changeSubSection(state) {
@ -43,93 +45,165 @@
} }
</script> </script>
<section class="w-auto bg-[#09090B] overflow-hidden h-full"> <section class="w-full overflow-hidden min-h-screen">
<div class="m-auto h-full overflow-hidden"> <div class="w-full overflow-hidden m-auto">
<main class="w-full"> <div class="sm:p-0 flex justify-center w-full m-auto overflow-hidden">
<div class="m-auto"> <div
<div class="relative flex justify-center items-start overflow-hidden w-full"
class="-ml-2 sm:ml-8 w-screen sm:w-full {$screenWidth < 640 >
? 'overflow-auto scrollbar' <main class="w-full {$coolMode ? 'lg:w-3/4' : 'w-full'} ">
: 'no-scrollbar'} mb-2" <div class="m-auto">
> <div
<ul class="-ml-2 sm:ml-8 w-screen sm:w-full {$screenWidth < 640
class="pr-4 sm:pr-0 w-screen flex flex-row items-center bg-[#09090B] overflow-x-scroll sm:overflow-hidden space-x-4 rtl:space-x-reverse py-2" ? 'overflow-auto scrollbar'
> : 'no-scrollbar'} mb-2"
<li class="cursor-pointer flex flex-col items-center"> >
<a <ul
href={`/stocks/${$stockTicker}/financials`} class="pr-4 sm:pr-0 w-screen flex flex-row items-center bg-[#09090B] overflow-x-scroll sm:overflow-hidden space-x-4 rtl:space-x-reverse py-2"
on:click={() => changeSubSection("income")}
class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
'income'
? 'text-white '
: 'bg-[#09090B]'}"
> >
Income <li class="cursor-pointer flex flex-col items-center">
</a> <a
<div href={`/stocks/${$stockTicker}/financials`}
class="{displaySubSection === 'income' on:click={() => changeSubSection("income")}
? 'bg-[#75D377]' class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[4rem]" 'income'
/> ? 'text-white '
</li> : 'bg-[#09090B]'}"
<li class="cursor-pointer flex flex-col items-center"> >
<a Income
href={`/stocks/${$stockTicker}/financials/balance-sheet`} </a>
on:click={() => changeSubSection("balance-sheet")} <div
class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === class="{displaySubSection === 'income'
'balance-sheet' ? 'bg-[#75D377]'
? 'text-white ' : 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[4rem]"
: 'bg-[#09090B]'}" />
> </li>
Balance Sheet <li class="cursor-pointer flex flex-col items-center">
</a> <a
<div href={`/stocks/${$stockTicker}/financials/balance-sheet`}
class="{displaySubSection === 'balance-sheet' on:click={() => changeSubSection("balance-sheet")}
? 'bg-[#75D377]' class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2.5rem]" 'balance-sheet'
/> ? 'text-white '
</li> : 'bg-[#09090B]'}"
<li class="cursor-pointer flex flex-col items-center"> >
<a Balance Sheet
href={`/stocks/${$stockTicker}/financials/cash-flow`} </a>
on:click={() => changeSubSection("cash-flow")} <div
class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === class="{displaySubSection === 'balance-sheet'
'cash-flow' ? 'bg-[#75D377]'
? 'text-white ' : 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2.5rem]"
: 'bg-[#09090B]'}" />
> </li>
Cashflow <li class="cursor-pointer flex flex-col items-center">
</a> <a
<div href={`/stocks/${$stockTicker}/financials/cash-flow`}
class="{displaySubSection === 'cash-flow' on:click={() => changeSubSection("cash-flow")}
? 'bg-[#75D377]' class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2.5rem]" 'cash-flow'
/> ? 'text-white '
</li> : 'bg-[#09090B]'}"
>
Cashflow
</a>
<div
class="{displaySubSection === 'cash-flow'
? 'bg-[#75D377]'
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2.5rem]"
/>
</li>
<li class="cursor-pointer flex flex-col items-center"> <li class="cursor-pointer flex flex-col items-center">
<a <a
href={`/stocks/${$stockTicker}/financials/ratios`} href={`/stocks/${$stockTicker}/financials/ratios`}
on:click={() => changeSubSection("ratios")} on:click={() => changeSubSection("ratios")}
class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === class="px-2 text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
'ratios' 'ratios'
? 'text-white ' ? 'text-white '
: 'bg-[#09090B]'}" : 'bg-[#09090B]'}"
> >
Ratios Ratios
</a> </a>
<div
class="{displaySubSection === 'ratios'
? 'bg-[#75D377]'
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2rem]"
/>
</li>
</ul>
</div>
</div>
<slot />
</main>
{#if $coolMode}
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div <div
class="{displaySubSection === 'ratios' class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
? 'bg-[#75D377]' >
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2rem]" <a
/> href="/pricing"
</li> class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
</ul> >
</div> <div
class="w-full flex justify-between items-center p-3 mt-3"
>
<h2
class="text-start text-xl font-semibold text-white ml-3"
>
Pro Subscription
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Upgrade now for unlimited access to all data and tools.
</span>
</a>
</div>
{/if}
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/watchlist/stocks"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Watchlist
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Build your watchlist to keep track of your favorite stocks.
</span>
</a>
</div>
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts/top-stocks"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Top Stocks
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Get the latest top Wall Street Analyst Ratings
</span>
</a>
</div>
</aside>
{/if}
</div> </div>
</main> </div>
<slot />
</div> </div>
</section> </section>

View File

@ -3,6 +3,7 @@
numberOfUnreadNotification, numberOfUnreadNotification,
displayCompanyName, displayCompanyName,
stockTicker, stockTicker,
coolMode,
} from "$lib/store"; } from "$lib/store";
import { abbreviateNumber } from "$lib/utils"; import { abbreviateNumber } from "$lib/utils";
import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js"; import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js";
@ -28,7 +29,7 @@
let filterRule = "annual"; let filterRule = "annual";
let displayStatement = "revenue"; let displayStatement = "revenue";
let mode = false; $coolMode = false;
let timeFrame = "10Y"; let timeFrame = "10Y";
onMount(async () => { onMount(async () => {
@ -141,7 +142,7 @@
]; ];
function toggleMode() { function toggleMode() {
mode = !mode; $coolMode = !$coolMode;
} }
function changeStatement(event) { function changeStatement(event) {
@ -330,7 +331,7 @@
} }
income = filterStatement(fullStatement, timeFrame); income = filterStatement(fullStatement, timeFrame);
if (mode === true) { if ($coolMode === true) {
optionsData = plotData(); optionsData = plotData();
} }
} }
@ -379,7 +380,7 @@
<div class="sm:p-7 m-auto mt-2 sm:mt-0"> <div class="sm:p-7 m-auto mt-2 sm:mt-0">
<div class="mb-3"> <div class="mb-3">
<h1 class="text-2xl text-gray-200 font-bold"> <h1 class="text-2xl text-gray-200 font-bold">
{#if mode} {#if $coolMode}
{statementConfig?.find( {statementConfig?.find(
(item) => item?.propertyName === displayStatement, (item) => item?.propertyName === displayStatement,
)?.label} )?.label}
@ -405,7 +406,7 @@
/></svg /></svg
> >
{#if mode} {#if $coolMode}
{statementConfig?.find( {statementConfig?.find(
(item) => item?.propertyName === displayStatement, (item) => item?.propertyName === displayStatement,
)?.text} )?.text}
@ -471,14 +472,14 @@
<input <input
on:click={toggleMode} on:click={toggleMode}
type="checkbox" type="checkbox"
checked={mode} checked={$coolMode}
value={mode} value={$coolMode}
class="sr-only peer" class="sr-only peer"
/> />
<div <div
class="w-11 h-6 bg-gray-400 rounded-full peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#1563F9]" class="w-11 h-6 bg-gray-400 rounded-full peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#1563F9]"
></div> ></div>
{#if mode} {#if $coolMode}
<span class="ml-2 text-sm font-medium text-white"> <span class="ml-2 text-sm font-medium text-white">
Cool Mode Cool Mode
</span> </span>
@ -565,7 +566,7 @@
</div> </div>
</div> </div>
{#if mode} {#if $coolMode}
<div class="sm:w-full"> <div class="sm:w-full">
<div class="relative"> <div class="relative">
<select <select

View File

@ -1,87 +0,0 @@
<script lang="ts">
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import { coolMode } from "$lib/store";
export let data;
</script>
<section class="w-full overflow-hidden min-h-screen">
<div class="w-full overflow-hidden m-auto">
<div class="sm:p-0 flex justify-center w-full m-auto overflow-hidden">
<div
class="relative flex justify-center items-start overflow-hidden w-full"
>
<main class="w-full {$coolMode ? 'lg:w-3/4' : 'w-full'} ">
<slot />
</main>
{#if $coolMode}
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/pricing"
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div
class="w-full flex justify-between items-center p-3 mt-3"
>
<h2
class="text-start text-xl font-semibold text-white ml-3"
>
Pro Subscription 🔥
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Upgrade now for unlimited access to all data and tools.
</span>
</a>
</div>
{/if}
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/price-alert"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Price Alert ⏰
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Customize your alerts to never miss out again
</span>
</a>
</div>
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/stock-screener"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Stock Screener 🔎
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Build your Stock Screener to find profitable stocks.
</span>
</a>
</div>
</aside>
{/if}
</div>
</div>
</div>
</section>

View File

@ -2,6 +2,7 @@
import { import {
numberOfUnreadNotification, numberOfUnreadNotification,
displayCompanyName, displayCompanyName,
coolMode,
stockTicker, stockTicker,
} from "$lib/store"; } from "$lib/store";
import { abbreviateNumber } from "$lib/utils"; import { abbreviateNumber } from "$lib/utils";
@ -25,7 +26,7 @@
let filterRule = "annual"; let filterRule = "annual";
let displayStatement = "netIncome"; let displayStatement = "netIncome";
let mode = false; $coolMode = false;
let tableList = []; let tableList = [];
let timeFrame = "10Y"; let timeFrame = "10Y";
@ -160,7 +161,7 @@
]; ];
function toggleMode() { function toggleMode() {
mode = !mode; $coolMode = !$coolMode;
} }
function changeStatement(event) { function changeStatement(event) {
@ -351,7 +352,7 @@
cashFlow = filterStatement(fullStatement, timeFrame); cashFlow = filterStatement(fullStatement, timeFrame);
if (mode === true) { if ($coolMode === true) {
optionsData = plotData(); optionsData = plotData();
} }
} }
@ -404,7 +405,7 @@
<div class="sm:p-7 m-auto mt-2 sm:mt-0 w-full"> <div class="sm:p-7 m-auto mt-2 sm:mt-0 w-full">
<div class="mb-3"> <div class="mb-3">
<h1 class="text-2xl text-gray-200 font-bold"> <h1 class="text-2xl text-gray-200 font-bold">
{#if mode} {#if $coolMode}
{statementConfig?.find( {statementConfig?.find(
(item) => item?.propertyName === displayStatement, (item) => item?.propertyName === displayStatement,
)?.label} )?.label}
@ -428,7 +429,7 @@
/></svg /></svg
> >
{#if mode} {#if $coolMode}
{statementConfig?.find( {statementConfig?.find(
(item) => item?.propertyName === displayStatement, (item) => item?.propertyName === displayStatement,
)?.text} )?.text}
@ -494,14 +495,14 @@
<input <input
on:click={toggleMode} on:click={toggleMode}
type="checkbox" type="checkbox"
checked={mode} checked={$coolMode}
value={mode} value={$coolMode}
class="sr-only peer" class="sr-only peer"
/> />
<div <div
class="w-11 h-6 bg-gray-400 rounded-full peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#1563F9]" class="w-11 h-6 bg-gray-400 rounded-full peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#1563F9]"
></div> ></div>
{#if mode} {#if $coolMode}
<span class="ml-2 text-sm font-medium text-white"> <span class="ml-2 text-sm font-medium text-white">
Cool Mode Cool Mode
</span> </span>
@ -588,7 +589,7 @@
</div> </div>
</div> </div>
{#if mode} {#if $coolMode}
<div class="sm:w-full"> <div class="sm:w-full">
<div class="relative"> <div class="relative">
<select <select

View File

@ -4,6 +4,7 @@
numberOfUnreadNotification, numberOfUnreadNotification,
displayCompanyName, displayCompanyName,
stockTicker, stockTicker,
coolMode,
} from "$lib/store"; } from "$lib/store";
import { abbreviateNumber } from "$lib/utils"; import { abbreviateNumber } from "$lib/utils";
import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js"; import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js";
@ -27,7 +28,7 @@
let displayStatement = "priceEarningsRatio"; let displayStatement = "priceEarningsRatio";
let mode = false; $coolMode = false;
let timeFrame = "10Y"; let timeFrame = "10Y";
const statementConfig = [ const statementConfig = [
@ -124,7 +125,7 @@
]; ];
function toggleMode() { function toggleMode() {
mode = !mode; $coolMode = !$coolMode;
} }
function changeStatement(event) { function changeStatement(event) {
@ -314,7 +315,7 @@
ratios = filterStatement(fullStatement, timeFrame); ratios = filterStatement(fullStatement, timeFrame);
if (mode === true) { if ($coolMode === true) {
optionsData = plotData(); optionsData = plotData();
} }
} }
@ -368,7 +369,7 @@
<div class="sm:p-7 m-auto mt-2 sm:mt-0 w-full"> <div class="sm:p-7 m-auto mt-2 sm:mt-0 w-full">
<div class="mb-3"> <div class="mb-3">
<h1 class="text-2xl text-gray-200 font-bold"> <h1 class="text-2xl text-gray-200 font-bold">
{#if mode} {#if $coolMode}
{statementConfig?.find( {statementConfig?.find(
(item) => item?.propertyName === displayStatement, (item) => item?.propertyName === displayStatement,
)?.label} )?.label}
@ -392,7 +393,7 @@
/></svg /></svg
> >
{#if mode} {#if $coolMode}
{statementConfig?.find( {statementConfig?.find(
(item) => item?.propertyName === displayStatement, (item) => item?.propertyName === displayStatement,
)?.text} )?.text}
@ -458,14 +459,14 @@
<input <input
on:click={toggleMode} on:click={toggleMode}
type="checkbox" type="checkbox"
checked={mode} checked={$coolMode}
value={mode} value={$coolMode}
class="sr-only peer" class="sr-only peer"
/> />
<div <div
class="w-11 h-6 bg-gray-400 rounded-full peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#1563F9]" class="w-11 h-6 bg-gray-400 rounded-full peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-[#1563F9]"
></div> ></div>
{#if mode} {#if $coolMode}
<span class="ml-2 text-sm font-medium text-white"> <span class="ml-2 text-sm font-medium text-white">
Cool Mode Cool Mode
</span> </span>
@ -552,7 +553,7 @@
</div> </div>
</div> </div>
{#if mode} {#if $coolMode}
<div class="sm:w-full"> <div class="sm:w-full">
<div class="relative"> <div class="relative">
<select <select

View File

@ -1,9 +1,38 @@
<script lang="ts"> <script lang="ts">
import { stockTicker, screenWidth } from "$lib/store"; import { stockTicker, screenWidth } from "$lib/store";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import { page } from "$app/stores"; import { page } from "$app/stores";
export let data; export let data;
const formatDate = (dateString) => {
// Create a date object for the input dateString
const inputDate = new Date(dateString);
// Create a date object for the current time in New York City
const nycTime = new Date().toLocaleString("en-US", {
timeZone: "America/New_York",
});
const currentNYCDate = new Date(nycTime);
// Calculate the difference in milliseconds
const difference = inputDate.getTime() - currentNYCDate.getTime();
// Convert the difference to minutes
const minutes = Math.abs(Math.round(difference / (1000 * 60)));
if (minutes < 60) {
return `${minutes} minutes`;
} else if (minutes < 1440) {
const hours = Math.round(minutes / 60);
return `${hours} hour${hours !== 1 ? "s" : ""}`;
} else {
const days = Math.round(minutes / 1440);
return `${days} day${days !== 1 ? "s" : ""}`;
}
};
let displaySubSection = ""; let displaySubSection = "";
if (!displaySubSection || displaySubSection.length === 0) { if (!displaySubSection || displaySubSection.length === 0) {
@ -39,73 +68,127 @@
} }
</script> </script>
<section class="w-full bg-[#09090B] overflow-hidden h-full"> <section class="w-auto overflow-hidden min-h-screen">
<div class="h-full overflow-hidden w-full"> <div class="w-full overflow-hidden m-auto">
<main class="w-full"> <div class="sm:p-0 flex justify-center w-full m-auto overflow-hidden">
<div <div
class="sm:ml-8 w-screen sm:w-full {$screenWidth < 640 class="relative flex justify-center items-start overflow-hidden w-full"
? 'overflow-auto scrollbar no-scrollbar'
: ''} mb-2"
> >
<ul <main class="w-full lg:w-3/4">
class="pr-4 sm:pr-0 w-screen flex flex-row items-center bg-[#09090B] overflow-x-scroll space-x-6 rtl:space-x-reverse py-2" <div
> class="sm:ml-8 w-screen sm:w-full {$screenWidth < 640
<li class="cursor-pointer flex flex-col items-center"> ? 'overflow-auto scrollbar no-scrollbar'
<a : ''} mb-2"
href={`/stocks/${$stockTicker}/insider`} >
on:click={() => changeSubSection("insider")} <ul
class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === class="pr-4 sm:pr-0 w-screen flex flex-row items-center bg-[#09090B] overflow-x-scroll space-x-6 rtl:space-x-reverse py-2"
'insider'
? 'text-white '
: 'bg-[#09090B]'}"
> >
Insider Trading <li class="cursor-pointer flex flex-col items-center">
</a> <a
<div href={`/stocks/${$stockTicker}/insider`}
class="{displaySubSection === 'insider' on:click={() => changeSubSection("insider")}
? 'bg-[#75D377]' class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[5rem]" 'insider'
/> ? 'text-white '
</li> : 'bg-[#09090B]'}"
<li class="cursor-pointer flex flex-col items-center"> >
<a Insider Trading
href={`/stocks/${$stockTicker}/insider/congress-trading`} </a>
on:click={() => changeSubSection("congress-trading")} <div
class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === class="{displaySubSection === 'insider'
'congress-trading' ? 'bg-[#75D377]'
? 'text-white ' : 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[5rem]"
: 'bg-[#09090B]'}" />
> </li>
Congress Trading <li class="cursor-pointer flex flex-col items-center">
</a> <a
<div href={`/stocks/${$stockTicker}/insider/congress-trading`}
class="{displaySubSection === 'congress-trading' on:click={() => changeSubSection("congress-trading")}
? 'bg-[#75D377]' class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[5rem]" 'congress-trading'
/> ? 'text-white '
</li> : 'bg-[#09090B]'}"
<li class="cursor-pointer flex flex-col items-center"> >
<a Congress Trading
href={`/stocks/${$stockTicker}/insider/transcripts`} </a>
on:click={() => changeSubSection("transcripts")} <div
class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection === class="{displaySubSection === 'congress-trading'
'transcripts' ? 'bg-[#75D377]'
? 'text-white ' : 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[5rem]"
: 'bg-[#09090B]'}" />
> </li>
Transcripts <li class="cursor-pointer flex flex-col items-center">
</a> <a
<div href={`/stocks/${$stockTicker}/insider/transcripts`}
class="{displaySubSection === 'transcripts' on:click={() => changeSubSection("transcripts")}
? 'bg-[#75D377]' class="text-sm sm:text-[1rem] font-medium text-gray-400 sm:hover:text-white {displaySubSection ===
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[3.5rem]" 'transcripts'
/> ? 'text-white '
</li> : 'bg-[#09090B]'}"
</ul> >
</div> Transcripts
</main> </a>
<div
class="{displaySubSection === 'transcripts'
? 'bg-[#75D377]'
: 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[3.5rem]"
/>
</li>
</ul>
</div>
<slot />
</main>
<slot /> <aside class="hidden lg:block relative fixed w-1/4 ml-4">
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/pricing"
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Pro Subscription
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Upgrade now for unlimited access to all data and tools.
</span>
</a>
</div>
{/if}
{#if data?.getNews?.length !== 0}
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<div class="p-4 text-sm">
<h3 class="text-lg text-white font-semibold mb-3">
{$stockTicker} News
</h3>
<ul class="text-gray-200">
{#each data?.getNews?.slice(0, 10) as item}
<li class="mb-3 last:mb-1">
{formatDate(item?.publishedDate)} ago -
<a
class="sm:hover:text-white text-blue-400"
href={item?.url}
target="_blank"
rel="noopener noreferrer nofollow">{item?.title}</a
>
- {item?.site}
</li>
{/each}
</ul>
</div>
</div>
{/if}
</aside>
</div>
</div>
</div> </div>
</section> </section>

View File

@ -1,80 +0,0 @@
<script lang="ts">
import ArrowLogo from "lucide-svelte/icons/move-up-right";
export let data;
</script>
<section class="w-full overflow-hidden min-h-screen">
<div class="w-full overflow-hidden m-auto">
<div class="sm:p-0 flex justify-center w-full m-auto overflow-hidden">
<div
class="relative flex justify-center items-start overflow-hidden w-full"
>
<main class="w-full lg:w-3/4">
<slot />
</main>
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/pricing"
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Pro Subscription 🔥
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Upgrade now for unlimited access to all data and tools.
</span>
</a>
</div>
{/if}
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/price-alert"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Price Alert ⏰
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Customize your alerts to never miss out again
</span>
</a>
</div>
<div
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/stock-screener"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
>
<div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3">
Stock Screener 🔎
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
<span class="text-white p-3 ml-3 mr-3">
Build your Stock Screener to find profitable stocks.
</span>
</a>
</div>
</aside>
</div>
</div>
</div>
</section>

View File

@ -40,17 +40,17 @@
class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer" class="w-full bg-[#141417] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-lg h-fit pb-4 mt-4 cursor-pointer"
> >
<a <a
href={"/price-alert"} href={"/options-flow"}
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0" class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
> >
<div class="w-full flex justify-between items-center p-3 mt-3"> <div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3"> <h2 class="text-start text-xl font-semibold text-white ml-3">
Price Alert ⏰ Options Flow
</h2> </h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" /> <ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div> </div>
<span class="text-white p-3 ml-3 mr-3"> <span class="text-white p-3 ml-3 mr-3">
Customize your alerts to never miss out again Get realtime options flow and customize your screener
</span> </span>
</a> </a>
</div> </div>
@ -64,7 +64,7 @@
> >
<div class="w-full flex justify-between items-center p-3 mt-3"> <div class="w-full flex justify-between items-center p-3 mt-3">
<h2 class="text-start text-xl font-semibold text-white ml-3"> <h2 class="text-start text-xl font-semibold text-white ml-3">
Stock Screener 🔎 Stock Screener
</h2> </h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" /> <ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div> </div>