Skip to content

Commit aa0c0c8

Browse files
committed
Added tilt effect from react-tilt
1 parent 9866e2c commit aa0c0c8

File tree

4 files changed

+47
-9
lines changed

4 files changed

+47
-9
lines changed

frontend/package-lock.json

Lines changed: 38 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
"react-hot-toast": "^2.4.1",
2929
"react-i18next": "^14.1.2",
3030
"react-icons": "^5.2.1",
31+
"react-parallax-tilt": "^1.7.231",
3132
"react-router-dom": "^6.24.0",
3233
"react-share": "^5.1.0",
3334
"react-slick": "^0.30.2",
3435
"react-switch": "^7.0.0",
36+
"react-tilt": "^1.0.2",
3537
"react-tooltip": "^5.26.4",
3638
"recoil": "^0.7.7",
3739
"slick-carousel": "^1.8.1",

frontend/src/components/Showcase.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import editor from "../assets/editor.png";
33
import { useTranslation } from 'react-i18next';
4+
import Tilt from 'react-parallax-tilt';
45

56
const Showcase: React.FC = () => {
67
const { t } = useTranslation();
@@ -43,7 +44,9 @@ const Showcase: React.FC = () => {
4344
))}
4445
</div>
4546
<div className="mt-10 md:mt-0 md:w-1/2 flex justify-center">
46-
<img src={editor} alt="Code Editor" className="max-w-full mx-20 h-auto rounded-lg shadow-md" />
47+
<Tilt className="ml-0">
48+
<img src={editor} alt="Code Editor" className="max-w-full h-auto rounded-lg shadow-md" />
49+
</Tilt>
4750
</div>
4851
</div>
4952
</div>

frontend/src/pages/About.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import { Link } from "react-router-dom";
22
import about from '../assets/about.png'
33
import bgHero from "../assets/bgHero.png";
44
import { useTranslation } from 'react-i18next';
5+
import Tilt from 'react-parallax-tilt';
56

67
function About() {
78
const { t } = useTranslation();
89

910
return (
1011
<div className="w-full text-[#000435] bg-white dark:text-white dark:bg-[#000435] py-16 px-4"style={{ backgroundImage: `url(${bgHero})`, backgroundSize: 'cover', backgroundPosition: 'center' }} >
1112
<div className="max-w-[1240px] mx-auto grid md:grid-cols-2">
13+
<Tilt>
1214
<img className="w-[550px] mx-auto my-4" src={about} alt="About Us" />
15+
</Tilt>
1316
<div className="flex flex-col justify-center">
1417
<p className="bg-gradient-to-r from-blue-600 via-blue-500 to-white inline-block text-transparent bg-clip-text text-4xl font-bold py-1" >
1518
👨‍💻 {t('about.aboutHeading')}

0 commit comments

Comments
 (0)