Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Sign Up / Login Page by Ayie</title>
- <style>
- /* Reset basic styling */
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- font-family: 'Arial', sans-serif;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100vh;
- background-color: #f0f0f0;
- }
- .container {
- background-color: #fff;
- padding: 40px;
- border-radius: 10px;
- box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
- width: 100%;
- max-width: 400px;
- text-align: center;
- }
- h2 {
- margin-bottom: 20px;
- color: #333;
- }
- input[type="text"],
- input[type="email"],
- input[type="password"] {
- width: 100%;
- padding: 12px;
- margin: 10px 0;
- border: 1px solid #ccc;
- border-radius: 5px;
- }
- button {
- width: 100%;
- padding: 12px;
- background-color: #007bff;
- color: white;
- border: none;
- border-radius: 5px;
- font-size: 16px;
- cursor: pointer;
- margin-top: 10px;
- }
- button:hover {
- background-color: #0056b3;
- }
- .toggle-link {
- margin-top: 20px;
- font-size: 14px;
- }
- .toggle-link a {
- color: #007bff;
- text-decoration: none;
- }
- .toggle-link a:hover {
- text-decoration: underline;
- }
- /* Responsive Design */
- @media (max-width: 768px) {
- .container {
- width: 90%;
- }
- }
- </style>
- </head>
- <body>
- <div class="container" id="sign-up-form">
- <h2>Sign Up</h2>
- <form id="signupForm">
- <input type="text" name="fullname" placeholder="Full Name" required>
- <input type="email" name="email" placeholder="Email" required>
- <input type="password" name="password" placeholder="Password" required>
- <button type="submit">Sign Up</button>
- </form>
- <div class="toggle-link">
- Already have an account? <a href="#" onclick="showLogin()">Log in</a>
- </div>
- </div>
- <div class="container" id="login-form" style="display:none;">
- <h2>Login</h2>
- <form id="loginForm">
- <input type="email" name="email" placeholder="Email" required>
- <input type="password" name="password" placeholder="Password" required>
- <button type="submit">Log In</button>
- </form>
- <div class="toggle-link">
- Don't have an account? <a href="#" onclick="showSignUp()">Sign up</a>
- </div>
- </div>
- <script>
- // Toggle between Sign-Up and Login forms
- function showLogin() {
- document.getElementById('sign-up-form').style.display = 'none';
- document.getElementById('login-form').style.display = 'block';
- }
- function showSignUp() {
- document.getElementById('login-form').style.display = 'none';
- document.getElementById('sign-up-form').style.display = 'block';
- }
- // Handle Sign-Up form submission
- document.getElementById('signupForm').addEventListener('submit', function(event) {
- event.preventDefault();
- alert('Sign Up form submitted!');
- // Add your form processing logic here
- });
- // Handle Login form submission
- document.getElementById('loginForm').addEventListener('submit', function(event) {
- event.preventDefault();
- alert('Login form submitted!');
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment