Skip to content

Commit 0a5239f

Browse files
Merge branch 'main' into main
2 parents 6926477 + 8605f45 commit 0a5239f

11 files changed

Lines changed: 366 additions & 169 deletions

File tree

.vscode/settings.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,4 @@
1010
"javascriptreact",
1111
"typescriptreact"
1212
],
13-
"workbench.colorCustomizations": {
14-
"editor.lineHighlightBorder": "#FF2D9A25",
15-
"editorCursor.foreground": "#FF2D9A",
16-
"tab.activeBorder": "#FF2D9A35",
17-
"tab.activeBorderTop": "#FF2D9A35",
18-
"tab.activeBackground": "#1A0028",
19-
"tab.activeForeground": "#FF6EC7",
20-
"statusBar.background": "#120020",
21-
"statusBar.foreground": "#FF6EC7",
22-
"editorIndentGuide.activeBackground1": "#FF2D9A35",
23-
"editor.selectionBackground": "#FF2D9A28",
24-
"editorBracketHighlight.foreground1": "#FF2D9A",
25-
"editorBracketHighlight.foreground2": "#FF6EC7"
26-
}
2713
}
Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import React, { useState, useEffect } from "react";
2-
import { FaArrowUp } from "react-icons/fa";
2+
import { FaArrowDown, FaArrowUp } from "react-icons/fa";
33

44
export default function ScrollBottomToTop() {
5-
const [isVisible, setIsVisible] = useState(false);
6-
7-
const toggleVisibility = () => {
8-
if (window.pageYOffset > 300) {
9-
setIsVisible(true);
10-
} else {
11-
setIsVisible(false);
12-
}
5+
const [showTopButton, setShowTopButton] = useState(false);
6+
const [showBottomButton, setShowBottomButton] = useState(false);
7+
8+
const updateVisibility = () => {
9+
const scrollTop = window.pageYOffset;
10+
const documentHeight = document.documentElement.scrollHeight;
11+
const viewportHeight = window.innerHeight;
12+
13+
setShowTopButton(scrollTop > 300);
14+
setShowBottomButton(scrollTop + viewportHeight < documentHeight - 300);
1315
};
1416

1517
const scrollToTop = () => {
@@ -19,26 +21,50 @@ export default function ScrollBottomToTop() {
1921
});
2022
};
2123

24+
const scrollToBottom = () => {
25+
window.scrollTo({
26+
top: document.documentElement.scrollHeight,
27+
behavior: "smooth",
28+
});
29+
};
30+
2231
useEffect(() => {
23-
window.addEventListener("scroll", toggleVisibility);
32+
updateVisibility();
33+
window.addEventListener("scroll", updateVisibility);
34+
window.addEventListener("resize", updateVisibility);
2435

2536
return () => {
26-
window.removeEventListener("scroll", toggleVisibility);
37+
window.removeEventListener("scroll", updateVisibility);
38+
window.removeEventListener("resize", updateVisibility);
2739
};
2840
}, []);
2941

42+
if (!showTopButton && !showBottomButton) {
43+
return null;
44+
}
45+
3046
return (
31-
<div className="scroll-to-top">
32-
{isVisible && (
47+
<div className="scroll-to-top fixed right-5 bottom-5 z-50 flex flex-col gap-3">
48+
{showTopButton && (
3349
<button
34-
aria-label="Scroll to top"
50+
aria-label="Scroll to top"
3551
onClick={scrollToTop}
36-
className="fixed right-5 bottom-5 z-50 cursor-pointer rounded-full border-none bg-gray-700 p-3 text-white shadow-lg transition-opacity duration-300 hover:bg-gray-800 dark:bg-gray-600 dark:hover:bg-gray-700"
52+
className="cursor-pointer rounded-full border-none bg-gray-700 p-3 text-white shadow-lg transition-opacity duration-300 hover:bg-gray-800 dark:bg-gray-600 dark:hover:bg-gray-700"
3753
style={{ backgroundColor: "var(--ifm-color-primary)" }}
3854
>
3955
<FaArrowUp />
4056
</button>
4157
)}
58+
{showBottomButton && (
59+
<button
60+
aria-label="Scroll to bottom"
61+
onClick={scrollToBottom}
62+
className="cursor-pointer rounded-full border-none bg-gray-700 p-3 text-white shadow-lg transition-opacity duration-300 hover:bg-gray-800 dark:bg-gray-600 dark:hover:bg-gray-700"
63+
style={{ backgroundColor: "var(--ifm-color-primary)" }}
64+
>
65+
<FaArrowDown />
66+
</button>
67+
)}
4268
</div>
4369
);
4470
}

src/components/topmate/TopMateCard.tsx

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
3131
const { isDark } = useSafeColorMode();
3232

3333
const borderClr = isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.07)";
34-
const mutedClr = isDark
35-
? "rgba(148,163,184,0.55)"
36-
: "rgba(100,116,139,0.65)";
34+
const mutedClr = isDark ? "rgba(148,163,184,0.55)" : "rgba(100,116,139,0.65)";
3735
const subtleClr = isDark
3836
? "rgba(148,163,184,0.35)"
3937
: "rgba(100,116,139,0.45)";
@@ -42,14 +40,15 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
4240
"Resume & portfolio review",
4341
"Career path guidance",
4442
"Open-source strategy",
43+
"Mock Interview Prep",
4544
];
4645

