Skip to content

Commit b7ad445

Browse files
authored
Merge pull request #1 from TheUndefinedCoders/add-new-component
Steps to add a new Component.
2 parents 762416d + 8413681 commit b7ad445

7 files changed

Lines changed: 213 additions & 0 deletions

File tree

assets/preview/card-hover.svg

Lines changed: 73 additions & 0 deletions
Loading

assets/preview/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import card from '@/assets/preview/card.svg';
33
import buttons from '@/assets/preview/buttons.svg';
44
import motionNumber from '@/assets/preview/motion-number.svg';
55
import clippath from '@/assets/preview/clip-path.svg';
6+
import cardHover from '@/assets/preview/card-hover.svg';
67

78

89
const preview = {
@@ -11,5 +12,6 @@ const preview = {
1112
clippath,
1213
buttons,
1314
card,
15+
cardHover,
1416
};
1517
export default preview;

configs/componentsDocumentation.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@
7676
"type": "clip-path",
7777
"new": true
7878
},
79+
{
80+
"name": "Card-Hover",
81+
"componentArray": [
82+
{
83+
"componentName": "card-hover",
84+
"filesrc": "components/card-hover/card-hover.tsx",
85+
"iframeSrc": "live-components/card-hover",
86+
"parentlink": "card-hover",
87+
"parentName": "Card Hover"
88+
}
89+
],
90+
"type": "card-hover",
91+
"new": true
92+
},
7993
{
8094
"name": "Product Cards",
8195
"componentArray": [

configs/componentsOverview.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ const componentsOverviewCards = [
3131
name: 'Cards',
3232
imgSrc: preview.card,
3333
},
34+
{
35+
id: 'card-hover',
36+
url: '/components/card-hover',
37+
name: 'Card Hover Comp-tab',
38+
imgSrc: preview.cardHover,
39+
},
3440
];
3541

3642
export default componentsOverviewCards;

configs/leftSideComponentMetaData.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ export const basicComponents = [
1212
name: 'Products-Cards',
1313
component: 'card',
1414
},
15+
{
16+
href: '/components/card-hover',
17+
name: 'Card Hover',
18+
component: 'card',
19+
new: true,
20+
},
1521
{
1622
href: '/components/footers',
1723
name: 'Footers'

content/components/card-hover.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export const metadata = {
2+
title: 'Card Hover',
3+
description: 'A card component with a hover effect, where the card scales up and casts a shadow when hovered over. The card also has a hover effect for the text, where the text scales up and turns bold when hovered over.',
4+
};
5+
6+
## Component
7+
8+
<ComponentCodePreview name='card-hover' hasReTrigger isFitheight />
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
'use client';
2+
import React from 'react';
3+
4+
export default function CardHover() {
5+
6+
type UserDataType = {
7+
name: string;
8+
role: string;
9+
company: string;
10+
image?: string;
11+
description: string;
12+
skills: string[];
13+
portfilioLink?: string;
14+
}
15+
16+
const userData: UserDataType[] = [
17+
{
18+
name: "Md Numan Ahmed",
19+
role: "SDE-III",
20+
company: "Struct-UI",
21+
image: "https://numan-dev.web.app/images/my-pic.png",
22+
description: "Hi, I'm Numan. I've been working as a Software Engineer (Full Stack) for over 5 years. In this time, I've helped build and scale applications for different kinds of projects, from startups to growing businesses. While many know me as a “Full Stack” engineer, I like to see myself as a passionate problem solver — always eager to learn, share knowledge, and push boundaries to create meaningful digital experiences.",
23+
skills: ["Next.js", "React", "Angular", "Node.js"],
24+
portfilioLink: "https://numan-dev.web.app",
25+
},
26+
{
27+
name: "Yogesh Mishra",
28+
role: "SDE-II",
29+
company: "Struct-UI",
30+
image: "",
31+
description: "I am Yogesh Mishra, a software engineer with over 3 years of experience in building scalable web applications. I have a strong foundation in React, Node.js, and Next.js, and I am passionate about learning new technologies and staying up-to-date with industry trends. Yogesh is a team player with a strong work ethic and is always eager to help others. He is currently working as a Software Engineer at Struct-UI and is responsible for developing and maintaining the company's web applications.",
32+
skills: ["React", "Node.js", "Next.js", "TypeScript"],
33+
portfilioLink: "https://linktr.ee/yogi.js",
34+
}
35+
]
36+
37+
const getInitials = (fullName: string) => {
38+
if (!fullName) return "N A";
39+
const nameParts = fullName.trim().split(/\s+/);
40+
const firstName = nameParts[0]?.[0] || "";
41+
const lastName = nameParts[nameParts.length - 1]?.[0] || "";
42+
return (`${firstName} ${lastName}`).toUpperCase();
43+
}
44+
45+
return (
46+
<>
47+
<div className="flex items-center justify-around flex-wrap">
48+
49+
{userData.map((user, index) => (
50+
<div key={index} className="group relative w-80 transform overflow-hidden rounded-md bg-white p-6 text-gray-800 shadow-lg ring-1 ring-gray-100 transition-transform duration-500 hover:-translate-y-2 hover:scale-105 focus:ring-4 focus:ring-indigo-300 focus:outline-none dark:bg-gray-800 dark:text-gray-100 dark:shadow-2xl dark:ring-gray-700 dark:focus:ring-indigo-600" aria-label="Cool hover effect card">
51+
<span className="pointer-events-none absolute -top-10 -left-8 h-40 w-40 transform rounded-full bg-gradient-to-tr from-indigo-300 via-pink-300 to-rose-300 opacity-30 blur-3xl transition-all duration-500 group-hover:scale-110 group-hover:opacity-60 dark:opacity-20"></span>
52+
<span className="pointer-events-none absolute -right-10 -bottom-10 h-48 w-48 transform rounded-full bg-gradient-to-bl from-emerald-200 via-cyan-200 to-indigo-200 opacity-25 blur-3xl transition-all duration-700 group-hover:scale-105 group-hover:opacity-50 dark:opacity-10"></span>
53+
54+
<div className="glass-blur pointer-events-none absolute inset-x-0 top-0 h-14 bg-white/30 mix-blend-overlay dark:bg-gray-900/30"></div>
55+
56+
<div className="relative z-10 flex flex-col gap-4">
57+
<div className="flex items-center justify-between">
58+
<div className="flex items-center gap-3">
59+
<div className="h-12 w-12 overflow-hidden rounded-full bg-gradient-to-br from-blue-400 to-cyan-400 flex items-center justify-center">
60+
{user.image ? (
61+
<img src={user.image} alt={user.name} />
62+
) : (
63+
<span className="text-white font-bold">{getInitials(user.name)}</span>
64+
)}
65+
</div>
66+
<div>
67+
<h3 className="text-lg leading-tight font-semibold">{user.name}</h3>
68+
<p className="text-sm text-gray-500 dark:text-gray-300/70">
69+
{user.role} at <span className="font-semibold">{user.company}</span>
70+
</p>
71+
</div>
72+
</div>
73+
</div>
74+
75+
<div className="max-h-[14rem] overflow-hidden text-ellipsis">
76+
<p className="text-sm text-gray-600 dark:text-gray-300/80 line-clamp-5">
77+
{user.description}
78+
</p>
79+
</div>
80+
81+
<div className="flex flex-wrap gap-2">
82+
{user.skills.map((skill, index) => (
83+
<span key={index} className="cursor-pointer rounded-md bg-gray-100 px-2 py-1 text-xs text-gray-700 dark:bg-gray-700/40 dark:text-gray-200">{skill}</span>
84+
))}
85+
</div>
86+
87+
<div className="pt-2 w-full">
88+
<a href={user.portfilioLink ? user.portfilioLink : "#"} target="_blank" className="w-full py-1.5 px-4 bg-gradient-to-r from-cyan-500 to-blue-600 text-white font-medium rounded-md transition-all duration-300 hover:from-cyan-600 hover:to-blue-700 hover:shadow-lg transform hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-cyan-400 focus:ring-opacity-50 dark:from-cyan-600 dark:to-blue-700 dark:hover:from-cyan-700 dark:hover:to-blue-800 flex items-center justify-center">
89+
<div className="flex items-center justify-between w-full">
90+
<span>View Portfolio</span>
91+
<svg className="h-4 w-4 " xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5" aria-hidden="true">
92+
<path stroke-linecap="round" stroke-linejoin="round" d="M17 8l4 4m0 0l-4 4m4-4H3" />
93+
</svg>
94+
</div>
95+
</a>
96+
</div>
97+
</div>
98+
</div>
99+
))}
100+
101+
</div>
102+
</>
103+
);
104+
}

0 commit comments

Comments
 (0)