Skip to content

Commit 53ade06

Browse files
feat: add a RequestCard
1 parent ce529c0 commit 53ade06

7 files changed

Lines changed: 96 additions & 0 deletions

File tree

app/test/page.tsx

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
"use client";
2+
import Image from "next/image";
3+
import { useState, useEffect } from "react";
4+
import { Button } from "@/components/ui/button";
5+
import { X } from "lucide-react";
6+
import Link from "next/link";
7+
8+
const images = {
9+
stare: "/characters/stare.png",
10+
okay: "/characters/okay.png",
11+
thankyou: "/characters/thank-you.png",
12+
};
13+
14+
export function JobCard() {
15+
const [active, setActive] = useState("stare");
16+
const [mounted, setMounted] = useState(false);
17+
const [isVisible, setIsVisible] = useState(true);
18+
19+
useEffect(() => {
20+
setMounted(true);
21+
// Check if user previously closed the card in this session
22+
const isHidden = sessionStorage.getItem("hide-job-card");
23+
if (isHidden) setIsVisible(false);
24+
}, []);
25+
26+
const handleClose = () => {
27+
setIsVisible(false);
28+
sessionStorage.setItem("hide-job-card", "true");
29+
};
30+
31+
if (!mounted || !isVisible) return null;
32+
33+
return (
34+
<div className="group relative w-full max-w-[240px] rounded-xl border p-5 shadow-sm transition-all hover:shadow-md mt-8 backdrop-blur-sm">
35+
{/* Subtle Close Button */}
36+
<button
37+
onClick={handleClose}
38+
className="absolute right-2 top-2 p-1 rounded-md opacity-0 group-hover:opacity-100 hover:bg-muted transition-all"
39+
aria-label="Close card"
40+
>
41+
<X size={14} className="text-muted-foreground" />
42+
</button>
43+
44+
<div className="flex flex-col items-center text-center gap-4">
45+
{/* Character - Clean & Scaled */}
46+
<div className="relative w-20 h-20 transition-transform duration-300 ease-out group-hover:scale-110">
47+
<Image
48+
src={images[active as keyof typeof images]}
49+
alt="Character"
50+
width={80}
51+
height={80}
52+
className="object-contain"
53+
/>
54+
</div>
55+
56+
<div className="space-y-2">
57+
<div className="space-y-1">
58+
<p className="text-xs font-semibold text-foreground tracking-tight">
59+
Available for work
60+
</p>
61+
<p className="text-xs leading-relaxed text-muted-foreground text-balance">
62+
I'm graduating soon and looking to join a team.
63+
</p>
64+
</div>
65+
</div>
66+
67+
<div className="w-full flex flex-col gap-2 pt-1">
68+
<Link href={"/hire-me"}>
69+
<Button
70+
size="sm"
71+
variant={"outline"}
72+
onMouseEnter={() => setActive("thankyou")}
73+
onMouseLeave={() => setActive("stare")}
74+
className="w-full text-[11px] h-8 font-medium border-primary/20 hover:bg-primary/5 hover:text-primary transition-colors"
75+
>
76+
View My Work
77+
</Button>
78+
</Link>
79+
80+
<button
81+
onMouseEnter={() => setActive("okay")}
82+
onMouseLeave={() => setActive("stare")}
83+
onClick={handleClose}
84+
className="w-full text-[10px] text-muted-foreground/60 hover:text-muted-foreground transition-colors py-1"
85+
>
86+
Maybe later
87+
</button>
88+
</div>
89+
</div>
90+
</div>
91+
);
92+
}

components/blog/table-of-contents.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useEffect, useState } from "react";
44
import { HugeiconsIcon } from "@hugeicons/react";
55
import { LibraryIcon } from "@hugeicons/core-free-icons";
66
import { cn } from "@/lib/utils";
7+
import { JobCard } from "@/app/test/page";
78

89
interface TOCItem {
910
id: string;
@@ -137,6 +138,9 @@ export function TableOfContents() {
137138
</span>
138139
)}
139140
</a>
141+
<div className="mt-10">
142+
<JobCard />
143+
</div>
140144
</div>
141145
</aside>
142146
);

public/characters/okay.png

9.61 KB
Loading

public/characters/space.png

1.49 MB
Loading

public/characters/space2.png

2.48 MB
Loading

public/characters/stare.png

40 KB
Loading

public/characters/thank-you.png

12.1 KB
Loading

0 commit comments

Comments
 (0)