Skip to content

Commit 9d31062

Browse files
authored
Merge pull request #3 from nulla-dev/image-hover-component
Added new UI Component - Image Hover component with hover effects
2 parents 9a42cf0 + b97e8b9 commit 9d31062

4 files changed

Lines changed: 78 additions & 0 deletions

File tree

configs/componentsDocumentation.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@
124124
"type": "card-hover",
125125
"new": true
126126
},
127+
{
128+
"name": "Image Hover",
129+
"componentArray": [
130+
{
131+
"componentName": "image-hover",
132+
"filesrc": "components/image-hover/image-hover.tsx",
133+
"iframeSrc": "live-components/image-hover",
134+
"parentlink": "image-hover",
135+
"parentName": "Image Hover"
136+
}
137+
],
138+
"type": "image-hover",
139+
"new": true
140+
},
127141
{
128142
"name": "Footers",
129143
"componentArray": [

configs/leftSideComponentMetaData.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ export const basicComponents = [
1818
component: 'card',
1919
new: true,
2020
},
21+
{
22+
href: '/components/image-hover',
23+
name: 'Image Hover',
24+
component: 'image-hover',
25+
new: true,
26+
},
2127
{
2228
href: '/components/footers',
2329
name: 'Footers'

content/components/image-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: 'Image Hover',
3+
description: 'A image component with a hover effect, where the image scales up and casts a shadow when hovered over. The image 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='image-hover' hasReTrigger isFitheight />
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
'use client';
2+
import React from 'react';
3+
4+
export default function ImageHover() {
5+
6+
type ImageDataType = {
7+
imgURL: string;
8+
redirectURL?: string;
9+
}
10+
11+
const imageData: ImageDataType[] = [
12+
{
13+
imgURL: "https://images.unsplash.com/photo-1571741164507-777ed01b36a2?q=80&w=2670",
14+
redirectURL: "/",
15+
},
16+
{
17+
imgURL: "https://images.unsplash.com/photo-1746289434176-40f821d31216?q=80&w=2670",
18+
redirectURL: "/",
19+
},
20+
{
21+
imgURL: "https://images.unsplash.com/photo-1710402536084-b583dc4df3ca?q=80&w=2670",
22+
redirectURL: "/",
23+
},
24+
{
25+
imgURL: "https://images.unsplash.com/photo-1694315643343-b32de9a66d63?q=80&w=2670",
26+
redirectURL: "/",
27+
}
28+
];
29+
30+
31+
return (
32+
<>
33+
<section className="">
34+
<div className="2xl:max-w-screen-3xl mx-auto flex mt-12 max-w-screen-xl flex-col justify-center space-y-24 px-8 py-12 md:px-12 lg:py-24">
35+
<div className="mx-auto flex flex-col sm:flex-row">
36+
{imageData.map((item, index) => (
37+
<a key={index} href={item.redirectURL} target="_blank" rel="noreferrer">
38+
<img
39+
src={item.imgURL}
40+
className={`h-full w-full origin-bottom transform rounded-xl object-cover duration-500 hover:-translate-y-12 hover:scale-150 hover:rotate-0 ${index % 2 === 0 ? 'rotate-6' : '-rotate-12'}`}
41+
alt="struct-ui-image-hover"
42+
/>
43+
</a>
44+
))}
45+
</div>
46+
</div>
47+
</section>
48+
</>
49+
);
50+
}

0 commit comments

Comments
 (0)