Skip to content

Commit 4ecc6d7

Browse files
authored
Merge pull request #80 from jd-apprentice/fix/contributors-not-working
🔨 fix: Rate limit for contributors in GraphQL
2 parents 09ab899 + 563896c commit 4ecc6d7

File tree

6 files changed

+449
-176
lines changed

6 files changed

+449
-176
lines changed

bun.lockb

-41.7 KB
Binary file not shown.

input.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
}
2020

2121
.group:hover > span.badge-container {
22-
@apply first:min-h-6 items-center justify-center transition-all transform duration-1000;
22+
@apply items-center justify-center transition-all transform duration-1000;
23+
}
24+
25+
.group:hover > span.badge-container:first-child {
26+
@apply min-h-6;
2327
}
2428

2529
.group:hover > span.badge-container > span.badge-content {
@@ -58,4 +62,10 @@
5862

5963
.nav-item:hover:after {
6064
@apply scale-x-100;
65+
}
66+
67+
.bg-chiwa {
68+
background-image: url("https://pngimg.com/uploads/clown/clown_PNG1.png");
69+
background-repeat: no-repeat;
70+
background-size: cover;
6171
}

netlify.toml

Lines changed: 0 additions & 11 deletions
This file was deleted.

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/cards/contributor_card.rs

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::components::icons::{GithubIcon, LocationIcon, TwitterIcon};
2-
use leptos::{component, prelude::*, view, IntoView};
2+
use leptos::{component, leptos_dom::helpers::location as location_dom, prelude::*, view, IntoView};
33

44
#[component]
55
pub fn ContributorCard(
@@ -11,12 +11,36 @@ pub fn ContributorCard(
1111
#[prop(into)] brand_src: String,
1212
#[prop(into)] contributions: u64,
1313
) -> impl IntoView {
14+
let (easter_egg, set_easter_egg) = signal(false);
15+
16+
Effect::new(move |_| {
17+
let location_dom = location_dom();
18+
set_easter_egg.set(
19+
location_dom
20+
.search()
21+
.map(|s| s.contains("easter_egg"))
22+
.unwrap_or(false),
23+
);
24+
});
25+
26+
let name_for_class = name.clone();
27+
let name_for_contrib = name.clone();
28+
let contributions = Memo::new(move |_| {
29+
if name_for_contrib == "gg0074x" && easter_egg.get() {
30+
contributions + 300
31+
} else {
32+
contributions
33+
}
34+
});
1435
view! {
15-
<article class="hover:z-10 flex flex-col h-full gap-y-6 border border-black p-4 hover:bg-orange-500 bg-orange-100 dark:hover:bg-zinc-900/40 dark:bg-black/40 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] transition justify-between">
36+
<article
37+
class="hover:z-10 flex flex-col h-full gap-y-6 border border-black p-4 hover:bg-orange-500 bg-orange-100 dark:hover:bg-zinc-900/40 dark:bg-black/40 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] transition justify-between"
38+
class=("bg-chiwa", move || name_for_class == "gg0074x" && easter_egg.get())
39+
>
1640
<a href=link.clone() target="_blank" class="group flex flex-col justify-between">
1741
<span class="absolute top-0 end-0 inline-flex items-center size-3.5 group-hover:min-w-16 rounded-full border-2 border-white text-xs font-medium transition-all transform -translate-y-1/2 translate-x-1/2 bg-teal-500 dark:border-slate-900 badge-container">
1842
<span class="sr-only text-black badge-content transition-all transform">
19-
{contributions}
43+
{move || contributions.get()}
2044
</span>
2145
</span>
2246
<div class="flex flex-col gap-y-2">

0 commit comments

Comments
 (0)