Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to the Doctor Appointment booking page #515 #619

Closed
wants to merge 12 commits into from
Closed
179 changes: 179 additions & 0 deletions Reset_Password.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" />
<title>Reset Password</title>

<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
min-height: 100vh;
background: linear-gradient(to right, #b1b1b1b9, #838a9393);
background-image: url(./img/medicine.jpg);
display: flex;
justify-content: center;
align-items: center;
font-family: 'Poppins', sans-serif;
background-repeat: no-repeat;
background-size: cover;
}

.container {
width: 50vh;
height: 50vh;
border-radius: 3vh;
background: #fef9ef72;
backdrop-filter: blur(20px);
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.2),
10px 10px 20px rgba(0, 0, 0, 0.2);
text-align: center;
padding: 20px;
}

.top {
margin-bottom: 5vh;
}

.top span {
font-size: 25px;
letter-spacing: 0.2vh;
font-weight: 700;
color: #264653;
text-shadow: 1px 1px 2px rgba(83, 154, 182, 1);
}

.inputBox {
box-shadow: rgb(219, 219, 219) 3px 3px 6px 0px inset,
rgba(221, 220, 220, 0.301) -3px -3px 6px 1px inset;
display: flex;
justify-content: space-around;
align-items: center;
margin: 0 auto;
width: 40vh;
height: 6vh;
margin-bottom: 4vh;
border-radius: 5vh;
}

.inputBox:focus-within {
box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.1),
-5px -5px 10px rgba(255, 255, 255, 0.5);
outline: 0.5vh solid #264653a1;
}

.input {
height: 4vh;
width: 30vh;
margin-left: -2vh;
border: none;
outline: none;
background: inherit;
}

.input::placeholder {
color: black;
letter-spacing: 0.05em;
font-size: 14px;
}

.btn {
margin-top: 2vh;
height: 5vh;
width: 10vh;
border: none;
border-radius: 5vh;
background: transparent;
cursor: pointer;
color: #264653;
border: 1px solid #264653;
font-weight: 600;
transition: 0.3s ease;
box-shadow: rgba(0, 0, 0, 0.18) 0px 2px 4px;
}

.btn:hover {
background: #264653;
color: #fff;
}

.message {
margin-top: 15px;
color: green;
}
</style>
</head>

<body>
<div class="container">
<div class="top">
<span>Reset Password</span>
</div>
<div class="form">
<form id="resetPasswordForm" action="/send_reset_link" method="post">
<div class="inputBox">
<label><i class="fa-solid fa-user"></i></label>
<input type="text" placeholder="Registered Email" class="input" name="identifier" required>
</div>
<div class="inputBox">
<label><i class="fa-solid fa-phone"></i></label>
<input type="tel" placeholder="Phone Number" class="input" name="phone">
</div>
<button type="submit" class="btn">Send Reset Link</button>
<div class="message" id="successMessage" style="display:none;">Reset link sent! Check your email.
</div>
</form>
</div>
</div>

<script>
document.getElementById("resetPasswordForm").addEventListener("submit", function (event) {
event.preventDefault(); // Prevent default form submission

const identifier = document.querySelector("input[name='identifier']").value.trim();
const phone = document.querySelector("input[name='phone']").value.trim();

// Username validation (assuming it's the identifier here)
if (identifier === "") {
alert("Email is required");
return;
}

// Email validation
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailPattern.test(identifier)) {
alert("Please enter a valid email address");
return;
}

// Phone number validation (Indian numbers starting with 6, 7, 8, or 9 and exactly 10 digits)
const phonePattern = /^[6-9][0-9]{9}$/;
if (phone === "") {
alert("Phone number is required");
return;
}

if (!phonePattern.test(phone)) {
alert("Please enter a valid 10-digit Indian phone number starting with 6, 7, 8, or 9");
return;
}

// Simulate sending a reset link (you would send an actual request to your server here)
document.getElementById('successMessage').style.display = 'block';
document.getElementById("resetPasswordForm").reset(); // Clear the form
});
</script>


</body>

</html>
Loading