-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thanks to stephane-monnot/react-vertical-timeline#166 (comment) solut…
…ion timeline now works
- Loading branch information
1 parent
86b2649
commit b84527c
Showing
5 changed files
with
125 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@tailwind utilities; | ||
|
||
html { | ||
--line-color: #e5e7eb; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,57 @@ | ||
"use client" | ||
import React from 'react' | ||
import { useSectionInView } from '../lib/hooks'; | ||
import SectionHeading from './section-heading'; | ||
import { VerticalTimeline, VerticalTimelineElement } from 'react-vertical-timeline-component'; | ||
import 'react-vertical-timeline-component/style.min.css'; | ||
import { experiencesData } from '../lib/data' | ||
import { useSectionInView } from '../lib/hooks'; | ||
import { useInView } from 'react-intersection-observer'; | ||
|
||
|
||
export default function Experience() { | ||
const { ref } = useSectionInView('Experience'); | ||
const { ref } = useSectionInView('Experience'); | ||
|
||
return ( | ||
<section | ||
ref={ref} | ||
id='Experience'> | ||
<SectionHeading>Experience</SectionHeading> | ||
<section | ||
ref={ref} | ||
id='experience'> | ||
<SectionHeading>My Experience</SectionHeading> | ||
<VerticalTimeline lineColor=''> | ||
{experiencesData.map((item, index) => { | ||
const { ref, inView } = useInView({ | ||
triggerOnce: true, | ||
}); | ||
return ( | ||
<div key={index} ref={ref} className="vertical-timeline-element"> | ||
<VerticalTimelineElement | ||
contentStyle={{ | ||
background: '#f3f4f6', | ||
boxShadow: 'none', | ||
border: '1px solid rgba(0, 0, 0, 0.05)', | ||
textAlign: 'left', | ||
padding: '1.3rem 2rem', | ||
}} | ||
contentArrowStyle={{ | ||
borderRight: '0.4rem solid #9ca3af', | ||
}} | ||
visible={inView} | ||
date={item.date} | ||
icon={item.icon} | ||
iconStyle={{ | ||
background: 'white', | ||
fontSize: '1.5rem', | ||
}} | ||
> | ||
<h3 className="font-semibold capitalize">{item.title}</h3> | ||
<p className="!mt-0 font-normal">{item.location}</p> | ||
<p className="!mt-1 !font-normal text-gray-700"> | ||
{item.description} | ||
</p> | ||
</VerticalTimelineElement> | ||
</div> | ||
); | ||
})} | ||
</VerticalTimeline> | ||
</section> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters