Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<!-- Other tags -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-RB7iwJYPqSZRBf7e0JfVZJ04QhY2kWrO0M8M6lSYqT2nEO+LXuDHTCx05l4mP7iSaFOU5HGXgNmeKZIB+Z2xJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand Down
24 changes: 24 additions & 0 deletions frontend/src/GlobalStyls.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* GlobalStyles.css */

/* Set the height of html and body to 100% to ensure the background image covers the entire viewport */
html, body {
height: 100%;
margin: 0;
padding: 0;
}

/* Apply a global background image to the body */
body {
background-image: url('/path/to/your/image.jpg'); /* Adjust the path to your image */
background-size: cover; /* Make sure the image covers the entire background */
background-repeat: no-repeat; /* Prevent the image from repeating */
background-position: center; /* Center the background image */
font-family: Arial, sans-serif; /* You can set a global font family here if desired */
}

/* Reset some default margins and paddings */
* {
box-sizing: border-box; /* Ensure padding and border are included in element's total width and height */
margin: 0;
padding: 0;
}
2 changes: 1 addition & 1 deletion frontend/src/Pages/About.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styles from './About.module.css'; // Import the CSS file
import styles from './About.module.css';

const About = () => {
return (
Expand Down
45 changes: 36 additions & 9 deletions frontend/src/Pages/About.module.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
/* styles.css */

/* Navbar Styles */
/* About Page Styles */

.about-container {
margin-top: 65px; /* To account for the fixed navbar */
margin-top: 65px;
padding: 20px;
text-align: center;
background: linear-gradient(to bottom right, #001F3F, #0d41c4);
color:#def2f9;
min-height: calc(100vh - 65px);
}
.about-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.9;
background:url('Images/4.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
z-index: -1;
}

.about-container {
margin-top: 65px;
padding: 20px;
text-align: center;
color: black;
min-height: calc(100vh - 65px);
position: relative;
z-index: -1;
border-radius: 15px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
}

.about-container h1 {
margin-top: 305px;
font-size: 2.5em;
margin-bottom: 20px;
color: #f9f9f9;
}
.about-container h2 {
margin-top: 25px;
Expand All @@ -31,11 +58,11 @@

.team-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Responsive grid columns */
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
max-width: 1200px;
margin: auto; /* Center the grid and adjust margin */
/* padding: 20px; */
margin: auto;


border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
Expand All @@ -60,7 +87,7 @@
color: #666;
}

/* Responsive Styles */

@media (max-width: 768px) {
.team-grid {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
Expand Down Expand Up @@ -98,4 +125,4 @@
.about-container p {
font-size: 0.9em;
}
}
}
131 changes: 70 additions & 61 deletions frontend/src/Pages/AdminLoginPage.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,83 @@

import drdo from "./Images/user.jpg";
import React, { useState } from 'react';
import { useHistory } from 'react-router-dom';
import axios from 'axios';
import styles from './AdminLoginPage.module.css';

const AdminLoginPage = () => {
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const history = useHistory();

const handleLogin = async () => {
try {
const response = await axios.post('http://localhost:5000/api/admin/login', {
username,
password,
});

if (response.data.token) {
localStorage.setItem('adminToken', response.data.token);
alert('login successful');
history.push('/admin/dashboard');
}
} catch (error) {
if (error.response) {
// Server responded with a status other than 2
console.error('Login failed:', error.response.data.message);
alert('Invalid username or password');
} else if (error.request) {
// Request was made but no response was received
console.error('No response received:', error.request);
alert('No response from the server. Please try again later.');
} else {
// Something else happened
console.error('Error:', error.message);
alert('An error occurred. Please try again.');
}
}
};
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const history = useHistory();

const handleSignupClick = () => {
history.push('/signup');
};
const handleLogin = async () => {
try {
const response = await axios.post('http://localhost:5000/api/admin/login', {
username,
password,
});

if (response.data.token) {
localStorage.setItem('adminToken', response.data.token);
alert('login successful');
history.push('/admin/dashboard');
}
} catch (error) {
if (error.response) {
// Server responded with a status other than 2
console.error('Login failed:', error.response.data.message);
alert('Invalid username or password');
} else if (error.request) {
// Request was made but no response was received
console.error('No response received:', error.request);
alert('No response from the server. Please try again later.');
} else {
// Something else happened
console.error('Error:', error.message);
alert('An error occurred. Please try again.');
}
}
};

const handleSignupClick = () => {
history.push('/signup');
};

return (
<div className={styles.containeradmin}>
<div className={styles.loginSection}>
<h2>Admin Login</h2>
<div className={styles.inputContainer}>
<input
type="text"
placeholder="User ID"
value={username}
onChange={(e) => setUsername(e.target.value)}
className={styles.input}
/>
return (
<div className={styles.adlog}>
<div className={styles.containeradmin} >
<img src={drdo} alt="" className={styles['lSignUP']} />
<div className={styles.loginSection}>
<h2>Admin Login</h2>
<form>
<div className={styles.inputContainer}>
<input
type="text"
placeholder="User ID"
value={username}
onChange={(e) => setUsername(e.target.value)}
className={styles.input}
/>
</div>
<div className={styles.inputContainer}>
<input
type="password"
placeholder="Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className={styles.input}
/>
</div>
<div className={styles.buttonContainer}>
<button onClick={handleLogin} className={styles.buttonadmin}>Login</button>
</div>
</form>
</div>
</div>
<div className={styles.inputContainer}>
<input
type="password"
placeholder="Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className={styles.input}
/>
</div>
<div className={styles.buttonContainer}>
<button onClick={handleLogin} className={styles.buttonadmin}>Login</button>
</div>
</div>
</div>
);
);
};

export default AdminLoginPage;


Loading