Skip to main content
Search
Search This Blog
Coderati
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
Labels
CSS
HTML
Javascript
Login/Signup Page
July 11, 2022
Login/Signup page
LOGIN
SIGNUP
Email
Password
Show
Submit
Name
Email
Password
Show
Confirm Password
Submit
CODE
Copy code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Login/Signup</title> <link rel="stylesheet" type="text/css" href="logincss.css"> </head> <body> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300&display=swap" rel="stylesheet"> <div class="main-container"> <span id="space"></span><button id="log" onclick="clicked(id)">LOGIN</button><button id="sign" onclick="clicked(id)">SIGNUP</button><br><br> <div class="content" id="content"> <div class="clslogin" id="clslogin"> <form> Email<br> <input type="email" id="email" required><br><br> Password<br> <input type="password" id="passwdlogin" required> <input type="checkbox" id="see" onclick="showpasswdlogin()"><span id = "show_hidelogin">Show</span><br><br> <button type="submit" id="sublogin">Submit</button> </form> </div> <div class="clssignup" id="clssignup"> <form> Name <br> <input type="text" id="name" required><br><br> Email<br> <input type="email" id="email" required><br><br> Password<br> <input type="password" id="passwd" required> <input type="checkbox" id="see" onclick="showpasswd()"><span id = "show_hide">Show</span><br><br> Confirm Password<br> <input type="password" id="confpasswd" required><br><br> <button type="submit" id="sub">Submit</button> </form> </div> </div> </div> <script lang="javascript"> passwd = document.getElementById("passwd") , confpasswd = document.getElementById("confpasswd"); function ValidatePassword(){ if(passwd.value != confpasswd.value){ confpasswd.setCustomValidity("Passwords Don't Match"); } else{ confpasswd.setCustomValidity(''); } } passwd.onchange = ValidatePassword; confpasswd.onkeyup = ValidatePassword; function clicked(a){ switch (a) { case "log": document.getElementById("clssignup").style.display = "none"; document.getElementById("clslogin").style.display = "unset"; document.getElementById("log").style.backgroundColor = "white"; document.getElementById("sign").style.backgroundColor = "aquamarine"; break; case "sign": document.getElementById("clslogin").style.display = "none"; document.getElementById("clssignup").style.display = "unset"; document.getElementById("sign").style.backgroundColor = "white"; document.getElementById("log").style.backgroundColor = "aquamarine"; break; } } function showpasswd(){ var passwod = document.getElementById("passwd"); var passwod1 = document.getElementById("confpasswd"); if(passwod.type === "password"){ passwod.type = "text"; passwod1.type = "text"; document.getElementById("show_hide").textContent = "Hide"; } else{ passwod.type = "password"; passwod1.type = "password"; document.getElementById("show_hide").textContent = "Show"; } } function showpasswdlogin(){ var passwod = document.getElementById("passwdlogin"); if(passwod.type === "password"){ passwod.type = "text"; document.getElementById("show_hidelogin").textContent = "Hide"; } else{ passwod.type = "password"; document.getElementById("show_hidelogin").textContent = "Show"; } } </script> <style> html{ zoom: 95%; } body{ font-size: 1 rem; font-family: 'Outfit', sans-serif; background-color: hsla(160, 100%, 75%, 0.486); } .content{ background-color: aquamarine; width: 95%; margin: auto; } .clssignup{ display: none; } .main-container{ border: 1px solid black; padding: 2%; margin-top: 10%; background-color: aquamarine; width: min(100%-2rem, 60px); max-width: 500px; margin-inline: auto; box-shadow: 10px 10px 5px lightblue; } #sign{ background-color: aquamarine; box-shadow: 2px 2px hsla(172, 81%, 50%, 0.486); } #log{ box-shadow: -2px 2px hsla(172, 81%, 50%, 0.486); } #log, #sign{ border: transparent; cursor: pointer; font-size: 1.09rem; } @keyframes spin2{ 50%{ transform: rotate(360deg); } } input{ border: none; font-size: large; width: 100% ; outline: none; } #passwd, #passwdlogin{ width: 85%; margin-right: 7px; } #see{ width: 10px; } #show_hide, #show_hidelogin{ font-size: 95%; } #space{ margin-right: 3%; } #sub, #sublogin{ border:1px solid transparent; font-size: larger; display: flex; margin: auto; justify-content: center; align-content: center; width: 60%; cursor: pointer; border-radius: 2px; } #sub:hover, #sublogin:hover{ border: 1px solid black; } #sub:active, #sublogin:active{ background-color: aquamarine; } </style> </body> </html>
Comments
Popular Posts
September 28, 2023
Password generator
August 26, 2022
Glowing Button
Comments
Post a Comment