diff --git a/src/components/AboutUs-section/AboutUs.jsx b/src/components/AboutUs-section/AboutUs.jsx index 218cdebe..b6763aa3 100644 --- a/src/components/AboutUs-section/AboutUs.jsx +++ b/src/components/AboutUs-section/AboutUs.jsx @@ -1,18 +1,59 @@ +import { useState } from "react"; import rentBoardImg from "../.././assets/Images/rent-board.png"; import "./AboutUs-section.css"; import Lottie from "lottie-react"; import rent from "./rent.json"; const AboutUs = () => { + const [gradientStyle, setGradientStyle] = useState({}); + + // Function to handle mouse movement and update gradient + const handleMouseMove = (e) => { + const { offsetX, offsetY, target } = e.nativeEvent; + const { clientWidth, clientHeight } = target; + + // Calculate percentage position of the mouse within the card + const xPercent = (offsetX / clientWidth) * 100; + const yPercent = (offsetY / clientHeight) * 100; + + // Set radial gradient color based on mouse position + setGradientStyle({ + background: `radial-gradient(circle at ${xPercent}% ${yPercent}%, #FFB74D, #FFAB91, #FFF9C4)`, + }); + }; + + // Reset gradient when mouse leaves the section + const handleMouseLeave = () => { + setGradientStyle({ + background: "#EBB4B6", // Default background color (soft mint) + }); + }; + return (
- About Us -
- -
-

- Rentalog is a web application that makes it easy for landlords to + + About Us + +

+ +
+

+ Rentalog is a web application that makes it easy for landlords to manage their rental properties. With Rentalog, landlords can keep track of important information about their renters, including their names, addresses, and rental payment history. This information is @@ -31,7 +72,6 @@ const AboutUs = () => { smoothly.

-
); diff --git a/src/components/Services-section/ServicesCard.jsx b/src/components/Services-section/ServicesCard.jsx index 6b3a719c..4452ea53 100644 --- a/src/components/Services-section/ServicesCard.jsx +++ b/src/components/Services-section/ServicesCard.jsx @@ -1,18 +1,41 @@ +import { useState } from "react"; import PropTypes from "prop-types"; + const ServicesCard = (props) => { + const [gradientStyle, setGradientStyle] = useState({}); + + // Function to calculate the gradient based on mouse position + const handleMouseMove = (e) => { + const { offsetX, offsetY, target } = e.nativeEvent; + const { clientWidth, clientHeight } = target; + + // Calculate percentage position of the mouse within the card + const xPercent = (offsetX / clientWidth) * 100; + const yPercent = (offsetY / clientHeight) * 100; + + // Set the background gradient based on mouse position + setGradientStyle({ + background: `radial-gradient(circle at ${xPercent}% ${yPercent}%, #ff7e5f, #feb47b)`, + }); + }; + + // Reset the gradient when the mouse leaves the card + const handleMouseLeave = () => { + setGradientStyle({}); + }; + return (
- {props.alt} + {props.alt}

{props.title}

@@ -21,6 +44,7 @@ const ServicesCard = (props) => {
); }; + ServicesCard.propTypes = { bgColor: PropTypes.string.isRequired, icon: PropTypes.string.isRequired, @@ -28,4 +52,5 @@ ServicesCard.propTypes = { alt: PropTypes.string.isRequired, description: PropTypes.string.isRequired, }; + export default ServicesCard;