This commit is contained in:
MuslemRahimi 2024-06-13 12:32:07 +02:00
parent 56e6d5d4a2
commit a03927bf5a
7 changed files with 711 additions and 671 deletions

View File

@ -566,7 +566,15 @@ class="fixed 2xl:block top-0 left-0 xl:left-auto w-56 sm:{collapse ? 'w-20' : 'w
<li on:click={() => showSidebar = !showSidebar} class="mb-1 last:mb-0 hover:bg-[#272727] rounded-md {$page.url.pathname=== '/analysts/top-stocks' ? 'text-white bg-[#272727] xl:bg-[#0F0F0F] rounded-md ' : ''}">
<a href={"/analysts/top-stocks"} for="sidebar" class="block text-slate-400 hover:text-slate-200 transition duration-150 truncate">
<span class="text-sm font-medium text-white ">
Top Stocks
Top Analyst Stocks
</span>
</a>
</li>
<li on:click={() => showSidebar = !showSidebar} class="mb-1 last:mb-0 hover:bg-[#272727] rounded-md {$page.url.pathname=== '/analysts/top-stocks' ? 'text-white bg-[#272727] xl:bg-[#0F0F0F] rounded-md ' : ''}">
<a href={"/most-shorted-stocks"} for="sidebar" class="block text-slate-400 hover:text-slate-200 transition duration-150 truncate">
<span class="text-sm font-medium text-white ">
Most Shorted Stocks
</span>
</a>
</li>

View File

