Skip to content

Commit 47a7d29

Browse files
committed
feat(solana): replace timeline dots with history SVG icons
- Add 6 inline SVG React components in TimelineIcons.tsx (Solana logo, article, code, package, people, video) - Replace green dot markers with circular icon containers with glow effect - Icons use currentColor to inherit primary green, Solana logo keeps its gradient; fallback dot for items without icon - Adjust mobile timeline line position and column width for larger icons - Add source SVG files to src/assets/icons/
1 parent aa61390 commit 47a7d29

File tree

8 files changed

+171
-11
lines changed

8 files changed

+171
-11
lines changed

src/assets/icons/history-1.svg

Lines changed: 22 additions & 0 deletions
Loading

src/assets/icons/history-2.svg

Lines changed: 7 additions & 0 deletions
Loading

src/assets/icons/history-3.svg

Lines changed: 5 additions & 0 deletions
Loading

src/assets/icons/history-4.svg

Lines changed: 7 additions & 0 deletions
Loading

src/assets/icons/history-5.svg

Lines changed: 5 additions & 0 deletions
Loading

src/assets/icons/history-6.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/SolanaCaseSection.tsx

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import { motion, useScroll, useTransform, useInView } from "framer-motion";
22
import ShimmerButton from "@/components/ShimmerButton";
3-
import { useRef } from "react";
3+
import React, { useRef } from "react";
44
import communityMp4 from "@/assets/video/community.mp4";
55
import communityWebm from "@/assets/video/community.webm";
6+
import {
7+
HistoryIcon1,
8+
HistoryIcon2,
9+
HistoryIcon3,
10+
HistoryIcon4,
11+
HistoryIcon5,
12+
HistoryIcon6,
13+
} from "@/components/icons/TimelineIcons";
614
import timelineHackathon from "@/assets/timeline-2-hackathon.webp";
715
import timelineBootcamp from "@/assets/timeline-3-bootcamp.webp";
816
import timelineTalents from "@/assets/timeline-4-talents.webp";
@@ -19,6 +27,7 @@ const TimelineItem = ({
1927
description,
2028
image,
2129
video,
30+
icon: Icon,
2231
link,
2332
index,
2433
viewMoreLabel,
@@ -29,6 +38,7 @@ const TimelineItem = ({
2938
description: string;
3039
image?: string;
3140
video?: { mp4: string; webm: string };
41+
icon?: React.ComponentType<{ className?: string }>;
3242
link?: string;
3343
index: number;
3444
viewMoreLabel: string;
@@ -101,13 +111,21 @@ const TimelineItem = ({
101111
{textContent}
102112
</motion.div>
103113

104-
<div className="flex items-center justify-center w-8">
114+
<div className="flex items-center justify-center w-10">
105115
<motion.div
106116
animate={isInView ? { scale: 1, opacity: 1 } : { scale: 0.5, opacity: 0.3 }}
107117
transition={{ duration: 0.4 }}
108-
className={`rounded-full border-2 border-primary z-10 ${isHeader ? "w-4 h-4" : "w-3 h-3"}`}
109-
style={dotStyle(isInView, isHeader ? "lg" : "sm")}
110-
/>
118+
className="z-10 flex items-center justify-center rounded-full border border-primary/40 bg-background w-10 h-10"
119+
style={{
120+
boxShadow: isInView ? `0 0 ${isHeader ? "16" : "12"}px hsl(145 100% 50% / 0.5)` : "none",
121+
}}
122+
>
123+
{Icon ? (
124+
<Icon className={`${isHeader ? "w-6 h-6" : "w-5 h-5"} text-primary`} />
125+
) : (
126+
<div className={`rounded-full border-2 border-primary ${isHeader ? "w-4 h-4" : "w-3 h-3"}`} style={dotStyle(isInView, isHeader ? "lg" : "sm")} />
127+
)}
128+
</motion.div>
111129
</div>
112130

113131
<motion.div
@@ -121,14 +139,22 @@ const TimelineItem = ({
121139
</div>
122140

123141
{/* ── Mobile: dot-column | content ── */}
124-
<div className="grid grid-cols-[16px_1fr] gap-0 md:hidden items-start">
142+
<div className="grid grid-cols-[32px_1fr] gap-0 md:hidden items-start">
125143
<div className="flex items-start justify-center pt-1">
126144
<motion.div
127145
animate={isInView ? { scale: 1, opacity: 1 } : { scale: 0.5, opacity: 0.3 }}
128146
transition={{ duration: 0.4 }}
129-
className={`rounded-full border-2 border-primary z-10 flex-shrink-0 ${isHeader ? "w-4 h-4" : "w-3 h-3"}`}
130-
style={dotStyle(isInView, isHeader ? "lg" : "sm")}
131-
/>
147+
className="z-10 flex-shrink-0 flex items-center justify-center rounded-full border border-primary/40 bg-background w-8 h-8"
148+
style={{
149+
boxShadow: isInView ? `0 0 ${isHeader ? "14" : "10"}px hsl(145 100% 50% / 0.5)` : "none",
150+
}}
151+
>
152+
{Icon ? (
153+
<Icon className={`${isHeader ? "w-5 h-5" : "w-4 h-4"} text-primary`} />
154+
) : (
155+
<div className={`rounded-full border-2 border-primary ${isHeader ? "w-4 h-4" : "w-3 h-3"}`} style={dotStyle(isInView, isHeader ? "lg" : "sm")} />
156+
)}
157+
</motion.div>
132158
</div>
133159

134160
<motion.div
@@ -169,33 +195,39 @@ const SolanaCaseSection = () => {
169195
description: "",
170196
image: undefined,
171197
isHeader: true,
198+
icon: HistoryIcon1,
172199
},
173200
{
174201
title: t("solana.card1.title"),
175202
description: t("solana.card1.desc"),
176203
link: "https://pt.w3d.community/search?q=solana",
177204
video: { mp4: communityMp4, webm: communityWebm },
205+
icon: HistoryIcon2,
178206
},
179207
{
180208
title: t("solana.card2.title"),
181209
description: t("solana.card2.desc"),
182210
image: timelineHackathon,
211+
icon: HistoryIcon3,
183212
},
184213
{
185214
title: t("solana.card3.title"),
186215
description: t("solana.card3.desc"),
187216
image: timelineBootcamp,
217+
icon: HistoryIcon4,
188218
},
189219
{
190220
title: t("solana.card4.title"),
191221
description: t("solana.card4.desc"),
192222
image: timelineTalents,
223+
icon: HistoryIcon5,
193224
},
194225
{
195226
title: t("solana.card5.title"),
196227
description: t("solana.card5.desc"),
197228
image: timelinePlaylist,
198229
link: "https://youtube.com/playlist?list=PLVX4xVoD65UOnAi_8t69_s7Dh4WiTziS2",
230+
icon: HistoryIcon6,
199231
},
200232
];
201233

@@ -205,12 +237,12 @@ const SolanaCaseSection = () => {
205237
<div className="relative flex flex-col gap-16">
206238
{/* Gray background track */}
207239
<div
208-
className="absolute left-1/2 top-0 bottom-0 -translate-x-1/2 max-[767px]:left-[7px] max-[767px]:translate-x-0"
240+
className="absolute left-1/2 top-0 bottom-0 -translate-x-1/2 max-[767px]:left-[15px] max-[767px]:translate-x-0"
209241
style={{ width: "3px", backgroundColor: "rgb(65, 65, 65)", zIndex: -2 }}
210242
/>
211243
{/* Animated gradient progress bar */}
212244
<motion.div
213-
className="absolute left-1/2 top-0 -translate-x-1/2 origin-top max-[767px]:left-[7px] max-[767px]:translate-x-0"
245+
className="absolute left-1/2 top-0 -translate-x-1/2 origin-top max-[767px]:left-[15px] max-[767px]:translate-x-0"
214246
style={{
215247
width: "3px",
216248
height: lineHeight,

0 commit comments

Comments
 (0)