This commit is contained in:
MuslemRahimi 2024-11-02 11:31:43 +01:00
parent 08e738352e
commit 102d5a36e0
37 changed files with 1060 additions and 1305 deletions

View File

@ -52,7 +52,7 @@
function getHref(symbol: string) {
let path = "";
if (symbol?.length !== 0) {
if (assetType?.toLowerCase() === "stock") {
if (["stocks", "stock"]?.includes(assetType?.toLowerCase())) {
path = `/stocks/${symbol}`;
} else if (assetType?.toLowerCase() === "etf") {
path = `/etf/${symbol}`;
@ -191,7 +191,8 @@
class=" text-sm flex flex-row items-center justify-start bg-[#09090B]"
>
<div class="flex flex-col items-start w-full">
<div class="-ml-2 flex flex-row items-center pb-1">
<div class=" flex flex-row items-center pb-1">
<!--
<Avatar.Root>
<Avatar.Image
class="w-5 h-5 rounded-full avatar text-center m-auto flex-shrink-0"
@ -199,6 +200,7 @@
/>
<Avatar.Fallback>SK</Avatar.Fallback>
</Avatar.Root>
-->
<h4 class="text-[1rem] font-semibold inline-block">{symbol}</h4>
</div>
<p>

View File

@ -465,7 +465,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -485,7 +485,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts/top-stocks"}
@ -504,7 +504,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/most-shorted-stocks"}

View File

@ -2,7 +2,7 @@
import { screenWidth, numberOfUnreadNotification } from "$lib/store";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import { onMount } from "svelte";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
export let data;
let analystStats = data?.getAnalystStats;
@ -364,12 +364,8 @@
</a>
{:else}
<div class="flex flex-col items-start">
<a
href={`/stocks/${item?.ticker}`}
class="sm:hover:text-white text-blue-400 text-sm sm:text-[1rem]"
>
{item?.ticker}
</a>
<HoverStockChart symbol={item?.ticker} />
<span class="text-white">
{item?.name?.length > charNumber
? item?.name?.slice(0, charNumber) + "..."
@ -464,7 +460,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -472,7 +468,7 @@
>
<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 Subscriptio
Pro Subscription
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
@ -484,7 +480,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts"}
@ -503,7 +499,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts/top-stocks"}

View File

@ -446,7 +446,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -466,7 +466,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts"}
@ -485,7 +485,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/most-shorted-stocks"}

View File

@ -247,7 +247,7 @@ let allBlogPosts = [
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -267,7 +267,7 @@ let allBlogPosts = [
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -284,7 +284,7 @@ let allBlogPosts = [
<div
on:click={() => goto("/analysts/top-stocks")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -137,7 +137,7 @@
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -154,7 +154,7 @@
<div
on:click={() => goto("/donation")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -171,7 +171,7 @@
<div
on:click={() => goto("/contact")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -1,10 +1,10 @@
<script lang="ts">
import { numberOfUnreadNotification, screenWidth } from "$lib/store";
import InfiniteLoading from "$lib/components/InfiniteLoading.svelte";
import { onMount } from "svelte";
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import TableHeader from "$lib/components/Table/TableHeader.svelte";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
export let data;
@ -208,12 +208,7 @@
<td
class="text-blue-400 text-sm sm:text-[1rem] text-start"
>
<a
href={"/stocks/" + item?.ticker}
class="sm:hover:text-white text-blue-400"
>
{item?.ticker}
</a>
<HoverStockChart symbol={item?.ticker} />
</td>
<td
@ -271,7 +266,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -291,7 +286,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts"}
@ -310,7 +305,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/politicians"}

View File

@ -1,12 +1,11 @@
<script lang="ts">
import { numberOfUnreadNotification, screenWidth } from "$lib/store";
import { numberOfUnreadNotification } from "$lib/store";
import { onMount } from "svelte";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
export let data;
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
let isLoaded = false;
let rawData = data?.getCramerTracker ?? [];
let displayList = rawData?.slice(0, 50) ?? [];
@ -282,12 +281,7 @@
</a>
{:else}
<div class="flex flex-col items-start">
<a
href={`/stocks/${item?.ticker}`}
class="sm:hover:text-white text-blue-400 text-sm sm:text-[1rem]"
>
{item?.ticker}
</a>
<HoverStockChart symbol={item?.ticker} />
<span class="text-white">
{item?.name?.length > charNumber
? item?.name?.slice(0, charNumber) + "..."
@ -366,7 +360,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -386,7 +380,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/reddit-tracker"}
@ -405,7 +399,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/sentiment-tracker"}

View File

@ -225,7 +225,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -245,7 +245,7 @@
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -262,7 +262,7 @@
<div
on:click={() => goto("/analysts/top-stocks")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -511,7 +511,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -531,7 +531,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/earnings-calendar"}
@ -550,7 +550,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/economic-calendar"}

View File

@ -210,7 +210,7 @@
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -227,7 +227,7 @@
<div
on:click={() => goto("/about")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -244,7 +244,7 @@
<div
on:click={() => goto("/contact")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -576,7 +576,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -596,7 +596,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/dividends-calendar"}
@ -615,7 +615,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/economic-calendar"}

View File

@ -724,7 +724,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -744,7 +744,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/earnings-calendar"}
@ -763,7 +763,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/dividends-calendar"}

View File

@ -918,7 +918,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -938,7 +938,7 @@
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -955,7 +955,7 @@
<div
on:click={() => goto("/politicians")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -234,7 +234,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -254,7 +254,7 @@
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -271,7 +271,7 @@
<div
on:click={() => goto("/analysts/top-stocks")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -222,7 +222,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -242,7 +242,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts"}
@ -261,7 +261,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/politicians"}

View File

@ -314,7 +314,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -334,7 +334,7 @@
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -351,7 +351,7 @@
<div
on:click={() => goto("/politicians")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -253,7 +253,7 @@
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -270,7 +270,7 @@
<div
on:click={() => goto("/donation")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -287,7 +287,7 @@
<div
on:click={() => goto("/contact")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -5,9 +5,9 @@
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import TableHeader from "$lib/components/Table/TableHeader.svelte";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
export let data;
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
let isLoaded = true;
let rawData = data?.getInsiderTracker ?? [];
@ -226,12 +226,7 @@
</td>
<td class="text-sm sm:text-[1rem] text-start">
<a
href={"/stocks/" + item?.symbol}
class="sm:hover:text-white text-blue-400"
>
{item?.symbol}
</a>
<HoverStockChart symbol={item?.symbol} />
</td>
<td
@ -311,7 +306,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/pricing"
@ -331,7 +326,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/sentiment-tracker"
@ -350,7 +345,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/reddit-tracker"

View File

@ -138,7 +138,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -158,7 +158,7 @@
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -175,7 +175,7 @@
<div
on:click={() => goto("/politicians")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -263,7 +263,7 @@
<aside class="hidden lg:block relative fixed w-1/4 -mt-4">
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -283,7 +283,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/watchlist/stocks"}
@ -302,7 +302,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/stock-screener"}

View File

@ -538,7 +538,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -558,7 +558,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts"}
@ -577,7 +577,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/politicians"}

View File

@ -35,9 +35,9 @@
</svelte:head>
<section
class="w-full max-w-3xl sm:max-w-screen-2xl overflow-hidden min-h-screen pt-5 pb-40 lg:px-3"
class="w-full max-w-3xl sm:max-w-screen-2xl overflow-hidden pb-20 pt-5 px-4 lg:px-3"
>
<div class="text-sm sm:text-[1rem] breadcrumbs ml-4">
<div class="text-sm sm:text-[1rem] breadcrumbs">
<ul>
<li><a href="/" class="text-gray-300">Home</a></li>
<li class="text-gray-300">Market News</li>
@ -50,86 +50,26 @@
class="relative flex justify-center items-start overflow-hidden w-full"
>
<main class="w-full lg:w-3/4 lg:pr-5">
<div
class="w-full m-auto sm:bg-[#27272A] sm:rounded-xl h-auto pl-10 pr-10 pt-5 sm:pb-10 sm:pt-10 mt-3 mb-8"
>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-10">
<!-- Start Column -->
<div>
<div class="flex flex-row justify-center items-center">
<h1
class="text-3xl sm:text-4xl text-white text-center font-bold mb-5"
>
Market News
<h1 class="mb-6 text-white text-2xl sm:text-3xl font-bold">
Stock Market News
</h1>
</div>
<span
class="hidden sm:block text-white text-md font-medium text-center flex justify-center items-center"
>
Flush your stock worries away with our website's latest news!
</span>
</div>
<!-- End Column -->
<!-- Start Column -->
<div
class="hidden sm:block relative m-auto mb-5 mt-5 sm:mb-0 sm:mt-0"
>
<svg
class="w-40 -my-5"
viewBox="0 0 200 200"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<filter id="glow">
<feGaussianBlur stdDeviation="5" result="glow" />
<feMerge>
<feMergeNode in="glow" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
<path
fill="#1E40AF"
d="M57.6,-58.7C72.7,-42.6,81.5,-21.3,82,0.5C82.5,22.3,74.7,44.6,59.7,60.1C44.6,75.6,22.3,84.3,0,84.3C-22.3,84.2,-44.6,75.5,-61.1,60.1C-77.6,44.6,-88.3,22.3,-87.6,0.7C-86.9,-20.8,-74.7,-41.6,-58.2,-57.7C-41.6,-73.8,-20.8,-85.2,0.2,-85.4C21.3,-85.6,42.6,-74.7,57.6,-58.7Z"
transform="translate(100 100)"
filter="url(#glow)"
/>
</svg>
<div class="z-1 absolute top-1 right-10">
<img class="w-24 mr-1" src={logo} alt="logo" loading="lazy" />
</div>
</div>
<!-- End Column -->
</div>
</div>
<div
class="bg-[#313131] w-52 sm:w-fit relative m-auto sm:m-0 sm:mr-auto flex sm:flex-wrap items-center justify-center rounded-lg p-1 -mt-3"
<nav class=" border-b-[2px] overflow-x-scroll whitespace-nowrap">
<ul
class="flex flex-row items-center w-full text-[1rem] sm:text-lg text-white"
>
{#each tabs as item, i}
<a
href={item?.path}
class="group relative z-[1] rounded-full px-6 py-1 {activeIdx ===
i
? 'z-0'
: ''} "
>
{#if activeIdx === i}
<div class="absolute inset-0 rounded-lg bg-purple-600"></div>
{/if}
<span
class="relative text-[1rem] sm:text-lg block font-semibold duration-200 text-white"
class="p-2 px-5 cursor-pointer {activeIdx === i
? 'text-white bg-[#27272A] sm:hover:bg-opacity-[0.95]'
: 'text-gray-400 sm:hover:text-white sm:hover:bg-[#27272A] sm:hover:bg-opacity-[0.95]'}"
>
{item.title}
</span>
</a>
{/each}
</div>
<div class="border-b mt-5 border-slate-700" />
</ul>
</nav>
<slot />
@ -139,7 +79,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -147,7 +87,7 @@
>
<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 🔥
Pro Subscription
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
@ -159,7 +99,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/earnings-calendar"}
@ -167,7 +107,7 @@
>
<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">
Earnings Calendar 🌟
Earnings Calendar
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
@ -178,7 +118,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/dividends-calendar"}
@ -186,7 +126,7 @@
>
<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">
Dividend Calendar 💸
Dividend Calendar
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
@ -197,7 +137,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/economic-calendar"}
@ -205,7 +145,7 @@
>
<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">
Economic Events 🌍
Economic Events
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>

View File

@ -1,21 +1,20 @@
<script lang="ts">
import { numberOfUnreadNotification } from "$lib/store";
import { onMount } from "svelte";
export let data;
import { numberOfUnreadNotification } from '$lib/store';
import { onMount } from 'svelte';
let rawData = data?.getMarketNews;
let news = rawData.slice(0, 15) ?? [];
export let data;
let rawData = data?.getMarketNews;
let news = rawData.slice(0,15) ?? [];
const formatDate = (dateString) => {
// Create a date object for the input dateString
const inputDate = new Date(dateString);
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 nycTime = new Date().toLocaleString("en-US", {
timeZone: "America/New_York",
});
const currentNYCDate = new Date(nycTime);
// Calculate the difference in milliseconds
@ -28,13 +27,12 @@ const inputDate = new Date(dateString);
return `${minutes} minutes`;
} else if (minutes < 1440) {
const hours = Math.round(minutes / 60);
return `${hours} hour${hours !== 1 ? 's' : ''}`;
return `${hours} hour${hours !== 1 ? "s" : ""}`;
} else {
const days = Math.round(minutes / 1440);
return `${days} day${days !== 1 ? 's' : ''}`;
return `${days} day${days !== 1 ? "s" : ""}`;
}
};
};
async function handleScroll() {
const scrollThreshold = document.body.offsetHeight * 0.8; // 80% of the website height
@ -47,21 +45,19 @@ const inputDate = new Date(dateString);
}
onMount(async () => {
window.addEventListener('scroll', handleScroll);
window.addEventListener("scroll", handleScroll);
return () => {
window.removeEventListener('scroll', handleScroll);
window.removeEventListener("scroll", handleScroll);
};
})
});
let videoId = null;
function checkIfYoutubeVideo(link) {
let videoId = null;
function checkIfYoutubeVideo(link) {
const url = new URL(link);
if (url.hostname === "www.youtube.com") {
const searchParams = url.searchParams;
searchParams?.delete('t'); // Remove the "t" parameter
searchParams?.delete("t"); // Remove the "t" parameter
const videoIdMatch = url?.search?.match(/v=([^&]+)/);
if (videoIdMatch) {
@ -70,47 +66,58 @@ function checkIfYoutubeVideo(link) {
} else {
return null;
}
}
}
</script>
<svelte:head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} Today's
Stock Market News and Breaking Stories · stocknear
</title>
<meta
name="description"
content={`Get the latest stock market news and breaking stories from the world's best finance and investing websites.`}
/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Today's Stock Market News and Breaking Stories · stocknear
</title>
<meta name="description" content={`Get the latest stock market news and breaking stories from the world's best finance and investing websites.`} />
<!-- Other meta tags -->
<meta property="og:title" content={`Today's Stock Market News and Breaking Stories · stocknear`}/>
<meta property="og:description" content={`Get the latest stock market news and breaking stories from the world's best finance and investing websites.`} />
<meta property="og:type" content="website"/>
<!-- Add more Open Graph meta tags as needed -->
<!-- Twitter specific meta tags -->
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:title" content={`Today's Stock Market News and Breaking Stories · stocknear`}/>
<meta name="twitter:description" content={`Get the latest stock market news and breaking stories from the world's best finance and investing websites.`} />
<!-- Add more Twitter meta tags as needed -->
<!-- Other meta tags -->
<meta
property="og:title"
content={`Today's Stock Market News and Breaking Stories · stocknear`}
/>
<meta
property="og:description"
content={`Get the latest stock market news and breaking stories from the world's best finance and investing websites.`}
/>
<meta property="og:type" content="website" />
<!-- Add more Open Graph meta tags as needed -->
<!-- Twitter specific meta tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:title"
content={`Today's Stock Market News and Breaking Stories · stocknear`}
/>
<meta
name="twitter:description"
content={`Get the latest stock market news and breaking stories from the world's best finance and investing websites.`}
/>
<!-- Add more Twitter meta tags as needed -->
</svelte:head>
<section class="w-full overflow-hidden m-auto mt-10">
<div class="flex justify-center w-full m-auto overflow-hidden">
<div class="relative flex justify-center items-center overflow-hidden">
<main>
<div class="w-screen sm:w-full m-auto">
<div class="w-full m-auto">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-5">
{#if news.length !== 0}
{#each news as item}
<div class="flex flex-col w-full mt-5 bg-[#141417] shadow-lg h-auto sm:h-[450px] xl:h-[430px] pb-10 sm:pb-5 rounded-none sm:rounded-lg m-auto">
{#if videoId = checkIfYoutubeVideo(item.url)}
<div
class="flex flex-col w-full mt-5 bg-[#141417] shadow-lg h-auto sm:h-[450px] xl:h-[430px] pb-10 sm:pb-5 rounded-md m-auto"
>
{#if (videoId = checkIfYoutubeVideo(item.url))}
<iframe
class="w-full h-60 rounded-none sm:rounded-lg"
src={`https://www.youtube.com/embed/${videoId}`}
@ -120,16 +127,31 @@ function checkIfYoutubeVideo(link) {
></iframe>
{:else}
<a href={item.url} target="_blank">
<div class="h-48 sm:h-60 m-auto border border-slate-800 rounded-none sm:rounded-lg ">
<img src={item?.image} class="w-screen sm:w-full object-cover h-48 sm:h-60 rounded-none sm:rounded-t-lg" alt="news image" loading="lazy">
<div
class="h-48 sm:h-60 m-auto border border-gray-600 rounded-none sm:rounded-lg"
>
<img
src={item?.image}
class="w-full object-cover h-48 sm:h-60 rounded-none sm:rounded-t-lg"
alt="news image"
loading="lazy"
/>
</div>
</a>
{/if}
<div class="pl-3 pr-3">
<label class="mt-3 mb-3 cursor-pointer text-xs text-gray-200 flex flex-row items-center">
<div class="rounded-full w-6 h-6 relative bg-gray-800 mr-1.5 mb-0.5">
<img class="rounded-full w-4 h-4 absolute inset-1/2 transform -translate-x-1/2 -translate-y-1/2" src={`https://financialmodelingprep.com/image-stock/${item?.symbol}.png`} loading="lazy" />
<label
class="mt-3 mb-3 cursor-pointer text-xs text-gray-200 flex flex-row items-center"
>
<div
class="rounded-full w-6 h-6 relative bg-gray-800 mr-1.5 mb-0.5"
>
<img
class="rounded-full w-4 h-4 absolute inset-1/2 transform -translate-x-1/2 -translate-y-1/2"
src={`https://financialmodelingprep.com/image-stock/${item?.symbol}.png`}
loading="lazy"
/>
</div>
{item?.symbol} · {formatDate(item?.publishedDate)} ago
<span class="ml-auto text-gray-300 italic text-xs mr-2">
@ -137,29 +159,27 @@ function checkIfYoutubeVideo(link) {
</span>
</label>
<a href={item.url} target="_blank" class="text-lg font-bold text-white">
{item?.title?.length > 120 ? item?.title?.slice(0,120) +'...' : item?.title}
<a
href={item.url}
target="_blank"
class="text-lg font-bold text-white"
>
{item?.title?.length > 120
? item?.title?.slice(0, 120) + "..."
: item?.title}
</a>
<p class="text-white text-sm mt-2">
{item?.text?.length > 100 ? item?.text?.slice(0,100) + "..." : item?.text}
{item?.text?.length > 100
? item?.text?.slice(0, 100) + "..."
: item?.text}
</p>
</div>
</div>
{/each}
{/if}
</div>
</div>
</main>
</div>
</div>
</section>

View File

@ -1,21 +1,20 @@
<script lang="ts">
import { numberOfUnreadNotification } from "$lib/store";
import { onMount } from "svelte";
export let data;
import { numberOfUnreadNotification } from '$lib/store';
import { onMount } from 'svelte';
let rawData = data?.getGeneralNews;
let news = rawData.slice(0, 15) ?? [];
export let data;
let rawData = data?.getGeneralNews;
let news = rawData.slice(0,15) ?? [];
const formatDate = (dateString) => {
// Create a date object for the input dateString
const inputDate = new Date(dateString);
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 nycTime = new Date().toLocaleString("en-US", {
timeZone: "America/New_York",
});
const currentNYCDate = new Date(nycTime);
// Calculate the difference in milliseconds
@ -28,13 +27,12 @@ const inputDate = new Date(dateString);
return `${minutes} minutes`;
} else if (minutes < 1440) {
const hours = Math.round(minutes / 60);
return `${hours} hour${hours !== 1 ? 's' : ''}`;
return `${hours} hour${hours !== 1 ? "s" : ""}`;
} else {
const days = Math.round(minutes / 1440);
return `${days} day${days !== 1 ? 's' : ''}`;
return `${days} day${days !== 1 ? "s" : ""}`;
}
};
};
async function handleScroll() {
const scrollThreshold = document.body.offsetHeight * 0.8; // 80% of the website height
@ -47,21 +45,19 @@ const inputDate = new Date(dateString);
}
onMount(async () => {
window.addEventListener('scroll', handleScroll);
window.addEventListener("scroll", handleScroll);
return () => {
window.removeEventListener('scroll', handleScroll);
window.removeEventListener("scroll", handleScroll);
};
})
});
let videoId = null;
function checkIfYoutubeVideo(link) {
let videoId = null;
function checkIfYoutubeVideo(link) {
const url = new URL(link);
if (url.hostname === "www.youtube.com") {
const searchParams = url.searchParams;
searchParams?.delete('t'); // Remove the "t" parameter
searchParams?.delete("t"); // Remove the "t" parameter
const videoIdMatch = url?.search?.match(/v=([^&]+)/);
if (videoIdMatch) {
@ -70,49 +66,58 @@ function checkIfYoutubeVideo(link) {
} else {
return null;
}
}
}
</script>
<svelte:head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} Today's
General News and Breaking Stories · stocknear
</title>
<meta
name="description"
content={`Get the latest general news and breaking stories from the world's best finance and investing websites.`}
/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Today's General News and Breaking Stories · stocknear
</title>
<meta name="description" content={`Get the latest general news and breaking stories from the world's best finance and investing websites.`} />
<!-- Other meta tags -->
<meta property="og:title" content={`Today's General News and Breaking Stories · stocknear`}/>
<meta property="og:description" content={`Get the latest general news and breaking stories from the world's best finance and investing websites.`} />
<meta property="og:type" content="website"/>
<!-- Add more Open Graph meta tags as needed -->
<!-- Twitter specific meta tags -->
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:title" content={`Today's General News and Breaking Stories · stocknear`}/>
<meta name="twitter:description" content={`Get the latest general news and breaking stories from the world's best finance and investing websites.`} />
<!-- Add more Twitter meta tags as needed -->
<!-- Other meta tags -->
<meta
property="og:title"
content={`Today's General News and Breaking Stories · stocknear`}
/>
<meta
property="og:description"
content={`Get the latest general news and breaking stories from the world's best finance and investing websites.`}
/>
<meta property="og:type" content="website" />
<!-- Add more Open Graph meta tags as needed -->
<!-- Twitter specific meta tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:title"
content={`Today's General News and Breaking Stories · stocknear`}
/>
<meta
name="twitter:description"
content={`Get the latest general news and breaking stories from the world's best finance and investing websites.`}
/>
<!-- Add more Twitter meta tags as needed -->
</svelte:head>
<section class="w-full overflow-hidden m-auto mt-10">
<div class="flex justify-center w-full m-auto overflow-hidden">
<div class="relative flex justify-center items-center overflow-hidden">
<main>
<div class="w-screen sm:w-full m-auto">
<div class="w-full m-auto">
<div class="grid grid-cols-1 sm:grid-cols-2 gap-5">
{#if news?.length !== 0}
{#each news as item}
<div class="flex flex-col w-full mt-5 bg-[#27272A] shadow-lg h-auto sm:h-[420px] pb-10 sm:pb-5 rounded-none sm:rounded-lg m-auto">
{#if videoId = checkIfYoutubeVideo(item.url)}
<div
class="flex flex-col w-full mt-5 bg-[#27272A] shadow-lg h-auto sm:h-[420px] pb-10 sm:pb-5 rounded-md m-auto"
>
{#if (videoId = checkIfYoutubeVideo(item.url))}
<iframe
class="w-full h-60 rounded-none sm:rounded-lg"
src={`https://www.youtube.com/embed/${videoId}`}
@ -122,47 +127,49 @@ function checkIfYoutubeVideo(link) {
></iframe>
{:else}
<a href={item?.url} target="_blank">
<div class="h-48 sm:h-60 m-auto border border-slate-800 rounded-none sm:rounded-lg ">
<img src={item?.image} class="w-screen sm:w-full object-cover h-48 sm:h-60 rounded-none sm:rounded-t-lg" alt="news image" loading="lazy">
<div
class="h-48 sm:h-60 m-auto border border-slate-800 rounded-none sm:rounded-lg"
>
<img
src={item?.image}
class="w-full object-cover h-48 sm:h-60 rounded-none sm:rounded-t-lg"
alt="news image"
loading="lazy"
/>
</div>
</a>
{/if}
<div class="pl-3 pr-3">
<label class="mt-3 mb-3 cursor-pointer text-xs text-gray-200 flex flex-row items-center">
Source: {item?.source} · {formatDate(item?.datetime*1000)} ago
<label
class="mt-3 mb-3 cursor-pointer text-xs text-gray-200 flex flex-row items-center"
>
Source: {item?.source} · {formatDate(
item?.datetime * 1000,
)} ago
</label>
<a href={item?.url} target="_blank" class="text-lg font-bold text-white">
{item?.headline?.length > 120 ? item?.headline?.slice(0,120) + "..." : item?.headline}
<a
href={item?.url}
target="_blank"
class="text-lg font-bold text-white"
>
{item?.headline?.length > 120
? item?.headline?.slice(0, 120) + "..."
: item?.headline}
</a>
<p class="text-white text-sm mt-2">
{item?.summary?.length > 100 ? item?.summary?.slice(0,100) + "..." : item?.summary}
{item?.summary?.length > 100
? item?.summary?.slice(0, 100) + "..."
: item?.summary}
</p>
</div>
</div>
{/each}
{/if}
</div>
</div>
</main>
</div>
</div>
</section>

View File

@ -303,7 +303,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -323,7 +323,7 @@
<div
on:click={() => goto("/cramer-tracker")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -340,7 +340,7 @@
<div
on:click={() => goto("/reddit-tracker")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -5,9 +5,8 @@
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import TableHeader from "$lib/components/Table/TableHeader.svelte";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
export let data;
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
let isLoaded = false;
let rawData = [];
@ -211,12 +210,7 @@
<td
class="text-sm sm:text-[1rem] whitespace-nowrap text-start"
>
<a
href={"/stocks/" + item?.symbol}
class="sm:hover:text-white text-blue-400"
>
{item?.symbol}
</a>
<HoverStockChart symbol={item?.symbol} />
</td>
<td
@ -278,7 +272,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -298,7 +292,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts"}
@ -317,7 +311,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts/top-stocks"}

View File

@ -3,6 +3,7 @@
import { getPartyForPoliticians } from "$lib/utils";
import { screenWidth, numberOfUnreadNotification } from "$lib/store";
import { onMount } from "svelte";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
//import UpgradeToPro from '$lib/components/UpgradeToPro.svelte';
import ArrowLogo from "lucide-svelte/icons/move-up-right";
@ -25,8 +26,6 @@
let changeRowFilter = false;
let changeRuleFilter = false;
const rowList = [10, 20, 50, 100, 200];
async function handleScroll() {
const scrollThreshold = document.body.offsetHeight * 0.8; // 80% of the website height
const isBottom = window.innerHeight + window.scrollY >= scrollThreshold;
@ -37,18 +36,6 @@
}
}
function changeRows(rows: Number) {
changeRowFilter = true;
displayRows = rows;
}
function changeStructure() {
if (displayStructure === "Card") {
displayStructure = "Table";
} else {
displayStructure = "Card";
}
}
onMount(async () => {
rawData?.forEach((item) => {
let representative = item?.representative || "";
@ -106,225 +93,7 @@
return `${firstName?.charAt(0)}. ${lastName}`;
}
const exportData = (format = "csv") => {
const data = slicedRawData;
if (!data || data.length === 0) {
return;
}
let properties = [
{ key: "disclosureDate", label: "Disclosure Date" },
{ key: "transactionDate", label: "Transaction Date" },
{ key: "owner", label: "Owner" },
{ key: "ticker", label: "Ticker" },
{ key: "assetDescription", label: "Asset Description" },
{ key: "type", label: "Type" },
{ key: "amount", label: "Amount" },
{ key: "representative", label: "Representative" },
{ key: "district", label: "District" },
{ key: "link", label: "Link" },
{ key: "capitalGainsOver200USD", label: "Capital Gains Over $200" },
{ key: "assetType", label: "Asset Type" },
{ key: "party", label: "Party" },
];
// Create rows for CSV/Excel
let rows = data?.map((item) =>
properties?.map((property) => item[property.key] || ""),
);
// Include headers
const headers = properties.map((prop) => prop.label);
rows.unshift(headers);
// Check the format to export
if (format.toLowerCase() === "csv") {
const csvContent = rows.map((row) => row.join(",")).join("\n");
const blob = new Blob([csvContent], {
type: "data:text/csv;charset=utf-8",
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "data.csv";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
} else if (format.toLowerCase() === "excel") {
/*
const worksheet = XLSX.utils.aoa_to_sheet(rows);
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1");
XLSX.writeFile(workbook, "data.xlsx");
*/
}
};
async function handleFilter(e, newFilter) {
//e.preventDefault();
changeRuleFilter = true;
const filterSet = new Set(filterList);
// Check if the new filter already exists in the list
if (filterSet?.has(newFilter)) {
// If it exists, remove it from the list
filterSet?.delete(newFilter);
} else {
// If it doesn't exist, add it to the list
filterSet?.add(newFilter);
}
filterList = Array?.from(filterSet);
//console.log(filterList)
changeRuleFilter = true;
}
function filterData(data) {
const newData = data?.filter((item) => {
//Bought only nested conditions
if (
filterList?.includes("Bought") &&
item?.type === "Bought" &&
!filterList?.includes("Democratic") &&
!filterList?.includes("Republican") &&
!filterList?.includes("Other")
) {
return true;
}
//Sell only nested conditions
if (
filterList?.includes("Sold") &&
item?.type === "Sold" &&
!filterList?.includes("Democratic") &&
!filterList?.includes("Republican") &&
!filterList?.includes("Other")
) {
return true;
}
//Amount only nested conditions
if (
filterList?.includes("$1,001 - $15,000") &&
item?.amount === "$1,001 - $15,000"
) {
return true;
}
//Democratic Party nested conditions
if (
filterList?.includes("Democratic") &&
item?.party &&
item?.party?.toLowerCase() === "democratic"
) {
if (!filterList?.includes("Sold") && !filterList?.includes("Bought")) {
return true;
} else if (
filterList?.includes("Democratic") &&
item?.party &&
item?.party?.toLowerCase() === "democratic" &&
filterList?.includes("Bought") &&
item?.type === "Bought"
) {
return true;
} else if (
filterList?.includes("Democratic") &&
item?.party &&
item?.party?.toLowerCase() === "democratic" &&
filterList?.includes("Sold") &&
item?.type === "Sold"
) {
return true;
}
}
//Republican Party nested conditions
if (
filterList?.includes("Republican") &&
item?.party &&
item?.party?.toLowerCase() === "republican"
) {
if (!filterList?.includes("Sold") && !filterList?.includes("Bought")) {
return true;
} else if (
filterList.includes("Republican") &&
item?.party &&
item?.party?.toLowerCase() === "republican" &&
filterList?.includes("Bought") &&
item?.type === "Bought"
) {
return true;
} else if (
filterList.includes("Republican") &&
item?.party &&
item?.party?.toLowerCase() === "republican" &&
filterList?.includes("Sold") &&
item?.type === "Sold"
) {
return true;
}
}
//Other Party nested conditions
if (
filterList?.includes("Other") &&
item?.party &&
item?.party?.toLowerCase() === "other"
) {
if (!filterList?.includes("Sold") && !filterList?.includes("Bought")) {
return true;
} else if (
filterList.includes("Other") &&
item?.party &&
item?.party?.toLowerCase() === "other" &&
filterList?.includes("Bought") &&
item?.type === "Bought"
) {
return true;
} else if (
filterList.includes("Other") &&
item?.party &&
item?.party?.toLowerCase() === "other" &&
filterList?.includes("Sold") &&
item?.type === "Sold"
) {
return true;
}
} else {
return false;
}
});
return newData;
}
$: charNumber = $screenWidth < 640 ? 20 : 40;
$: {
if (displayRows && changeRowFilter === true) {
slicedRawData = rawData?.slice(0, displayRows);
slicedRawData =
filterList?.length !== 0 ? filterData(slicedRawData) : slicedRawData;
slicedRawData = [...slicedRawData];
displayList = slicedRawData?.slice(0, 20) ?? [];
displayList = [...displayList];
changeRowFilter = false;
}
}
$: {
if (filterList && changeRuleFilter === true) {
slicedRawData = rawData?.slice(0, displayRows);
slicedRawData =
filterList?.length !== 0 ? filterData(slicedRawData) : slicedRawData;
slicedRawData = [...slicedRawData];
displayList = slicedRawData?.slice(0, 20) ?? [];
displayList = [...displayList];
changeRuleFilter = false;
//console.log(slicedRawData?.length)
}
}
</script>
<!-- HEADER FOR BETTER SEO -->
@ -366,9 +135,9 @@
</svelte:head>
<section
class="w-full max-w-3xl sm:max-w-screen-2xl overflow-hidden min-h-screen pt-5 pb-40 lg:px-3"
class="w-full max-w-3xl sm:max-w-screen-2xl overflow-hidden pb-20 pt-5 px-4 lg:px-3"
>
<div class="text-sm sm:text-[1rem] breadcrumbs ml-4">
<div class="text-sm sm:text-[1rem] breadcrumbs">
<ul>
<li><a href="/" class="text-gray-300">Home</a></li>
<li class="text-gray-300">Congress Flow</li>
@ -381,74 +150,16 @@
class="relative flex justify-center items-start overflow-hidden w-full"
>
<main class="w-full lg:w-3/4 lg:pr-5">
<div
class="w-full m-auto sm:bg-[#27272A] sm:rounded-xl h-auto pl-10 pr-10 pt-5 sm:pb-10 sm:pt-10 mt-3 mb-8"
>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-10">
<!-- Start Column -->
<div>
<div class="flex flex-row justify-center items-center">
<h1
class="text-3xl sm:text-4xl text-white text-center font-bold mb-5 w-80 whitespace-normal"
>
<div class="mb-6 border-b-[2px]">
<h1 class="mb-1 text-white text-2xl sm:text-3xl font-bold">
Latest Trades of Politicians
</h1>
</div>
<span
class="hidden sm:block text-white text-md font-medium text-center flex justify-center items-center"
>
Gain from monitoring the latest trades of corrupt U.S.
politicians
</span>
</div>
<!-- End Column -->
<!-- Start Column -->
<div
class="hidden sm:block relative m-auto mb-5 mt-5 sm:mb-0 sm:mt-0"
>
<svg
class="w-40 -my-5"
viewBox="0 0 200 200"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<filter id="glow">
<feGaussianBlur stdDeviation="5" result="glow" />
<feMerge>
<feMergeNode in="glow" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
<path
fill="#1E40AF"
d="M57.6,-58.7C72.7,-42.6,81.5,-21.3,82,0.5C82.5,22.3,74.7,44.6,59.7,60.1C44.6,75.6,22.3,84.3,0,84.3C-22.3,84.2,-44.6,75.5,-61.1,60.1C-77.6,44.6,-88.3,22.3,-87.6,0.7C-86.9,-20.8,-74.7,-41.6,-58.2,-57.7C-41.6,-73.8,-20.8,-85.2,0.2,-85.4C21.3,-85.6,42.6,-74.7,57.6,-58.7Z"
transform="translate(100 100)"
filter="url(#glow)"
/>
</svg>
<div class="z-1 absolute top-2 right-0">
<img
class="w-24 mr-8"
src={cloudFrontUrl + "/assets/politician_logo.png"}
alt="logo"
loading="lazy"
/>
</div>
</div>
<!-- End Column -->
</div>
</div>
<body class="w-full overflow-hidden m-auto">
{#if isLoaded}
<section class="w-full overflow-hidden m-auto sm:mt-10">
<div
class="p-3 sm:p-0 flex justify-center w-full m-auto overflow-hidden"
>
<div class=" flex justify-center w-full m-auto overflow-hidden">
<div
class="relative flex justify-center items-center overflow-hidden w-full"
>
@ -458,7 +169,7 @@
class="w-full m-auto rounded-none sm:rounded-lg mb-4 overflow-x-scroll sm:overflow-hidden"
>
<table
class="table table-sm sm:table-md table-pin-cols table-compact rounded-none sm:rounded-md w-full bg-[#09090B] border-bg-[#09090B] m-auto"
class="table table-sm table-pin-cols table-compact rounded-none sm:rounded-md w-full bg-[#09090B] border-bg-[#09090B] m-auto"
>
<thead>
<tr
@ -474,15 +185,11 @@
>
Company
</td>
<td
class="text-end bg-[#09090B] text-white text-sm font-medium sm:font-semibold"
>
Transaction
</td>
<td
class="text-end bg-[#09090B] text-white text-sm font-medium sm:font-semibold"
>
Disclosure
Date
</td>
<td
class="text-center bg-[#09090B] text-white text-sm font-medium sm:font-semibold"
@ -551,18 +258,11 @@
class="text-start whitespace-nowrap text-sm sm:text-[1rem] text-blue-400"
>
<div class="flex flex-col items-start">
<a
href={item?.assetType === "stock"
? `/stocks/${item?.ticker}`
: item?.assetType ===
("etf" || "crypto")
? `/${item?.assetType}/${item?.ticker}`
: "#"}
class="sm:hover:text-white text-blue-400"
>{item?.ticker?.length !== 0
? item?.ticker
: "-"}</a
>
<HoverStockChart
symbol={item?.ticker}
assetType={item?.assetType}
/>
<span class="text-white"
>{item?.assetDescription.length >
charNumber
@ -582,19 +282,6 @@
</div>
</td>
<td
class="text-end text-sm sm:text-[1rem] text-white whitespace-nowrap"
>
{new Date(
item?.transactionDate,
)?.toLocaleString("en-US", {
month: "short",
day: "numeric",
year: "numeric",
daySuffix: "2-digit",
})}
</td>
<td
class="text-end text-sm sm:text-[1rem] text-white whitespace-nowrap"
>
@ -657,7 +344,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/pricing"}
@ -665,7 +352,7 @@
>
<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 🔥
Pro Subscription
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
@ -677,7 +364,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts"}
@ -685,7 +372,7 @@
>
<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 Analyst 📊
Top Analyst
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>
@ -696,7 +383,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/politicians"}
@ -704,7 +391,7 @@
>
<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">
Congress Trading 🇺🇸
Congress Trading
</h2>
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
</div>

View File

@ -565,7 +565,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -584,7 +584,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/watchlist/stocks"}
@ -603,7 +603,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/stock-screener"}

View File

@ -333,7 +333,7 @@
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -350,7 +350,7 @@
<div
on:click={() => goto("/donation")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -367,7 +367,7 @@
<div
on:click={() => goto("/contact")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -1,21 +1,23 @@
<script lang='ts'>
import { numberOfUnreadNotification, screenWidth } from '$lib/store';
import { onMount } from 'svelte';
import * as Card from "$lib/components/shadcn/card/index.ts";
import * as Table from "$lib/components/shadcn/table/index.ts";
<svelte:options immutable={true} />
//import UpgradeToPro from '$lib/components/UpgradeToPro.svelte';
import { abbreviateNumber } from '$lib/utils';
import { Chart } from 'svelte-echarts'
import Link from "lucide-svelte/icons/external-link";
import ThumbsUp from "lucide-svelte/icons/thumbs-up";
import MessageCircle from "lucide-svelte/icons/message-circle";
import Lazy from '$lib/components/Lazy.svelte';
import { init, use } from 'echarts/core'
import { LineChart, BarChart } from 'echarts/charts'
import { GridComponent, TooltipComponent } from 'echarts/components'
import { CanvasRenderer } from 'echarts/renderers'
use([LineChart, BarChart, GridComponent, TooltipComponent, CanvasRenderer])
<script lang="ts">
import { numberOfUnreadNotification, screenWidth } from "$lib/store";
import { onMount } from "svelte";
import * as Card from "$lib/components/shadcn/card/index.ts";
import * as Table from "$lib/components/shadcn/table/index.ts";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
//import UpgradeToPro from '$lib/components/UpgradeToPro.svelte';
import { abbreviateNumber } from "$lib/utils";
import { Chart } from "svelte-echarts";
import Link from "lucide-svelte/icons/external-link";
import ThumbsUp from "lucide-svelte/icons/thumbs-up";
import MessageCircle from "lucide-svelte/icons/message-circle";
import Lazy from "$lib/components/Lazy.svelte";
import { init, use } from "echarts/core";
import { LineChart, BarChart } from "echarts/charts";
import { GridComponent, TooltipComponent } from "echarts/components";
import { CanvasRenderer } from "echarts/renderers";
use([LineChart, BarChart, GridComponent, TooltipComponent, CanvasRenderer]);
export let data;
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
@ -28,16 +30,24 @@ use([LineChart, BarChart, GridComponent, TooltipComponent, CanvasRenderer])
let commentList = [];
let numCompanyList = [];
function formatUtcTimestamp(timestamp) {
// Create a Date object from the UTC timestamp (in seconds)
let date = new Date(timestamp * 1000);
// Define arrays for month names
const monthNames = [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
// Extract date components
@ -48,10 +58,10 @@ use([LineChart, BarChart, GridComponent, TooltipComponent, CanvasRenderer])
let minutes = date.getUTCMinutes();
// Format minutes to always be two digits
minutes = minutes < 10 ? '0' + minutes : minutes;
minutes = minutes < 10 ? "0" + minutes : minutes;
// Determine AM or PM suffix and adjust hours for 12-hour format
let amPm = hours >= 12 ? 'PM' : 'AM';
let amPm = hours >= 12 ? "PM" : "AM";
hours = hours % 12;
hours = hours ? hours : 12; // the hour '0' should be '12'
@ -59,287 +69,305 @@ use([LineChart, BarChart, GridComponent, TooltipComponent, CanvasRenderer])
let formattedDate = `${day} ${month} ${year}, ${hours}:${minutes} ${amPm}`;
return formattedDate;
}
}
function removeHttpsStrings(input) {
// Split the input string by spaces
let words = input?.split(' ');
let words = input?.split(" ");
// Filter out words that contain "https"
let filteredWords = words?.filter(word => !word?.includes('https'));
let filteredWords = words?.filter((word) => !word?.includes("https"));
// Join the filtered words back into a single string
let output = filteredWords?.join(' ');
let output = filteredWords?.join(" ");
return output;
}
function getPlotOptions() {
}
function getPlotOptions() {
let rawData = data?.getRedditTracker?.stats;
rawData = rawData?.sort((a, b) => new Date(a?.date) - new Date(b?.date));
let dates = [];
rawData?.forEach(item => {
rawData?.forEach((item) => {
dates?.push(item?.date);
postList?.push(item?.totalPosts);
commentList?.push(item?.totalComments)
numCompanyList?.push(item?.companySpread)
commentList?.push(item?.totalComments);
numCompanyList?.push(item?.companySpread);
});
const optionPost = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
trigger: "axis",
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: '3%',
right: '4%',
bottom: '0%',
top: $screenWidth < 640 ? '20%' : '10%',
containLabel: true
left: "3%",
right: "4%",
bottom: "0%",
top: $screenWidth < 640 ? "20%" : "10%",
containLabel: true,
},
xAxis: [
{
type: 'category',
type: "category",
boundaryGap: false,
splitLine: {
show: false, // Disable x-axis grid lines
},
data: dates,
axisLabel: {
show: false // Hide x-axis labels
}
}
show: false, // Hide x-axis labels
},
},
],
yAxis: [
{
type: 'value',
type: "value",
splitLine: {
show: false, // Disable x-axis grid lines
},
axisLabel: {
show: false // Hide y-axis labels
}
show: false, // Hide y-axis labels
},
},
],
series: [
{
name: 'Total Posts',
type: 'line',
name: "Total Posts",
type: "line",
smooth: true,
lineStyle: {
width: 0
width: 0,
},
showSymbol: false,
areaStyle: {
opacity: 1,
color: '#3B82F6'
color: "#3B82F6",
},
emphasis: {
focus: 'series'
focus: "series",
},
data: postList
data: postList,
},
]
};
],
};
const optionComment = {
const optionComment = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
trigger: "axis",
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: '3%',
right: '4%',
bottom: '0%',
top: $screenWidth < 640 ? '20%' : '10%',
containLabel: true
left: "3%",
right: "4%",
bottom: "0%",
top: $screenWidth < 640 ? "20%" : "10%",
containLabel: true,
},
xAxis: [
{
type: 'category',
type: "category",
boundaryGap: false,
splitLine: {
show: false, // Disable x-axis grid lines
},
data: dates,
axisLabel: {
show: false // Hide x-axis labels
}
}
show: false, // Hide x-axis labels
},
},
],
yAxis: [
{
type: 'value',
type: "value",
splitLine: {
show: false, // Disable x-axis grid lines
},
axisLabel: {
show: false // Hide y-axis labels
}
show: false, // Hide y-axis labels
},
},
],
series: [
{
name: 'Total Comments',
type: 'line',
name: "Total Comments",
type: "line",
smooth: true,
lineStyle: {
width: 0
width: 0,
},
showSymbol: false,
areaStyle: {
opacity: 1,
color: '#E11D48'
color: "#E11D48",
},
emphasis: {
focus: 'series'
focus: "series",
},
data: commentList
data: commentList,
},
]
};
],
};
const optionCompanySpread = {
const optionCompanySpread = {
silent: true,
animation: false,
tooltip: {
trigger: 'axis',
trigger: "axis",
hideDelay: 100, // Set the delay in milliseconds
},
grid: {
left: '3%',
right: '4%',
bottom: '0%',
top: $screenWidth < 640 ? '20%' : '10%',
containLabel: true
left: "3%",
right: "4%",
bottom: "0%",
top: $screenWidth < 640 ? "20%" : "10%",
containLabel: true,
},
xAxis: [
{
type: 'category',
type: "category",
boundaryGap: false,
splitLine: {
show: false, // Disable x-axis grid lines
},
data: dates,
axisLabel: {
show: false // Hide x-axis labels
}
}
show: false, // Hide x-axis labels
},
},
],
yAxis: [
{
type: 'value',
type: "value",
splitLine: {
show: false, // Disable x-axis grid lines
},
axisLabel: {
show: false // Hide y-axis labels
}
show: false, // Hide y-axis labels
},
},
],
series: [
{
name: 'Company Spread',
type: 'bar',
name: "Company Spread",
type: "bar",
smooth: true,
barWidth: '90%',
barWidth: "90%",
showSymbol: false,
data: numCompanyList,
itemStyle: {
color: '#22C55E'
}
color: "#22C55E",
},
]
};
return {optionPost, optionComment, optionCompanySpread};
},
],
};
return { optionPost, optionComment, optionCompanySpread };
}
onMount(() => {
const {optionPost, optionComment, optionCompanySpread } = getPlotOptions()
optionGraphPost = optionPost
optionGraphComment = optionComment
optionGraphCompanySpread = optionCompanySpread
const { optionPost, optionComment, optionCompanySpread } = getPlotOptions();
optionGraphPost = optionPost;
optionGraphComment = optionComment;
optionGraphCompanySpread = optionCompanySpread;
isLoaded = true;
})
});
</script>
</script>
<svelte:head>
<svelte:head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Wallstreetbets Tracker · stocknear
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} Wallstreetbets
Tracker · stocknear
</title>
<meta name="description" content={`Track the stocks and discussion of Wallstreetbets in realtime.`} />
<meta
name="description"
content={`Track the stocks and discussion of Wallstreetbets in realtime.`}
/>
<!-- Other meta tags -->
<meta property="og:title" content={`Wallstreetbets Tracker · stocknear`}/>
<meta property="og:description" content={`Track the stocks and discussion of Wallstreetbets in realtime.`} />
<meta property="og:type" content="website"/>
<meta property="og:title" content={`Wallstreetbets Tracker · stocknear`} />
<meta
property="og:description"
content={`Track the stocks and discussion of Wallstreetbets in realtime.`}
/>
<meta property="og:type" content="website" />
<!-- Add more Open Graph meta tags as needed -->
<!-- Twitter specific meta tags -->
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:title" content={`Wallstreetbets Tracker · stocknear`}/>
<meta name="twitter:description" content={`Track the stocks and discussion of Wallstreetbets in realtime.`} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={`Wallstreetbets Tracker · stocknear`} />
<meta
name="twitter:description"
content={`Track the stocks and discussion of Wallstreetbets in realtime.`}
/>
<!-- Add more Twitter meta tags as needed -->
</svelte:head>
</svelte:head>
<svelte:options immutable = {true} />
<section class="w-full max-w-3xl sm:max-w-screen-xl overflow-hidden min-h-screenpb-40">
<section
class="w-full max-w-3xl sm:max-w-screen-xl overflow-hidden min-h-screenpb-40"
>
<div class="flex flex-col w-full m-auto justify-center items-center">
<div class="text-center mb-10 w-full px-4 3xl:px-10 mt-10 3xl:ml-20">
<div class="flex flex-col items-start mb-10">
<div class="flex flex-row items-center mb-10">
<div class="flex-shrink-0 rounded-full w-12 h-12 sm:w-20 sm:h-20 relative bg-[#27272A] flex items-center border border-gray-600 justify-center">
<img style="clip-path: circle(50%);" class="avatar w-9 h-9 sm:w-16 sm:h-16" src={cloudFrontUrl+'/reddit/wallstreetbets_logo.png'} alt="stock logo"/>
<div
class="flex-shrink-0 rounded-full w-12 h-12 sm:w-20 sm:h-20 relative bg-[#27272A] flex items-center border border-gray-600 justify-center"
>
<img
style="clip-path: circle(50%);"
class="avatar w-9 h-9 sm:w-16 sm:h-16"
src={cloudFrontUrl + "/reddit/wallstreetbets_logo.png"}
alt="stock logo"
/>
</div>
<h1 class="text-white text-xl sm:text-4xl font-bold text-start w-full pl-4">
<h1
class="text-white text-xl sm:text-4xl font-bold text-start w-full pl-4"
>
r/Wallstreetbets Tracker
</h1>
</div>
<div class="text-start w-full text-gray-300 text-[1rem]">
<span class="font-semibold text-white">Description:</span> <br> Like 4chan found a Bloomberg Terminal.
<span class="font-semibold text-white">Description:</span> <br /> Like
4chan found a Bloomberg Terminal.
</div>
</div>
<div class="flex justify-center w-full m-auto overflow-hidden">
<div class="relative flex justify-center items-center overflow-hidden w-full">
<div
class="relative flex justify-center items-center overflow-hidden w-full"
>
<main class="w-full">
{#if isLoaded}
<div class="grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 md:gap-8">
<div
class="grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 md:gap-8"
>
<Card.Root class="bg-[#141417]">
<Card.Header class="flex flex-col items-start space-y-0 pb-2">
<Card.Title class="text-start text-xl sm:text-2xl font-semibold pb-2">Post Activity</Card.Title>
<Card.Description class="text-gray-300 text-sm pb-2">Number of Posts in the last 24 hours:</Card.Description>
<Card.Description class="text-white text-[1rem] pb-2"><span class="text-[#408FFF] font-bold text-2xl">
<Card.Title
class="text-start text-xl sm:text-2xl font-semibold pb-2"
>Post Activity</Card.Title
>
<Card.Description class="text-gray-300 text-sm pb-2"
>Number of Posts in the last 24 hours:</Card.Description
>
<Card.Description class="text-white text-[1rem] pb-2"
><span class="text-[#408FFF] font-bold text-2xl">
+{postList?.at(-1)}
</span> posts today
</Card.Description>
<Card.Description class="text-gray-400 text-sm pb-2">
{((postList?.at(-1)/postList?.at(-2) -1)*100)?.toFixed(0)}% from yesterday
{(
(postList?.at(-1) / postList?.at(-2) - 1) *
100
)?.toFixed(0)}% from yesterday
</Card.Description>
</Card.Header>
<Card.Content>
<Lazy>
@ -352,21 +380,33 @@ const optionCompanySpread = {
<Card.Root class="bg-[#141417]">
<Card.Header class="flex flex-col items-start space-y-0 pb-2">
<Card.Title class="text-start text-xl sm:text-2xl font-semibold pb-2">Comment Activity</Card.Title>
<Card.Description class="text-gray-300 text-sm pb-2">Number of Comments in the last 24 hours:</Card.Description>
<Card.Description class="text-white text-[1rem] pb-2"><span class="text-[#F71F4F] font-bold text-2xl">
<Card.Title
class="text-start text-xl sm:text-2xl font-semibold pb-2"
>Comment Activity</Card.Title
>
<Card.Description class="text-gray-300 text-sm pb-2"
>Number of Comments in the last 24 hours:</Card.Description
>
<Card.Description class="text-white text-[1rem] pb-2"
><span class="text-[#F71F4F] font-bold text-2xl">
+{abbreviateNumber(commentList?.at(-1))}
</span> comments today
</Card.Description>
<Card.Description class="text-gray-400 text-sm pb-2">
{((commentList?.at(-1)/commentList?.at(-2) -1)*100)?.toFixed(0)}% from yesterday
{(
(commentList?.at(-1) / commentList?.at(-2) - 1) *
100
)?.toFixed(0)}% from yesterday
</Card.Description>
</Card.Header>
<Card.Content>
<Lazy>
<div class="app w-full h-[150px]">
<Chart {init} options={optionGraphComment} class="chart" />
<Chart
{init}
options={optionGraphComment}
class="chart"
/>
</div>
</Lazy>
</Card.Content>
@ -374,27 +414,39 @@ const optionCompanySpread = {
<Card.Root class="bg-[#141417]">
<Card.Header class="flex flex-col items-start space-y-0 pb-2">
<Card.Title class="text-start text-xl sm:text-2xl font-semibold pb-2">Company Spread</Card.Title>
<Card.Description class="text-start text-gray-300 text-sm pb-2">Number of Tickers discussed in the last 24 hours:</Card.Description>
<Card.Description class="text-white text-[1rem] pb-2"><span class="text-[#24D766] font-bold text-2xl">
<Card.Title
class="text-start text-xl sm:text-2xl font-semibold pb-2"
>Company Spread</Card.Title
>
<Card.Description
class="text-start text-gray-300 text-sm pb-2"
>Number of Tickers discussed in the last 24 hours:</Card.Description
>
<Card.Description class="text-white text-[1rem] pb-2"
><span class="text-[#24D766] font-bold text-2xl">
+{numCompanyList?.at(-1)}
</span> discussed today
</Card.Description>
<Card.Description class="text-gray-400 text-sm pb-2">
{((numCompanyList?.at(-1)/numCompanyList?.at(-2) -1)*100)?.toFixed(0)}% from yesterday
{(
(numCompanyList?.at(-1) / numCompanyList?.at(-2) - 1) *
100
)?.toFixed(0)}% from yesterday
</Card.Description>
</Card.Header>
<Card.Content>
<Lazy>
<div class="app w-full h-[150px]">
<Chart {init} options={optionGraphCompanySpread} class="chart" />
<Chart
{init}
options={optionGraphCompanySpread}
class="chart"
/>
</div>
</Lazy>
</Card.Content>
</Card.Root>
</div>
<div class="mt-10 grid gap-4 md:gap-8 grid-cols-1 text-start">
@ -403,52 +455,92 @@ const optionCompanySpread = {
<Card.Header class="flex flex-row items-center">
<div class="flex flex-col items-start w-full">
<div class="flex flex-row w-full items-center">
<Card.Title class="text-xl sm:text-2xl text-white font-semibold">Latest Posts</Card.Title>
<Card.Title
class="text-xl sm:text-2xl text-white font-semibold"
>Latest Posts</Card.Title
>
</div>
</div>
</Card.Header>
<Card.Content class="p-3 sm:p-6">
{#each data?.getRedditTracker?.posts as item}
<div class="flex flex-col items-start mb-3 p-3 border border-gray-800 rounded-lg bg-[#141417]">
<a href={'https://www.reddit.com'+item?.permalink} rel="noopener noreferrer" target="_blank" class="text-[1rem] sm:text-xl font-semibold mb-3 transition duration-100 text-white sm:hover:text-blue-400">
<div
class="flex flex-col items-start mb-3 p-3 border border-gray-800 rounded-lg bg-[#141417]"
>
<a
href={"https://www.reddit.com" + item?.permalink}
rel="noopener noreferrer"
target="_blank"
class="text-[1rem] sm:text-xl font-semibold mb-3 transition duration-100 text-white sm:hover:text-blue-400"
>
{item?.title}
</a>
{#if item?.selftext?.length !== 0}
<div class="text-sm sm:text-[1rem] mb-3">
{#if $screenWidth < 640}
{item?.selftext?.length > 400 ? removeHttpsStrings(item?.selftext)?.slice(0,240)+ '...' : removeHttpsStrings(item?.selftext)}
{item?.selftext?.length > 400
? removeHttpsStrings(item?.selftext)?.slice(
0,
240,
) + "..."
: removeHttpsStrings(item?.selftext)}
{:else}
{item?.selftext?.length > 1000 ? removeHttpsStrings(item?.selftext)?.slice(0,800)+ '...' : removeHttpsStrings(item?.selftext)}
{item?.selftext?.length > 1000
? removeHttpsStrings(item?.selftext)?.slice(
0,
800,
) + "..."
: removeHttpsStrings(item?.selftext)}
{/if}
</div>
{/if}
<div class="flex flex-row items-center mb-5 mt-3">
<label class="mr-4 text-sm">
<ThumbsUp class="h-5 w-5 inline-block -mt-1 shrink-0 mr-1" /> {(item?.upvote_ratio*100)}%
<ThumbsUp
class="h-5 w-5 inline-block -mt-1 shrink-0 mr-1"
/>
{item?.upvote_ratio * 100}%
</label>
<label class="text-sm">
<MessageCircle class="h-5 w-5 inline-block -mt-1 shrink-0 mr-1" /> {item?.num_comments}
<MessageCircle
class="h-5 w-5 inline-block -mt-1 shrink-0 mr-1"
/>
{item?.num_comments}
</label>
</div>
<label class="mt-2 mb-2 text-xs bg-white rounded-lg px-3 py-1 text-black">
<label
class="mt-2 mb-2 text-xs bg-white rounded-lg px-3 py-1 text-black"
>
{item?.link_flair_text}
</label>
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between w-full mt-3">
<a href={'https://www.reddit.com/user/'+item?.author} rel="noopener noreferrer" target="_blank" class="text-sm text-white sm:hover:text-blue-400">
<div
class="flex flex-col sm:flex-row items-start sm:items-center justify-between w-full mt-3"
>
<a
href={"https://www.reddit.com/user/" +
item?.author}
rel="noopener noreferrer"
target="_blank"
class="text-sm text-white sm:hover:text-blue-400"
>
Posted by {item?.author}
</a>
<a href={'https://www.reddit.com'+item?.permalink} rel="noopener noreferrer" target="_blank" class="mt-2 sm:mt-0 text-sm text-white sm:hover:text-blue-400">
<a
href={"https://www.reddit.com" + item?.permalink}
rel="noopener noreferrer"
target="_blank"
class="mt-2 sm:mt-0 text-sm text-white sm:hover:text-blue-400"
>
{formatUtcTimestamp(item?.created_utc)}
<Link class="h-3 w-3 inline-block shrink-0 -mt-1 ml-1" />
<Link
class="h-3 w-3 inline-block shrink-0 -mt-1 ml-1"
/>
</a>
</div>
</div>
{/each}
</Card.Content>
@ -456,61 +548,104 @@ const optionCompanySpread = {
</Lazy>
<Card.Root class="order-0 overflow-x-scroll no-scrollbar">
<Card.Header>
<Card.Title class="text-start text-xl w-full flex flex-row items-center">
<span>
Last 14 Days Trend
</span>
<Card.Title
class="text-start text-xl w-full flex flex-row items-center"
>
<span> Last 14 Days Trend </span>
</Card.Title>
</Card.Header>
<Card.Content class="grid gap-y-4">
<Table.Root class="overflow-x-scroll w-full">
<Table.Header>
<Table.Row>
<Table.Head class="text-white text-[1rem]">Rank</Table.Head>
<Table.Head class="text-white text-[1rem]">Symbol</Table.Head>
<Table.Head class="text-white text-[1rem] text-end">Mentions</Table.Head>
<Table.Head class="text-white text-[1rem] text-end">Calls</Table.Head>
<Table.Head class="text-white text-[1rem] text-end">Puts</Table.Head>
<Table.Head class="text-white text-[1rem] text-end">Sentiment</Table.Head>
<Table.Head class="text-white text-[1rem] text-end">Price</Table.Head>
<Table.Head class="text-white text-[1rem]"
>Rank</Table.Head
>
<Table.Head class="text-white text-[1rem]"
>Symbol</Table.Head
>
<Table.Head class="text-white text-[1rem] text-end"
>Mentions</Table.Head
>
<Table.Head class="text-white text-[1rem] text-end"
>Calls</Table.Head
>
<Table.Head class="text-white text-[1rem] text-end"
>Puts</Table.Head
>
<Table.Head class="text-white text-[1rem] text-end"
>Sentiment</Table.Head
>
<Table.Head class="text-white text-[1rem] text-end"
>Price</Table.Head
>
</Table.Row>
</Table.Header>
<Table.Body>
{#each data?.getRedditTracker?.trending as item, index}
<Table.Row>
<Table.Cell class="text-left text-[1rem]">
#{index+1}
#{index + 1}
</Table.Cell>
<Table.Cell>
<a href={item?.assetType === 'stocks' ? `/stocks/${item?.symbol}` : `/etf/${item?.symbol}`} class="whitespace-wrap font-medium">
<div class="flex flex-col items-start text-[1rem]">
<span class="text-blue-400 sm:hover:text-white transition duration-100">{item?.symbol}</span>
<span class="text-white whitespace-wrap hidden sm:block">
<div
class="flex flex-col items-start text-[1rem]"
>
<HoverStockChart
symbol={item?.symbol}
assetType={item?.assetType}
/>
<span
class="text-white whitespace-wrap hidden sm:block"
>
{item?.name}
</span>
</div>
</a>
</Table.Cell>
<Table.Cell class="text-right text-[1rem]">{item?.count}</Table.Cell>
<Table.Cell class="text-right text-[1rem] text-[#00FC50]">{item?.call}</Table.Cell>
<Table.Cell class="text-right text-[1rem] text-[#FF2F1F]">{item?.put}</Table.Cell>
<Table.Cell class="text-right text-[1rem] {item?.avgSentiment > 0.4 ? 'text-[#00FC50]' : item?.avgSentiment <-0.1 ? 'text-[#FF2F1F]' : 'text-[#C6A755]'} ">{item?.avgSentiment > 0.4 ? 'Bullish' : item?.avgSentiment <= -0.1 ? 'Bearish' : 'Neutral'}</Table.Cell>
<Table.Cell class="text-right text-[1rem]"
>{item?.count}</Table.Cell
>
<Table.Cell
class="text-right text-[1rem] text-[#00FC50]"
>{item?.call}</Table.Cell
>
<Table.Cell
class="text-right text-[1rem] text-[#FF2F1F]"
>{item?.put}</Table.Cell
>
<Table.Cell
class="text-right text-[1rem] {item?.avgSentiment >
0.4
? 'text-[#00FC50]'
: item?.avgSentiment < -0.1
? 'text-[#FF2F1F]'
: 'text-[#C6A755]'} "
>{item?.avgSentiment > 0.4
? "Bullish"
: item?.avgSentiment <= -0.1
? "Bearish"
: "Neutral"}</Table.Cell
>
<Table.Cell>
<div class="flex flex-row justify-end items-center text-[1rem]">
<div
class="flex flex-row justify-end items-center text-[1rem]"
>
<div class="flex flex-col mt-3">
<span class="text-white ml-auto">${item.price?.toFixed(2)}</span>
<span class="{item?.changesPercentage > 0 ? 'text-[#00FC50]' : 'text-[#FF2F1F]'} font-semibold text-end">
{#if item?.changesPercentage > 0 }
<span class="text-white ml-auto"
>${item.price?.toFixed(2)}</span
>
<span
class="{item?.changesPercentage > 0
? 'text-[#00FC50]'
: 'text-[#FF2F1F]'} font-semibold text-end"
>
{#if item?.changesPercentage > 0}
+{item?.changesPercentage?.toFixed(2)}%
{:else}
{item?.changesPercentage?.toFixed(2)}%
{/if}
</span>
</div>
</div>
</Table.Cell>
</Table.Row>
@ -520,44 +655,39 @@ const optionCompanySpread = {
</Card.Content>
</Card.Root>
</div>
{:else}
<div class="flex justify-center items-center h-80">
<div class="relative">
<label class="bg-[#09090B] rounded-xl h-14 w-14 flex justify-center items-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
<span class="loading loading-spinner loading-md text-gray-400"></span>
<label
class="bg-[#09090B] rounded-xl h-14 w-14 flex justify-center items-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
>
<span
class="loading loading-spinner loading-md text-gray-400"
></span>
</label>
</div>
</div>
{/if}
</main>
</div>
</div>
</div>
</div>
</section>
</section>
<style>
.app {
height: 150px;
max-width: 100%; /* Ensure chart width doesn't exceed the container */
.app {
height: 150px;
max-width: 100%; /* Ensure chart width doesn't exceed the container */
}
}
@media (max-width: 640px) {
.app {
@media (max-width: 640px) {
.app {
height: 120px;
}
}
.chart {
width: 100%;
}
}
}
.chart {
width: 100%;
}
</style>

View File

@ -6,9 +6,9 @@
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import TableHeader from "$lib/components/Table/TableHeader.svelte";
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
export let data;
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
let isLoaded = false;
let rawData = [];
@ -214,12 +214,7 @@
</td>
<td class="text-sm sm:text-[1rem] text-start">
<a
href={"/stocks/" + item?.symbol}
class="sm:hover:text-white text-blue-400"
>
{item?.symbol}
</a>
<HoverStockChart symbol={item?.symbol} />
</td>
<td
@ -306,7 +301,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -326,7 +321,7 @@
<div
on:click={() => goto("/cramer-tracker")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -343,7 +338,7 @@
<div
on:click={() => goto("/reddit-tracker")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -535,7 +535,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -555,7 +555,7 @@
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -572,7 +572,7 @@
<div
on:click={() => goto("/politicians")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -237,7 +237,7 @@
{#if data?.user?.tier !== "Pro" || data?.user?.freeTrial}
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div
class="w-auto lg:w-full p-1 flex flex-col m-auto px-2 sm:px-0"
@ -257,7 +257,7 @@
<div
on:click={() => goto("/analysts")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -274,7 +274,7 @@
<div
on:click={() => goto("/analysts/top-stocks")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -106,7 +106,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/pricing"
@ -130,7 +130,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/watchlist/stocks"}
@ -149,7 +149,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/analysts/top-stocks"}

View File

@ -422,7 +422,7 @@
<aside class="hidden lg:block relative fixed w-1/4 ml-4">
<div
on:click={() => goto("/pricing")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -439,7 +439,7 @@
<div
on:click={() => goto("/donation")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">
@ -456,7 +456,7 @@
<div
on:click={() => goto("/contact")}
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<div 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">

View File

@ -142,7 +142,7 @@
<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-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href="/pricing"
@ -162,7 +162,7 @@
{/if}
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/price-alert"}
@ -181,7 +181,7 @@
</div>
<div
class="w-full bg-[#27272A] duration-100 ease-out sm:hover:text-white text-gray-400 sm:hover:border-gray-700 border border-gray-800 rounded-md h-fit pb-4 mt-4 cursor-pointer"
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer"
>
<a
href={"/stock-screener"}