4746
return (
4847
<motion.div
4948
initial={{ opacity: 0, y: 30, scale: 0.97 }}
5049
animate={{ opacity: 1, y: 0, scale: 1 }}
5150
transition={{ duration: 0.6, ease: [0.25, 0.46, 0.45, 0.94] }}
52-
className="group relative w-full h-full overflow-hidden rounded-2xl flex flex-col transition-all duration-500 hover:scale-[1.008]"
51+
className="group relative flex h-90 w-full flex-col overflow-hidden rounded-2xl transition-all duration-500 hover:scale-[1.008]"
5352
style={{
5453
background: isDark ? "#0a0a0a" : "#ffffff",
5554
border: `1px solid ${borderClr}`,
@@ -60,7 +59,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
6059
>
6160
{/* Grid pattern overlay */}
6261
<div
63-
className="absolute inset-0 pointer-events-none"
62+
className="pointer-events-none absolute inset-0"
6463
style={{
6564
backgroundImage:
6665
"linear-gradient(to right, rgba(79,79,79,0.10) 1px, transparent 1px), linear-gradient(to bottom, rgba(79,79,79,0.10) 1px, transparent 1px)",
@@ -74,7 +73,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
7473

7574
{/* Subtle corner glow */}
7675
<div
77-
className="absolute -top-20 -right-20 w-40 h-40 rounded-full pointer-events-none"
76+
className="pointer-events-none absolute -top-20 -right-20 h-40 w-40 rounded-full"
7877
style={{
7978
background: isDark
8079
? "radial-gradient(circle, rgba(99,102,241,0.06), transparent)"
@@ -83,11 +82,11 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
8382
}}
8483
/>
8584

86-
<div className="relative p-5 flex flex-col h-full">
85+
<div className="relative flex h-full flex-col p-4">
8786
{/* Header Badge row */}
88-
<div className="mb-3 flex items-center justify-between flex-shrink-0">
87+
<div className="mb-2 flex flex-shrink-0 items-center justify-between">
8988
<div
90-
className="flex items-center gap-2 rounded-full px-3 py-1.5"
89+
className="flex items-center gap-2 rounded-full px-2.5 py-1"
9190
style={{
9291
background: isDark
9392
? "rgba(99,102,241,0.08)"
@@ -98,7 +97,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
9897
}}
9998
>
10099
<Calendar
101-
size={13}
100+
size={12}
102101
style={{ color: isDark ? "#a5b4fc" : "#6366f1" }}
103102
/>
104103
<span
@@ -135,7 +134,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
135134

136135
{/* Title */}
137136
<h2
138-
className="mb-1.5 text-base sm:text-lg font-bold leading-tight tracking-tight flex-shrink-0"
137+
className="mb-1 flex-shrink-0 text-base leading-tight font-bold tracking-tight"
139138
style={{
140139
color: isDark ? "#f1f5f9" : "#0f172a",
141140
fontFamily: "'Inter', -apple-system, sans-serif",
@@ -146,7 +145,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
146145

147146
{/* Description */}
148147
<p
149-
className="mb-3 text-[12px] leading-relaxed flex-shrink-0"
148+
className="mb-2 line-clamp-2 flex-shrink-0 text-[11px] leading-snug"
150149
style={{
151150
color: isDark ? "rgba(148,163,184,0.7)" : "rgba(100,116,139,0.8)",
152151
fontFamily: "'Inter', -apple-system, sans-serif",
@@ -155,9 +154,9 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
155154
{description}
156155
</p>
157156

158-
{/* What you get — compact inline */}
159-
<div className="flex-1 mb-3">
160-
<div className="flex items-center gap-1.5 mb-2">
157+
{/* What you get — 2x2 Grid Section */}
158+
<div className="mb-2.5 min-h-0 flex-grow">
159+
<div className="mb-1 flex items-center gap-1.5">
161160
<Sparkles
162161
size={11}
163162
style={{ color: isDark ? "#a5b4fc" : "#6366f1" }}
@@ -169,11 +168,11 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
169168
What you get
170169
</span>
171170
</div>
172-
<ul className="space-y-1.5">
171+
<ul className="grid grid-cols-2 gap-x-2 gap-y-1">
173172
{features.map((f, i) => (
174-
<li key={i} className="flex items-center gap-2">
173+
<li key={i} className="flex min-w-0 items-center gap-1.5">
175174
<CheckCircle2
176-
size={13}
175+
size={11}
177176
className="flex-shrink-0"
178177
style={{
179178
color: isDark
@@ -182,7 +181,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
182181
}}
183182
/>
184183
<span
185-
className="text-[12px]"
184+
className="truncate text-[10.5px]"
186185
style={{
187186
color: isDark
188187
? "rgba(226,232,240,0.75)"
@@ -198,37 +197,37 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
198197
</div>
199198

200199
<div
201-
className="rounded-xl p-3 w-full flex-shrink-0"
200+
className="mt-1 w-full flex-shrink-0 rounded-xl p-1"
202201
style={{
203202
background: isDark ? "rgba(255,255,255,0.02)" : "rgba(0,0,0,0.02)",
204203
border: `1px solid ${borderClr}`,
205204
}}
206205
>
207-
<div className="flex items-center justify-between w-full">
208-
<div className="flex items-center gap-3">
206+
<div className="flex w-full items-center justify-between">
207+
<div className="flex items-center gap-2">
209208
<div className="relative flex-shrink-0">
210209
<img
211210
src={profileImage}
212211
alt="Profile"
213-
className="h-10 w-10 rounded-xl object-cover"
214-
style={{ border: `2px solid ${borderClr}` }}
212+
className="h-8 w-8 rounded-lg object-cover"
213+
style={{ border: `1.5px solid ${borderClr}` }}
215214
/>
216215
<div
217-
className="absolute -bottom-0.5 -right-0.5 rounded-full p-0.5"
216+
className="absolute -right-0.5 -bottom-0.5 rounded-full p-0.5"
218217
style={{ background: isDark ? "#0a0a0a" : "#ffffff" }}
219218
>
220219
<div
221-
className="h-2 w-2 rounded-full"
220+
className="h-1.5 w-1.5 rounded-full"
222221
style={{
223222
background: "#22c55e",
224-
boxShadow: "0 0 6px rgba(34,197,94,0.4)",
223+
boxShadow: "0 0 4px rgba(34,197,94,0.4)",
225224
}}
226225
/>
227226
</div>
228227
</div>
229-
<div>
228+
<div className="min-w-0">
230229
<p
231-
className="text-[10px] font-medium"
230+
className="mb-0.5 text-[9px] leading-none font-medium"
232231
style={{ color: subtleClr }}
233232
>
234233
Book at
@@ -237,28 +236,30 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
237236
href={`https://topmate.io/${username}`}
238237
target="_blank"
239238
rel="noopener noreferrer"
240-
className="group/link flex items-center gap-1 text-[13px] font-semibold transition-colors duration-200"
239+
className="group/link flex items-center gap-0.5 text-[11px] leading-none font-semibold transition-colors duration-200"
241240
style={{
242241
color: isDark ? "#a5b4fc" : "#4338ca",
243242
textDecoration: "none",
244243
}}
245244
>
246-
<span>topmate.io/{username}</span>
245+
<span className="max-w-[95px] truncate sm:max-w-[none]">
246+
topmate.io/{username}
247+
</span>
247248
<ArrowUpRight
248-
size={12}
249-
className="transition-transform group-hover/link:translate-x-0.5 group-hover/link:-translate-y-0.5"
249+
size={10}
250+
className="flex-shrink-0 transition-transform group-hover/link:translate-x-0.5 group-hover/link:-translate-y-0.5"
250251
/>
251252
</a>
252253
</div>
253254
</div>
254255

255256
{/* Rating */}
256-
<div className="flex flex-col items-end gap-0.5">
257+
<div className="flex flex-shrink-0 flex-col items-end justify-center">
257258
<div className="flex items-center gap-0.5">
258259
{[...Array(5)].map((_, i) => (
259260
<Star
260261
key={i}
261-
size={11}
262+
size={9}
262263
className="flex-shrink-0"
263264
style={{
264265
fill: isDark ? "rgba(251,191,36,0.85)" : "#f59e0b",
@@ -268,7 +269,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
268269
))}
269270
</div>
270271
<span
271-
className="text-[10px] font-medium"
272+
className="mt-0.5 text-[9px] leading-none font-medium"
272273
style={{ color: subtleClr }}
273274
>
274275
5.0 rating
@@ -278,16 +279,18 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
278279
</div>
279280

280281
{/* Social proof line */}
281-
<div
282-
className="flex items-center justify-center gap-1.5 mt-2 mb-2 flex-shrink-0"
283-
>
282+
<div className="mt-1.5 mb-1.5 flex flex-shrink-0 items-center justify-center gap-1.5">
284283
<Users
285-
size={12}
286-
style={{ color: isDark ? "rgba(148,163,184,0.4)" : "rgba(100,116,139,0.5)" }}
284+
size={11}
285+
style={{
286+
color: isDark ? "rgba(148,163,184,0.4)" : "rgba(100,116,139,0.5)",
287+
}}
287288
/>
288289
<span
289-
className="text-[11px] font-medium"
290-
style={{ color: isDark ? "rgba(148,163,184,0.4)" : "rgba(100,116,139,0.5)" }}
290+
className="text-[10px] font-medium"
291+
style={{
292+
color: isDark ? "rgba(148,163,184,0.4)" : "rgba(100,116,139,0.5)",
293+
}}
291294
>
292295
200+ sessions completed
293296
</span>
@@ -300,7 +303,7 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
300303
rel="noopener noreferrer"
301304
whileHover={{ scale: 1.015 }}
302305
whileTap={{ scale: 0.985 }}
303-
className="flex w-full items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold tracking-wide transition-all duration-300 flex-shrink-0"
306+
className="flex w-full flex-shrink-0 items-center justify-center gap-2 rounded-xl px-4 py-2 text-xs font-semibold tracking-wide transition-all duration-300"
304307
style={{
305308
background: "linear-gradient(135deg, #4338ca 0%, #6d28d9 100%)",
306309
color: "rgba(255,255,255,0.95)",
@@ -312,16 +315,13 @@ const TopMateCard: React.FC<TopMateCardProps> = ({
312315
fontFamily: "'Inter', -apple-system, sans-serif",
313316
}}
314317
>
315-
<Calendar size={15} style={{ color: "rgba(255,255,255,0.8)" }} />
318+
<Calendar size={13} style={{ color: "rgba(255,255,255,0.8)" }} />
316319
<span>Schedule Now</span>
317-
<ArrowUpRight
318-
size={15}
319-
style={{ color: "rgba(255,255,255,0.65)" }}
320-
/>
320+
<ArrowUpRight size={13} style={{ color: "rgba(255,255,255,0.65)" }} />
321321
</motion.a>
322322
</div>
323323
</motion.div>
324324
);
325325
};
326326

327-
export default TopMateCard;
327+
export default TopMateCard;

0 commit comments

Comments
 (0)