-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 feat : update styling of home page
- Loading branch information
dev-madhurendra
committed
Sep 20, 2024
1 parent
1e509e5
commit 7b10734
Showing
17 changed files
with
1,085 additions
and
144 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.tilt-container { | ||
perspective: 1000px; /* Add perspective to enhance the 3D effect */ | ||
} | ||
|
||
img { | ||
width: 100%; /* Adjust size as needed */ | ||
transform-style: preserve-3d; /* Enables 3D transformations */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { useState } from 'react'; | ||
import HeroSectionImage from '../../../../public/png/profile-pic.png' | ||
import './App.css'; | ||
import { HERO_SECTION_IMAGE } from '../../../utils/constants'; | ||
import { tiltedImageStyle } from '../../../services/mocks/mocks'; | ||
|
||
const TiltedHeroImage = () => { | ||
const [tilt, setTilt] = useState({ x: 0, y: 0 }); | ||
|
||
|
||
const handleMouseMove = (e: React.MouseEvent<HTMLImageElement, MouseEvent>) => { | ||
const { clientX, clientY, currentTarget } = e; | ||
const { width, height, left, top } = currentTarget.getBoundingClientRect(); | ||
|
||
|
||
const x = (clientX - left) / width; | ||
const y = (clientY - top) / height; | ||
|
||
|
||
const tiltX = (x - 0.5) * 30; | ||
const tiltY = (y - 0.5) * 30; | ||
|
||
setTilt({ x: tiltX, y: tiltY }); | ||
}; | ||
|
||
return ( | ||
<div | ||
className="tilt-container" | ||
onMouseMove={handleMouseMove} | ||
onMouseLeave={() => setTilt({ x: 0, y: 0 })} | ||
> | ||
<img | ||
src={HeroSectionImage} | ||
alt={HERO_SECTION_IMAGE} | ||
style={tiltedImageStyle(tilt.x, tilt.y)} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TiltedHeroImage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 65 additions & 7 deletions
72
frontend/src/components/molecules/SocialMediaIcons/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.