-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTimeline.tsx
More file actions
53 lines (46 loc) · 1.91 KB
/
Timeline.tsx
File metadata and controls
53 lines (46 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from "react";
import { gsap } from "gsap";
import data from "../Constants/timelineData.json";
const Timeline = () => {
const items = data;
const hide = (elem: JSX.Element) => {
gsap.set(elem, { autoAlpha: 0 });
};
return (
<div className="flex flex-col">
<div className="dark:text-white text-black font-black text-2xl mt-4 w-full text-center">Timeline</div>
<div className="timeline">
<ul>
{items.map((te, idx) => {
return (
<li key={`${te.title}_${te.date}`}>
<div className="content">
<h3
className={`animate ${idx % 2 === 0 ? "slide_from_left" : "slide_from_right"
}`}
>
{te.title}
</h3>
<p
className={`animate ${idx % 2 === 0 ? "slide_from_left" : "slide_from_right"
}`}
>
{te.description}
</p>
</div>
<div
className={`time animate ${idx % 2 === 0 ? "slide_from_right" : "slide_from_left"
}`}
>
<h4>{te.date}</h4>
</div>
</li>
);
})}
<div style={{ clear: "both" }}></div>
</ul>
</div>
</div>
);
};
export default Timeline;