deepsite-project / user-login.html
BHASAR's picture
user login optimize
18eb2ab verified
Raw History Blame Contribute Delete
5.24 kB
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WorkerConnect India</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<link rel="preload" href="style.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="style.css"></noscript>
<style>
.hero-section {
background: url('http://static.photos/construction/1200x630/1') no-repeat center center;
background-size: cover;
padding: 100px 0;
color: white;
text-align: center;
transition: all 0.5s ease;
}
.hero-section:hover {
transform: scale(1.01);
}
.login-card {
max-width: 500px;
margin: 50px auto;
padding: 30px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
border-radius: 10px;
transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.login-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.role-btn {
margin: 10px;
padding: 15px 30px;
font-size: 1.1rem;
transition: all 0.3s ease;
}
.role-btn:hover {
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="#">WorkerConnect India</a>
<div class="navbar-nav">
<a class="nav-link" href="worker-login.html">Worker Login</a>
<a class="nav-link" href="user-login.html">User Login</a>
</div>
</div>
</nav>
<div class="hero-section">
<div class="container">
<h1 class="display-4">Connecting Workers Across India</h1>
<p class="lead">Find skilled workers in your locality or register as a worker to get more opportunities</p>
</div>
</div>
<div class="container my-5">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card login-card">
<div class="card-body">
<h2 class="card-title text-center mb-4">User Login</h2>
<form id="userLoginForm">
<div class="mb-3">
<label for="userMobile" class="form-label">Mobile Number</label>
<input type="tel" class="form-control" id="userMobile" required pattern="[0-9]{10}" placeholder="Enter 10-digit mobile number">
</div>
<div class="mb-3">
<label for="userPassword" class="form-label">Password</label>
<input type="password" class="form-control" id="userPassword" required placeholder="Enter your password">
</div>
<div class="d-grid gap-2">
<button type="submit" class="btn btn-primary">Login</button>
<a href="index.html" class="btn btn-outline-secondary">Back to Home</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" defer crossorigin="anonymous"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Handle form submission
document.getElementById('userLoginForm').addEventListener('submit', function(e) {
e.preventDefault();
const mobile = document.getElementById('userMobile').value;
const password = document.getElementById('userPassword').value;
// Simple validation
if (mobile.length !== 10 || !/^\d+$/.test(mobile)) {
alert('Please enter a valid 10-digit mobile number');
return;
}
if (password.length < 6) {
alert('Password must be at least 6 characters');
return;
}
// Store user data and redirect
localStorage.setItem('userData', JSON.stringify({
mobile: mobile,
loggedIn: true
}));
window.location.href = 'user-dashboard.html';
});
// Check if already logged in
const userData = JSON.parse(localStorage.getItem('userData'));
if (userData && userData.loggedIn) {
window.location.href = 'user-dashboard.html';
}
});
</script>
</body>
</html>