Skip to content

Commit

Permalink
Merge pull request #178 from devarsheecodess/main
Browse files Browse the repository at this point in the history
Fixed Login Page and some minor issues #158
  • Loading branch information
vimistify authored Oct 5, 2024
2 parents 2c6cd0a + 4bb378f commit 7420b60
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 119 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@



# 🚑 Ambulance Tracking System
# 🚑 AmbuFlow

A mobile application built using HTML, CSS, JavaScript, and Google API that notifies patients of nearby hospitals and the estimated time of arrival of the ambulance. It provides hospitals and ambulance drivers with critical information such as the patient’s location and enables effective GPS route management via real-time traffic information on scheduled routes.

Expand Down
4 changes: 2 additions & 2 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ <h2>Emergency Care</h2>

<footer>

<p>&copy; 2024 Ambulance Monitoring System. All rights reserved.</p>
<p>&copy; 2024 AmbuFlow. All rights reserved.</p>

<div style="background-color: #333; color: white; padding: 20px;">
<div style="display: flex; justify-content: space-between; flex-wrap: wrap;">
Expand Down Expand Up @@ -219,7 +219,7 @@ <h3>Subscribe to Our Newsletter</h3>

<!-- Copyright Section -->
<div style="text-align: center; margin-top: 20px; border-top: 1px solid white; padding-top: 10px;">
<p>&copy; 2024 Ambulance Monitoring System. All rights reserved.</p>
<p>&copy; 2024 AmbuFlow. All rights reserved.</p>
</div>
</div>

Expand Down
10 changes: 5 additions & 5 deletions features.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@

<div class="content" id="main-content">
<h1>Features</h1>
<p>Here are the features of the Ambulance Monitoring System:</p>
<p>Here are the features of AmbuFlow:</p>
<div class="features-grid">
<div class="feature-card">
<i class="fas fa-ambulance feature-icon"></i>
Expand Down Expand Up @@ -186,7 +186,7 @@ <h2>Feedback System</h2>
<!-- Footer -->
<footer>

<p>&copy; 2024 Ambulance Monitoring System. All rights reserved.</p>
<p>&copy; 2024 AmbuFlow. All rights reserved.</p>

<div style="background-color: #333; color: white; padding: 20px;">
<div style="display: flex; justify-content: space-between; flex-wrap: wrap;">
Expand All @@ -201,14 +201,14 @@ <h3>Quick Links</h3>
<li><a href="sitemap.html" style="color: white; text-decoration: none;">Site Map</a></li>
</ul>
</div>
<p>&copy; 2024 Ambulance Tracking System. All rights reserved.</p>
<p>&copy; 2024 AmbuFlow. All rights reserved.</p>

</footer>

<!-- Contact Information Section -->
<div style="flex: 1; min-width: 200px;">
<h3>Contact Info</h3>
<p>Ambulance Monitoring System
<p>AmbuFlow
White road St, Newyork City, USA</p>
<p>Email:[email protected]</p>
<p>Phone: 9633700598</p>
Expand All @@ -235,7 +235,7 @@ <h3>Subscribe to Our Newsletter</h3>

<!-- Copyright Section -->
<div style="text-align: center; margin-top: 20px; border-top: 1px solid white; padding-top: 10px;">
<p>&copy; 2024 Ambulance Monitoring System. All rights reserved.</p>
<p>&copy; 2024 AmbuFlow. All rights reserved.</p>
</div>
</div>