@ -7,7 +7,8 @@
import InfoModal from '$lib/components/InfoModal.svelte';
import nancyPelosiProfile from '$lib/images/senator/Nancy_Pelosi.png';
import warrenBuffetProfile from '$lib/images/hedge_funds/0001067983.png';
import michaelBurryProfile from '$lib/images/hedge_funds/0001649339.png';
//import michaelBurryProfile from '$lib/images/hedge_funds/0001649339.png';
import analystAvatar from '$lib/images/hedge_funds/default-avatar.png';
import { screenWidth, numberOfUnreadNotification} from '$lib/store';
@ -164,7 +165,7 @@ onMount( async() => {
<!-- Start Column -->
<div >
<!--
<div class="text-center mb-5 relative w-fit flex justify-center m-auto">
<a href="/most-shorted-stocks" class="text-white antialiased bg-[#202020] w-full px-4 py-2 rounded-xl m-auto font-medium text-sm flex items-center">
<svg class="w-6 h-6 inline-block mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#f4900c" d="m33.629 16.565l-.092 1.608l-.041.814c-.02.265-.092.529-.142.794l-.285 1.598c-.153.519-.326 1.028-.499 1.547c-.743 2.025-1.791 4.029-3.246 5.698a23.476 23.476 0 0 1-5.006 4.396c-1.903 1.221-3.867 2.167-6.126 2.859l-.385.121l-.427-.142c-1.526-.499-2.798-1.099-4.101-1.832c-1.272-.722-2.503-1.536-3.612-2.524l-.835-.732l-.784-.794c-.529-.519-.987-1.109-1.455-1.689a20.511 20.511 0 0 1-2.3-3.826c-.611-1.353-1.109-2.768-1.404-4.213c-.071-.366-.183-.722-.224-1.089l-.132-1.089c-.071-.733-.193-1.435-.153-2.279c.061-1.618.56-3.175 1.313-4.508a14.016 14.016 0 0 1 2.849-3.48l3.46-3.053l-1.669 4.174c-.57 1.435-.845 3.134-.193 4.202c.315.529.885.814 1.587.824c.733 0 1.475-.203 1.872-.692c.407-.478.438-1.231.183-1.954c-.326-.753-.631-1.77-.59-2.696c0-.946.275-1.893.753-2.717c.488-.824 1.19-1.496 1.984-1.994l1.028-.641l-.285 1.19c-.295 1.221-.081 2.503.733 3.287c.804.784 2.076 1.058 3.103.794c1.028-.275 1.72-1.109 1.76-2.025c.081-.946-.417-2.015-1.058-3.002L16.932 0l3.887 1.628c1.089.448 2.167.956 3.185 1.669c1.007.712 2.004 1.608 2.686 2.788c.712 1.16 1.007 2.584.977 3.836c0 .315-.02.621-.041.926c-.041.305-.051.55-.122.936c-.122.682-.305 1.19-.458 1.709c-.315.997-.519 2.025-.295 2.564c.132.509 1.292.906 2.147.794c.916-.092 1.77-.733 2.371-1.577c.6-.855.916-1.923 1.079-2.981l.132-.834l.295.763c.549 1.383.864 2.859.854 4.344"/><path fill="#ffcc4d" d="M33.146 16.503c-.001-1.463.068-2.222-.507-3.52c-.393 3.824-3.228 5.144-5.792 4.23c-2.402-.857-.783-4.198-.664-5.793c.202-2.703-.01-5.796-5.919-8.369c2.455 3.903.284 6.327-1.993 6.475c-2.526.164-4.84-1.804-3.986-4.997c-2.765 1.693-2.846 4.543-1.993 6.386c.89 1.921-.036 3.518-2.206 3.695c-2.426.199-3.773-2.158-2.531-5.913c-2.151 2.104-3.676 4.837-3.449 7.805C5.142 30.035 17.841 33.93 17.841 33.93s15.319-3.757 15.305-17.427"/><path fill="#dd2e44" d="M30.935 19.489a7.234 7.234 0 0 0-7.233-7.234a7.22 7.22 0 0 0-5.878 3.027a7.22 7.22 0 0 0-5.877-3.027a7.234 7.234 0 0 0-7.234 7.234c0 .566.072 1.114.195 1.643c1.004 6.24 7.943 12.824 12.915 14.632c4.972-1.808 11.911-8.391 12.914-14.631a7.074 7.074 0 0 0 .198-1.644"/><path fill="#ffcc4d" d="M24.312 31.553s1.426-2.769 1.319-5.645c-.038-1.024-.327-2.019-.736-2.958c-.958-2.196-2.806-7.706 1.147-10.661c0 0-.755 1.269-.085 3.581c.265.915.761 1.741 1.35 2.49c1.36 1.732 4.219 6.501-.484 10.948zm-7.659 3.728s-1.581-1.515-2.421-3.652c-.299-.761-.406-1.58-.406-2.398c-.001-1.911-.409-6.529-4.242-7.427c0 0 .957.687 1.205 2.591c.098.753-.001 1.516-.192 2.251c-.441 1.701-.972 5.909 3.886 7.659z"/></svg>
@ -176,6 +177,7 @@ onMount( async() => {
</span>
</div>
</div>
-->
@ -235,7 +237,7 @@ onMount( async() => {
</div>
{/if}
<!--
<div class="w-full max-w-64 sm:max-w-3xl m-auto grid grid-cols-1 md:grid-cols-3 gap-y-3 sm:gap-x-5 mt-10 flex justify-center items-center">
<a href="/politicians/61b59ab669" class="px-4 py-3 text-white bg-[#202327] rounded-lg flex flex-row items-center font-medium transition duration-150 ease-in-out group">
<div class="flex flex-row items-center">
@ -259,6 +261,18 @@ onMount( async() => {
</div>
</div>
</a>
<a href="/analysts/5874f5e45064ed0001eb1bc5" class="px-4 py-3 text-white bg-[#202327] rounded-lg flex flex-row items-center font-medium transition duration-150 ease-in-out group">
<div class="flex flex-row items-center">
<div class="shadow-lg rounded-full border border-slate-600 w-10 h-10 relative analyst-striped bg-[#737D62] flex items-center justify-center">
<img style="clip-path: circle(50%);" class="rounded-full w-8" src={analystAvatar} loading="lazy"/>
</div>
<div class="flex flex-col items-start ml-2">
<span class="text-sm text-start">Track Keith Horowitz</span>
<span class="text-xs text-gray-400">Analyst at Citigroup</span>
</div>
</div>
</a>
<!--
<a href="/hedge-funds/0001649339" class="px-4 py-3 text-white bg-[#202327] rounded-lg flex flex-row items-center font-medium transition duration-150 ease-in-out group">
<div class="flex flex-row items-center">
<div class="shadow-lg rounded-full border border-slate-600 w-10 h-10 relative hedge-fund-striped bg-[#20202E] flex items-center justify-center">
@ -270,8 +284,9 @@ onMount( async() => {
</div>
</div>
</a>
</div>
-->
</div>
@ -852,5 +867,16 @@ onMount( async() => {
);
}
.analyst-striped {
background-image: repeating-linear-gradient(
-45deg,
#737D62,
#737D62 10px,
#677058 10px,
#677058 20px
);
}
</style>

View File

@ -1,11 +1,9 @@
<script lang='ts'>
import cardBackground from "$lib/images/bg-hedge-funds.png";
import defaultAvatar from "$lib/images/hedge_funds/default-avatar.png";
import { screenWidth, numberOfUnreadNotification } from '$lib/store';
import { abbreviateNumber } from '$lib/utils';
import { onMount } from 'svelte';
import { compareTwoStrings } from 'string-similarity';
// import * as XLSX from 'xlsx';
export let data;

View File

@ -35,14 +35,16 @@ export const load = async () => {
output = (await import('$lib/hedge-funds/all-hedge-funds.json'))?.default;
await loadImages();
output?.forEach(item => {
item.image = images[item?.cik] || defaultAvatar;
});
// Cache the data for this specific tickerID with a specific name 'getHedgeFunds'
setCache('getHedgeFunds', output, 'getHedgeFunds');
}
await loadImages();
output?.forEach(item => {
item.image = images[item?.cik] || defaultAvatar;
});
return output;

View File

@ -42,14 +42,16 @@ export const load = async ({ params }) => {
output = await response.json();
// Cache the data for this specific tickerID with a specific name 'getHedgeFundsData'
try {
output.holdings = output?.holdings?.filter(item => item?.sharesNumber !== 0 && item?.symbol !== null); //item?.symbol !== null
} catch(e) {
console.log(e)
}
setCache(params.slug, output, 'getHedgeFundsData');
}
try {
output.holdings = output?.holdings?.filter(item => item?.sharesNumber !== 0 && item?.symbol !== null); //item?.symbol !== null
} catch(e) {
console.log(e)
}
displayCompanyName.update(value => output?.name ?? params.slug)
return output;

View File

@ -57,30 +57,34 @@ export const load = async () => {
output = await response.json();
// Cache the data for this specific tickerID with a specific name 'getAllPolitician'
await loadImages();
output?.forEach(item => {
let representative = item?.representative || '';
representative = representative?.replace('Jr', '')
.replace(/Dr./g, '')
.replace(/Dr_/g, '')
const fullName = representative?.replace(/(\s(?:Dr\s)?\w(?:\.|(?=\s)))?\s/g, '_').trim();
item.image = images[fullName] || defaultAvatar;
item.representative = fullName?.replace(/_/g, ' ');
});
output = output?.map(item => {
const party = getPartyForPoliticians(item?.representative);
return {
...item,
party: party
};
});
setCache('', output, 'getAllPolitician');
}
await loadImages();
output?.forEach(item => {
let representative = item?.representative || '';
representative = representative?.replace('Jr', '')
.replace(/Dr./g, '')
.replace(/Dr_/g, '')
const fullName = representative?.replace(/(\s(?:Dr\s)?\w(?:\.|(?=\s)))?\s/g, '_').trim();
item.image = images[fullName] || defaultAvatar;
item.representative = fullName?.replace(/_/g, ' ');
});
output = output?.map(item => {
const party = getPartyForPoliticians(item?.representative);
return {
...item,
party: party
};
});
return output;

File diff suppressed because it is too large Load Diff