Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ion timeline now works
  • Loading branch information
everybodyloveshaggis committed Apr 10, 2024
1 parent 86b2649 commit b84527c
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 17 deletions.
6 changes: 5 additions & 1 deletion app/globals.css
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;
}
54 changes: 48 additions & 6 deletions components/experience.tsx
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>
)
}
40 changes: 34 additions & 6 deletions components/skills.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,46 @@
import React from 'react'
import SectionHeading from './section-heading'
import { skillsData } from '../lib/data'
import React from 'react';
import { skillsData } from '../lib/data';
import { useSectionInView } from '../lib/hooks';
import { animate, motion } from 'framer-motion'
import SectionHeading from './section-heading';

const fadeInAnimationVariance ={
initial: {
opacity: 0,
y:100,
},
animate: (index: number) => ({
opacity: 1,
y: 0,
transition: {
delay: 0.05*index,
},
}),
};

export default function Skills() {

const { ref } = useSectionInView('Skills');

return (
<section ref={ref} id='skills'>
<section className='mb-28 max-w-[53rem] scroll-mt-28 text-center sm:mb-40'
ref={ref}
id='skills'>
<SectionHeading>My Skills</SectionHeading>
<ul>
<ul className='flex flex-wrap justify-center gap-2 text-lg text-gray-800'>
{
skillsData.map((skill,index) => (
<li key={index}>{skill}</li>
<motion.li className='bg-white border border-black/[0.1] rounded-xl px-5 py-3'
key={index}
variants={fadeInAnimationVariance}
initial="initial"
whileInView="animate"
viewport={
{
once: true
}
}
custom={index}>{skill}</motion.li>
))
}
</ul>
Expand Down
40 changes: 36 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
"react-dom": "^18",
"react-icons": "^4.12.0",
"react-intersection-observer": "^9.8.1",
"react-vertical-timeline-component": "^3.6.0",
"sharp": "^0.33.3"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react-vertical-timeline-component": "^3.3.6",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.0.3",
Expand Down

0 comments on commit b84527c

Please sign in to comment.