Skip to content

Commit 6e275ee

Browse files
feat: create a dynamic Skill Bar component to showcase each skill with icon and customisable progress bar
1 parent 7b720a7 commit 6e275ee

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

src/components/SkillBar.jsx

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { motion } from "motion/react";
2+
3+
const SkillBar = ({ logoName, icon: Icon, percentage = 100 }) => {
4+
return (
5+
<div className="mt-2 flex w-64 flex-col gap-2 text-dark-blue dark:text-custom-yellow">
6+
<div className="flex items-center justify-between">
7+
<Icon className="text text-4xl" />
8+
<span className="select-none font-semibold">{logoName}</span>
9+
</div>
10+
<div className="h-1 w-full overflow-hidden rounded-full bg-white">
11+
<motion.div
12+
className="h-1 rounded-full bg-light-blue dark:bg-custom-violet"
13+
initial={{ width: 0 }}
14+
animate={{ width: `${percentage}%` }}
15+
transition={{
16+
type: "spring",
17+
stiffness: 120,
18+
damping: 10,
19+
duration: 1,
20+
}}
21+
/>
22+
</div>
23+
</div>
24+
);
25+
};
26+
27+
export default SkillBar;

src/components/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ export { default as ScrollDown } from "./ScrollDown";
1414
export { default as Rocket } from "./Rocket";
1515
export { default as SocialCard } from "./SocialCard";
1616
export { default as TerminalContactForm } from "./TerminalContactForm";
17+
export { default as SkillBar } from "./SkillBar";

src/sections/Skills.jsx

+27
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
LogoItemsFlipper,
44
SectionHeading,
55
SectionSubHeading,
6+
SkillBar,
67
} from "../components";
78
import { LOGO_ITEM_STYLES } from "../utils/constants";
89

@@ -26,6 +27,32 @@ const Skills = () => {
2627
))}
2728
/>
2829
</div>
30+
<div>
31+
<SkillBar
32+
icon={LOGO_ITEM_STYLES[4].icon}
33+
logoName={LOGO_ITEM_STYLES[4].logoName}
34+
/>
35+
<SkillBar
36+
percentage={40}
37+
icon={LOGO_ITEM_STYLES[2].icon}
38+
logoName={LOGO_ITEM_STYLES[2].logoName}
39+
/>
40+
<SkillBar
41+
icon={LOGO_ITEM_STYLES[1].icon}
42+
logoName={LOGO_ITEM_STYLES[1].logoName}
43+
percentage={10}
44+
/>
45+
<SkillBar
46+
icon={LOGO_ITEM_STYLES[5].icon}
47+
logoName={LOGO_ITEM_STYLES[5].logoName}
48+
percentage={80}
49+
/>
50+
<SkillBar
51+
icon={LOGO_ITEM_STYLES[8].icon}
52+
logoName={LOGO_ITEM_STYLES[8].logoName}
53+
percentage={70}
54+
/>
55+
</div>
2956
</section>
3057
);
3158
};

0 commit comments

Comments
 (0)