Expand Down
35 changes: 27 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ambulance Monitoring System</title>
<title>AmbuFlow</title>
<link rel="stylesheet" href="src/css/index.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
Expand Down Expand Up @@ -32,6 +32,7 @@
padding: 10px 15px;
color: black;
text-decoration: none;
border-radius: 10px;
}
.menu ul li a.active {
color: white;
Expand Down Expand Up @@ -82,6 +83,30 @@
.feature p {
color: #555;
}
.team-feature, .contact-feature {
padding: 20px;
display: flex;
align-items: center;
text-align: left;
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
grid-column: 1 / -1;
}
.team-feature {
background-color: #e7ffe7;
}
.contact-feature {
background-color: #f2e4aa;
}
.team-feature img, .contact-feature img {
width: 150px;
height: auto;
margin-right: 20px;
border-radius: 10px;
}
.feature p {
color: #555;
}

.team-feature {
background-color: #e7ffe7;
Expand Down Expand Up @@ -122,8 +147,6 @@
color: white;
text-align: center;
padding: 10px 0;
position: relative;
bottom: 0;
width: 100%;
}

Expand All @@ -141,14 +164,9 @@

<header>
<div class="container">


<div class="logo">
<img src="images/logo2-w.webp" alt="Ambulance Monitoring System Logo" style="width:50px; height:auto;">

</div>


<nav class="menu">
<ul>
<li><a href="home.html" id="home-link" onclick="changeContent('home')">Home</a></li>
Expand Down Expand Up @@ -216,6 +234,7 @@ <h2>Contact Us</h2>
</div>

<footer>
<p>&copy; 2024 AmbuFlow. All rights reserved.</p>

<p>&copy; 2024 Ambulance Monitoring System. All rights reserved.</p>

Expand Down
206 changes: 108 additions & 98 deletions login.html
Original file line number Diff line number Diff line change
@@ -1,125 +1,135 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Register & Login</title>

<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<link
href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&display=swap"
rel="stylesheet"
/>

<!-- Boxicons -->
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link
href="https://unpkg.com/[email protected]/css/boxicons.min.css"
rel="stylesheet"
/>

<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>

<!-- Custom CSS -->
<link rel="stylesheet" href="src/css/login.css">
<link rel="stylesheet" href="src/css/login.css" />

<!-- EmailJS -->
<script src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js" type="text/javascript"></script>
</head>

<body>

<!-- Navbar Start -->
<div class="fixed-navbar">
<nav class="navbar">
<a href="index.html" class="logo"><i class="fa-solid fa-truck-medical"></i> Ambulance Tracking System</a>
<div class="navbar-nav">
<a href="roles.html" class="nav-link">Home</a>
<a href="#" class="nav-link">About Us</a>
<a href="#" class="nav-link">Contact</a>
<a href="login.html" class="nav-link">Login</a>
</div>
</nav>
</div>
<!-- Navbar End -->
<script
src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js"
type="text/javascript"
></script>
</head>

<body>
<!-- Login Form -->
<div class="wrapper">
<span class="rotate-bg"></span>
<span class="rotate-bg2"></span>

<div class="form-box login" style="padding-top: 60px;">
<h2 class="title animation" style="--i:0; --j:21">Login</h2>
<form id="loginForm">
<div class="input-box animation" style="--i:1; --j:22">
<input type="text" id="loginUsername" required>
<label>Username</label>
<i class='bx bxs-user'></i>
</div>
<div class="input-box animation" style="--i:2; --j:23">
<input type="password" id="loginPassword" required>
<label>Password</label>
<i class='bx bxs-lock-alt'></i>
<i class="fas fa-eye toggle-password" id="togglePassword" onclick="togglePassword()"></i>
</div>
<button type="submit" class="btn animation" style="--i:3; --j:24">Login</button>
<div class="linkTxt animation" style="--i:5; --j:25">
<p>Don't have an account? <a href="up.html">Sign Up</a></p>
</div>
</form>
</div>



<div class="form-box login" style="padding-top: 50px">
<h2 class="title animation" style="margin-bottom: 30px">Login</h2>
<form id="loginForm">
<div class="input-box animation" style="--i: 1; --j: 22">
<input type="text" id="loginUsername" required />
<label>Username</label>
<i class="bx bxs-user"></i>
</div>
<div class="input-box animation" style="--i: 2; --j: 23">
<input type="password" id="loginPassword" required />
<label>Password</label>
<i class="bx bxs-lock-alt"></i>
<i
class="fas fa-eye toggle-password"
id="togglePassword"
onclick="togglePassword()"
></i>
</div>
<button type="submit" class="btn animation" style="--i: 3; --j: 24">
Login
</button>
<div class="linkTxt animation" style="--i: 5; --j: 25">
<p>
Don't have an account?
<a href="#" class="register-link">Sign Up</a>
</p>
</div>
</form>
</div>
<span class="rotate-bg"></span>
<span class="rotate-bg2"></span>
</div>

<script>
// Toggle password visibility
function togglePassword() {
const password = document.getElementById('loginPassword');
const togglePassword = document.getElementById('togglePassword');

if (password.type === 'password') {
password.type = 'text';
togglePassword.classList.add('fa-eye-slash');
togglePassword.classList.remove('fa-eye');
} else {
password.type = 'password';
togglePassword.classList.add('fa-eye');
togglePassword.classList.remove('fa-eye-slash');
}
// Toggle password visibility
function togglePassword() {
const password = document.getElementById("loginPassword");
const togglePassword = document.getElementById("togglePassword");

if (password.type === "password") {
password.type = "text";
togglePassword.classList.add("fa-eye-slash");
togglePassword.classList.remove("fa-eye");
} else {
password.type = "password";
togglePassword.classList.add("fa-eye");
togglePassword.classList.remove("fa-eye-slash");
}

// Handle form submission
document.getElementById('loginForm').addEventListener('submit', function (event) {
event.preventDefault(); // Prevent form submission

const loginUsername = document.getElementById('loginUsername').value;
const loginPassword = document.getElementById('loginPassword').value;

// Retrieve stored user data (mocked with localStorage for demonstration)
const storedUser = JSON.parse(localStorage.getItem('user'));

// Validate credentials
if (storedUser && loginUsername === storedUser.username && loginPassword === storedUser.password) {
alert('Login successful! Redirecting to home page...');
localStorage.setItem('currentUser', loginUsername);
window.location.href = "index.html"; // Redirect to home page
} else {
alert('Invalid username or password.');
}
}

// Handle form submission
document
.getElementById("loginForm")
.addEventListener("submit", function (event) {
event.preventDefault(); // Prevent form submission

const loginUsername = document.getElementById("loginUsername").value;
const loginPassword = document.getElementById("loginPassword").value;

// Retrieve stored user data (mocked with localStorage for demonstration)
const storedUser = JSON.parse(localStorage.getItem("user"));

// Validate credentials
if (
storedUser &&
loginUsername === storedUser.username &&
loginPassword === storedUser.password
) {
alert("Login successful! Redirecting to home page...");
localStorage.setItem("currentUser", loginUsername);
window.location.href = "index.html"; // Redirect to home page
} else {
alert("Invalid username or password.");
}
});

// Handle registration link click
document.querySelector('.register-link').addEventListener('click', function () {
document.querySelector('.form-box.login').style.display = 'none';
document.querySelector('.form-box.register').style.display = 'block';
// Handle registration link click
document
.querySelector(".register-link")
.addEventListener("click", function () {
document.querySelector(".form-box.login").style.display = "none";
document.querySelector(".form-box.register").style.display = "block";
});

// Handle login link click
document.querySelector('.login-link').addEventListener('click', function () {
document.querySelector('.form-box.register').style.display = 'none';
document.querySelector('.form-box.login').style.display = 'block';
// Handle login link click
document
.querySelector(".login-link")
.addEventListener("click", function () {
document.querySelector(".form-box.register").style.display = "none";
document.querySelector(".form-box.login").style.display = "block";
});
</script>

</body>

</body>
</html>
2 changes: 1 addition & 1 deletion roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="header">
<div class="logo">
<i class="fa-solid fa-truck-medical"></i>
<a href="index.html" class="logo">Ambulance Tracking System </a>
<a href="index.html" class="logo">AmbuFlow </a>

</div>
<nav class="navbar">
Expand Down
Loading

0 comments on commit 7420b60

Please sign in to comment.