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

made changes in login/sign-up page #304

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
106 changes: 35 additions & 71 deletions login.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,23 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - LinkedIn Resume Builder</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

<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="icon" href="images/favicon-removebg-preview.png">

<style>

:root {
--deep-teal: #003d4d;
--off-white: #f8f9fa;
--dark-slate: #2f4f4f;
--soft-gold: #d9c79e;

}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-family: 'Roboto', sans-serif; /* Changed to Roboto */
outline: none;
text-decoration: none;
text-transform: capitalize;
Expand All @@ -34,8 +30,6 @@

body {
background-color: var(--off-white);
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
Expand All @@ -51,7 +45,7 @@
max-width: 400px;
width: 100%;
text-align: center;
position: relative; /* Allow footer positioning */
position: relative; /* Allows footer positioning */
}

.logo {
Expand Down Expand Up @@ -111,15 +105,14 @@
width: 100%; /* Ensure the footer takes full width */
background-color: var(--deep-teal); /* Background color for the footer */
color: white; /* Text color */
padding: 13px 0; /* Padding for spacing */
padding: 20px 0; /* Padding for spacing */
position: absolute; /* Positioning at the bottom */
bottom: 0; /* Align to the bottom */
}

.footer p {
color: #fff; /* Text color for footer */
font-size: 14px;
padding-top: 1rem;
}

.footer a {
Expand All @@ -130,86 +123,57 @@
.footer a:hover {
text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 600px) {
.container {
padding: 20px;
}
button, .signup-btn {
padding: 12px;
font-size: 16px;
}
}
</style>
</head>
<body>

<div class="container">
<div class="logo" onclick="window.location.href='index.html'">Resum Resume</div>
<h2>Log In to Your Account</h2>

<form action="#" method="POST">
<input type="email" placeholder="Email Address " id="email" required>
<input type="password" placeholder="Password" id="password" required>
<button type="submit" id="signinbtn">Log In</button>

<form id="loginForm" action="#" method="POST">
<input type="email" placeholder="Email Address" required>
<input type="password" placeholder="Password" required>
<button type="submit">Log In</button>

</form>
<button class="signup-btn" onclick="window.location.href='signup.html'">Go to Signup</button>
</div>




<div class="footer">
<p>Powered by Resume Builder &copy; 2024</p>
</div>


<script>
const signin = document.querySelector("#signinbtn");

signin.addEventListener("click",(e)=>{
e.preventDefault();


const email = document.querySelector("#email").value;
const password = document.querySelector("#password").value;


if( ! email || !password ){
alert(" all feilds required");
return;
}
const userData = {
email,password
}

loginUser(userData);
});

const loginUser =async (user)=>{

try{

const res = await fetch("http://localhost:5000/auth/signin",{
method:"POST",
credentials:"include",
redirect:"follow",
headers:{"content-type":"application/json"},
body:JSON.stringify(user)

});

if(!res.ok){
alert(" Incorrect Credentails");
return
}
const data = await res.json();
alert("Login Successfull")
window.location.href = "http://127.0.0.1:5500/Resum-Resume/index.html";

}catch(error){
console.log(error.message);
alert(" check the credentails")
}

}

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

var formData = new FormData(this);

fetch('login-process.php', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
window.location.href = 'index.html'; // Redirect to homepage
} else {
alert('Login failed: ' + data.message);
}
})
.catch(error => console.error('Error:', error));
});
</script>

</body>
</html>
52 changes: 38 additions & 14 deletions signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {

--deep-teal: #003d4d;
--off-white: #f8f9fa;
--dark-slate: #2f4f4f;
--soft-gold: #d9c79e;

}

* {
Expand All @@ -35,10 +33,11 @@
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column; /* Added for vertical alignment */
flex-direction: column;
}

.container {
position: relative;
background-color: white;
padding: 40px;
border-radius: 8px;
Expand All @@ -48,16 +47,40 @@
text-align: center;
}

/* Red Cross Button */
.close-btn {
position: absolute;
top: 10px;
right: 10px;
background-color: transparent;
color: red;
font-size: 24px;
font-weight: bold;
cursor: pointer;
border-radius: 50%; /* Make the element circular */
width: 40px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
transition: 0.2s;
}

/* Circle outline when hovered */
.close-btn:hover {
border: 2px solid red; /* Add circle outline */
}

.logo {
font-size: 2rem; /* Decreased size for single line */
font-size: 2rem;
color: var(--deep-teal);
font-weight: 600;
margin-bottom: 20px;
cursor: pointer; /* Change cursor to pointer */
cursor: pointer;
}

.logo:hover {
color: var(--soft-gold); /* Change color on hover */
color: var(--soft-gold);
}

h2 {
Expand Down Expand Up @@ -100,18 +123,18 @@
}

.footer {
margin-top: 20px; /* Space between container and footer */
margin-top: 20px;
text-align: center;
width: 100%; /* Ensure the footer takes full width */
background-color: var(--deep-teal); /* Background color for the footer */
color: white; /* Text color */
padding: 30px 0; /* Padding for spacing */
position: absolute; /* Positioning at the bottom */
bottom: 0; /* Align to the bottom */
width: 100%;
background-color: var(--deep-teal);
color: white;
padding: 30px 0;
position: absolute;
bottom: 0;
}

.footer p {
color: #fff; /* Text color for footer */
color: #fff;
font-size: 14px;
}

Expand All @@ -128,6 +151,7 @@
<body>

<div class="container">
<button class="close-btn" onclick="window.location.href='index.html'">&times;</button>
<div class="logo" onclick="window.location.href='index.html'">Resum Resume</div>
<h2>Create Your Account</h2>

Expand Down