refactor: Modernize login page with Tailwind CSS and updated layout
This commit is contained in:
1 parent
07a61990a7
commit
237720fb2c
1 file changed
+44
-76
+44
-76
@@ -1,80 +1,48 @@
|
|||||||
<form class="space-y-4">
|
<div class="max-w-md mx-auto"> <!-- Added max-width and centering -->
|
||||||
<div class="w-full overflow-x-auto">
|
|
||||||
<table class="w-full" border="0" cellpadding="0" cellspacing="0">
|
<!-- Login Section -->
|
||||||
<tbody>
|
<form class="space-y-4 mb-8">
|
||||||
<tr>
|
<h2 class="text-xl font-semibold text-text-title mb-4">Login</h2>
|
||||||
<td>
|
<div>
|
||||||
<table class="w-full min-w-[300px] table-auto" border="0">
|
<label for="username" class="block text-sm font-medium text-text-title mb-1">Username:</label>
|
||||||
<tbody>
|
<input type="text" id="username" name="username" class="w-full text-primary text-sm px-3 py-2 bg-bg-light border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" required>
|
||||||
<tr>
|
</div>
|
||||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">Username:</td>
|
<div>
|
||||||
<td><input type="text" name="username" class="w-full max-w-full sm:w-[350px] md:w-[450px] text-primary text-sm px-3 py-1 border border-gray-300 rounded" required></td>
|
<label for="password" class="block text-sm font-medium text-text-title mb-1">Password:</label>
|
||||||
</tr>
|
<input type="password" id="password" name="password" class="w-full text-primary text-sm px-3 py-2 bg-bg-light border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" required>
|
||||||
<tr>
|
</div>
|
||||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">Password:</td>
|
<!-- Placeholder for error message -->
|
||||||
<td><input type="password" name="password" class="w-full max-w-full sm:w-[350px] md:w-[450px] text-primary text-sm px-3 py-1 border border-gray-300 rounded" required></td>
|
<p class="text-sm text-red-600">Bad Login</p> <!-- Example error message -->
|
||||||
</tr>
|
<div>
|
||||||
<tr>
|
<button type="submit" class="px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50">Login</button>
|
||||||
<td class="py-2"></td>
|
</div>
|
||||||
<td>
|
|
||||||
<font size="2" class="text-primary text-sm">Bad Login</font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="py-2 w-24 sm:w-32"></td>
|
|
||||||
<td><button type="submit" class="px-2 py-1 bg-primary text-white rounded hover:bg-primary-dark">Login</button></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<p class="text-primary text-sm"><a href="#" class="text-primary hover:underline">Forgot your password?</a></p>
|
<a href="#" class="text-sm text-primary hover:underline">Forgot your password?</a>
|
||||||
</div>
|
</div>
|
||||||
<hr class="my-4 border-gray-300">
|
</form>
|
||||||
<table class="w-full min-w-[300px] table-auto" border="0">
|
|
||||||
<tbody>
|
<hr class="my-8 border-gray-300">
|
||||||
<tr>
|
|
||||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">Username:</td>
|
<!-- Create Account Section -->
|
||||||
<td><input type="text" name="new_username" class="w-full max-w-full sm:w-[350px] md:w-[450px] text-primary text-sm px-3 py-1 border border-gray-300 rounded" required></td>
|
<form class="space-y-4">
|
||||||
</tr>
|
<h2 class="text-xl font-semibold text-text-title mb-4">Create Account</h2>
|
||||||
<tr>
|
<div>
|
||||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">Password:</td>
|
<label for="new_username" class="block text-sm font-medium text-text-title mb-1">Username:</label>
|
||||||
<td><input type="password" name="new_password" class="w-full max-w-full sm:w-[350px] md:w-[450px] text-primary text-sm px-3 py-1 border border-gray-300 rounded" required></td>
|
<input type="text" id="new_username" name="new_username" class="w-full text-primary text-sm px-3 py-2 bg-bg-light border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" required>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">Confirm Password:</td>
|
|
||||||
<td><input type="password" name="confirm_password" class="w-full max-w-full sm:w-[350px] md:w-[450px] text-primary text-sm px-3 py-1 border border-gray-300 rounded" required></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="py-2"></td>
|
|
||||||
<td>
|
|
||||||
<font size="2" class="text-primary text-sm">Passwords do not match</font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="py-2 w-24 sm:w-32"></td>
|
|
||||||
<td><button type="submit" class="px-2 py-1 bg-primary text-white rounded hover:bg-primary-dark">Create Account</button></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<div>
|
||||||
|
<label for="new_password" class="block text-sm font-medium text-text-title mb-1">Password:</label>
|
||||||
|
<input type="password" id="new_password" name="new_password" class="w-full text-primary text-sm px-3 py-2 bg-bg-light border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" required>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="confirm_password" class="block text-sm font-medium text-text-title mb-1">Confirm Password:</label>
|
||||||
|
<input type="password" id="confirm_password" name="confirm_password" class="w-full text-primary text-sm px-3 py-2 bg-bg-light border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" required>
|
||||||
|
</div>
|
||||||
|
<!-- Placeholder for error message -->
|
||||||
|
<p class="text-sm text-red-600">Passwords do not match</p> <!-- Example error message -->
|
||||||
|
<div>
|
||||||
|
<button type="submit" class="px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-primary focus:ring-opacity-50">Create Account</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<!-- Script to toggle mobile menu -->
|
</div>
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const menuButton = document.getElementById('menuButton');
|
|
||||||
const mobileMenu = document.getElementById('mobileMenu');
|
|
||||||
|
|
||||||
if (menuButton && mobileMenu) {
|
|
||||||
menuButton.addEventListener('click', () => {
|
|
||||||
mobileMenu.classList.toggle('hidden');
|
|
||||||
const expanded = menuButton.getAttribute('aria-expanded') === 'true';
|
|
||||||
menuButton.setAttribute('aria-expanded', !expanded);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
Reference in new issue
Block a user