Compare commits
7 Commits
e78c16f721
...
3c807a5c70
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c807a5c70 | ||
|
|
ea71ea03e0 | ||
|
|
38f29f52f0 | ||
|
|
fa2989b8af | ||
|
|
ded6aceff7 | ||
|
|
e9000eb28e | ||
|
|
d4eb254b74 |
@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@ -44,8 +45,15 @@
|
||||
}
|
||||
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0px); }
|
||||
50% { transform: translateY(20px); }
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0px);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateY(20px);
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
@ -182,8 +190,15 @@
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { transform: scale(1); }
|
||||
50% { transform: scale(1.1); }
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
|
||||
.success-message {
|
||||
@ -211,6 +226,7 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="logo">
|
||||
@ -234,7 +250,8 @@
|
||||
</div>
|
||||
|
||||
<div class="button-group">
|
||||
<button type="button" class="btn btn-signin" onclick="goToSignUp()">Sign Up</button>
|
||||
<button type="button" class="btn btn-signin" onclick="handleLogin()">Login</button>
|
||||
<button type="button" class="btn btn-signup" onclick="goToSignUp()">Sign Up</button>
|
||||
</div>
|
||||
|
||||
<div class="success-message" id="mainMessage"></div>
|
||||
@ -281,6 +298,38 @@
|
||||
document.getElementById('signupForm').style.display = 'block';
|
||||
}
|
||||
|
||||
// Login handler: validate input and show messages
|
||||
function handleLogin() {
|
||||
const username = document.getElementById('mainUsername').value.trim();
|
||||
const password = document.getElementById('mainPassword').value.trim();
|
||||
const successEl = document.getElementById('mainMessage');
|
||||
const errorEl = document.getElementById('mainError');
|
||||
|
||||
// Reset messages
|
||||
successEl.classList.remove('show');
|
||||
errorEl.classList.remove('show');
|
||||
|
||||
if (!username || !password) {
|
||||
errorEl.textContent = 'Please enter both username and password.';
|
||||
errorEl.classList.add('show');
|
||||
return;
|
||||
}
|
||||
|
||||
// Simulate login (replace with real auth as needed)
|
||||
if (username.toLowerCase() === 'admin' && password === 'admin') {
|
||||
successEl.textContent = `Welcome back, ${username}! Redirecting...`;
|
||||
successEl.classList.add('show');
|
||||
setTimeout(() => {
|
||||
alert('Logged in as ' + username + '. (Simulated)');
|
||||
// Example: redirect to game/dashboard page
|
||||
// window.location.href = 'dashboard.html';
|
||||
}, 800);
|
||||
} else {
|
||||
errorEl.textContent = 'Invalid username or password.';
|
||||
errorEl.classList.add('show');
|
||||
}
|
||||
}
|
||||
|
||||
// Signup Form Handler
|
||||
document.getElementById('signupForm').addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
@ -302,4 +351,5 @@
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user