Skip to content

Commit

Permalink
Improved UI of contact us page and fixes bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yazdanhaider committed Oct 21, 2024
1 parent 6ab5299 commit 0616f23
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 89 deletions.
2 changes: 2 additions & 0 deletions Frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Admin from './components/Admin';
import Footer from './components/Footer';
import NotFound from "./components/NotFound";
import ScrollToTopButton from "./components/ScrollToTopButton";
import ScrollToTop from "./components/ScrollToTop";
import AboutUs from './pages/AboutUs';
import Services from './pages/Services';
import PrivacyPolicy from './pages/PrivacyPolicy';
Expand All @@ -33,6 +34,7 @@ function App() {

return (
<Router>
<ScrollToTop />
<div className="bg-light min-h-screen font-sans text-primary">
<Header />
<main className="container mx-auto px-4 py-8">
Expand Down
Binary file added Frontend/src/assets/profile-pic.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Frontend/src/components/ScrollToTop.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

function ScrollToTop() {
const { pathname } = useLocation();

useEffect(() => {
window.scrollTo(0, 0);
}, [pathname]);

return null;
}

export default ScrollToTop;
39 changes: 13 additions & 26 deletions Frontend/src/pages/AboutUs.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { FaHeartbeat, FaCogs, FaUsers } from 'react-icons/fa';
import { motion } from 'framer-motion'; // Import motion for animation
import profilePic from '../assets/profile-pic.jpeg'; // Import the profile picture

const AboutUs = () => {
const features = [
Expand Down Expand Up @@ -39,17 +40,17 @@ const AboutUs = () => {
{features.map((feature, index) => (
<motion.div
key={index}
className="bg-white p-6 rounded-3xl shadow-lg text-center"
className="bg-white p-8 rounded-3xl shadow-lg text-center"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: index * 0.1 }}
whileHover={{ y: -10 }} // Hover effect
whileHover={{ y: -10 }}
>
<feature.icon className="text-4xl sm:text-5xl text-accent mb-4 mx-auto" />
<h3 className="text-lg sm:text-xl font-semibold mb-2 text-primary">
<feature.icon className="text-5xl sm:text-6xl text-accent mb-6 mx-auto" />
<h3 className="text-xl sm:text-2xl font-semibold mb-4 text-primary">
{feature.title}
</h3>
<p className="text-gray-600 text-sm sm:text-base">
<p className="text-gray-600 text-base sm:text-lg">
{feature.description}
</p>
</motion.div>
Expand All @@ -59,34 +60,20 @@ const AboutUs = () => {
{/* Team Section */}
<div className="bg-light p-8 rounded-lg">
<h2 className="text-3xl font-bold text-center text-primary mb-8">Meet Our Team</h2>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="flex justify-center">
<motion.div
className="team-member bg-white p-6 shadow-md rounded-lg text-center border border-accent"
whileHover={{ scale: 1.05 }} // Hover effect on team member cards
className="team-member bg-white p-6 shadow-md rounded-lg text-center border border-accent max-w-sm"
whileHover={{ scale: 1.05 }}
transition={{ duration: 0.3 }}
>
<img
src="https://via.placeholder.com/150"
src={profilePic}
alt="Team Member"
className="w-24 h-24 rounded-full mx-auto mb-4"
className="w-48 h-48 rounded-full mx-auto mb-6 object-cover"
/>
<h3 className="text-xl font-semibold mb-2 text-primary">Dr. John Doe</h3>
<p className="text-secondary">Chief Medical Officer</p>
<h3 className="text-xl font-semibold mb-2 text-primary">Yazdan Haider</h3>
<p className="text-lg text-secondary">Full Stack Developer</p>
</motion.div>
<motion.div
className="team-member bg-white p-6 shadow-md rounded-lg text-center border border-accent"
whileHover={{ scale: 1.05 }} // Hover effect on team member cards
transition={{ duration: 0.3 }}
>
<img
src="https://via.placeholder.com/150"
alt="Team Member"
className="w-24 h-24 rounded-full mx-auto mb-4"
/>
<h3 className="text-xl font-semibold mb-2 text-primary">Jane Smith</h3>
<p className="text-secondary">Lead Software Engineer</p>
</motion.div>
{/* Add more team members as needed */}
</div>
</div>
</div>
Expand Down
155 changes: 92 additions & 63 deletions Frontend/src/pages/ContactUs.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { useState } from 'react';
import { motion } from 'framer-motion';
import { FaEnvelope, FaPhone, FaMapMarkerAlt, FaPaperPlane } from 'react-icons/fa';

const ContactUs = () => {
const [formData, setFormData] = useState({
Expand All @@ -22,72 +24,99 @@ const ContactUs = () => {
};

return (
<div className="container mx-auto px-4 py-8">
<h1 className="text-3xl font-bold mb-6">Contact Us</h1>
<div className="bg-light min-h-screen py-12 px-4 sm:px-6 lg:px-8">
<div className="max-w-7xl mx-auto">
<motion.h1
className="text-4xl font-bold text-primary text-center mb-12"
initial={{ opacity: 0, y: -20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
>
Contact Us
</motion.h1>

<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
{/* Contact Information Cards */}
<div className="card bg-white p-6 shadow-md rounded-lg">
<h2 className="text-xl font-semibold mb-2">Email</h2>
<p className="text-gray-700">[email protected]</p>
</div>
<div className="card bg-white p-6 shadow-md rounded-lg">
<h2 className="text-xl font-semibold mb-2">Phone</h2>
<p className="text-gray-700">+1 (555) 123-4567</p>
</div>
<div className="card bg-white p-6 shadow-md rounded-lg">
<h2 className="text-xl font-semibold mb-2">Address</h2>
<p className="text-gray-700">123 Healthcare Street, Medical City, HC 12345</p>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-12">
{/* Contact Information */}
<motion.div
className="bg-white p-8 rounded-lg shadow-lg"
initial={{ opacity: 0, x: -50 }}
animate={{ opacity: 1, x: 0 }}
transition={{ duration: 0.5, delay: 0.2 }}
>
<h2 className="text-2xl font-semibold text-primary mb-6">Get in Touch</h2>
<div className="space-y-4">
<div className="flex items-center">
<FaEnvelope className="text-accent mr-4 text-xl" />
<p>[email protected]</p>
</div>
<div className="flex items-center">
<FaPhone className="text-accent mr-4 text-xl" />
<p>+1 (555) 123-4567</p>
</div>
<div className="flex items-center">
<FaMapMarkerAlt className="text-accent mr-4 text-xl" />
<p>123 Healthcare Street, Medical City, HC 12345</p>
</div>
</div>
</motion.div>

{/* Contact Form */}
<div className="bg-white p-8 shadow-md rounded-lg">
<h2 className="text-2xl font-semibold mb-4">Get in Touch</h2>
<form onSubmit={handleSubmit} className="space-y-6">
<div>
<label htmlFor="name" className="block text-lg font-medium mb-1">Name</label>
<input
type="text"
id="name"
name="name"
value={formData.name}
onChange={handleChange}
className="w-full px-4 py-2 border rounded-md focus:outline-none focus:ring focus:ring-blue-500"
required
/>
</div>
<div>
<label htmlFor="email" className="block text-lg font-medium mb-1">Email</label>
<input
type="email"
id="email"
name="email"
value={formData.email}
onChange={handleChange}
className="w-full px-4 py-2 border rounded-md focus:outline-none focus:ring focus:ring-blue-500"
required
/>
</div>
<div>
<label htmlFor="message" className="block text-lg font-medium mb-1">Message</label>
<textarea
id="message"
name="message"
value={formData.message}
onChange={handleChange}
className="w-full px-4 py-2 border rounded-md focus:outline-none focus:ring focus:ring-blue-500"
rows="4"
required
></textarea>
</div>
<button
type="submit"
className="w-full py-2 px-4 bg-blue-500 text-white font-semibold rounded-md hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
{/* Contact Form */}
<motion.div
className="bg-white p-8 rounded-lg shadow-lg"
initial={{ opacity: 0, x: 50 }}
animate={{ opacity: 1, x: 0 }}
transition={{ duration: 0.5, delay: 0.4 }}
>
Send Message
</button>
</form>
<h2 className="text-2xl font-semibold text-primary mb-6">Send Us a Message</h2>
<form onSubmit={handleSubmit} className="space-y-4">
<div>
<label htmlFor="name" className="block text-sm font-medium text-gray-700 mb-1">Name</label>
<input
type="text"
id="name"
name="name"
value={formData.name}
onChange={handleChange}
className="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-accent"
required
/>
</div>
<div>
<label htmlFor="email" className="block text-sm font-medium text-gray-700 mb-1">Email</label>
<input
type="email"
id="email"
name="email"
value={formData.email}
onChange={handleChange}
className="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-accent"
required
/>
</div>
<div>
<label htmlFor="message" className="block text-sm font-medium text-gray-700 mb-1">Message</label>
<textarea
id="message"
name="message"
value={formData.message}
onChange={handleChange}
className="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-accent"
rows="4"
required
></textarea>
</div>
<motion.button
type="submit"
className="w-full py-2 px-4 bg-accent text-primary font-semibold rounded-md hover:bg-primary hover:text-accent transition duration-300 flex items-center justify-center"
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
>
<FaPaperPlane className="mr-2" />
Send Message
</motion.button>
</form>
</motion.div>
</div>
</div>
</div>
);
Expand Down

0 comments on commit 0616f23

Please sign in to comment.