ahmed0saber

Log in and Sign up Form in HTML , CSS , JavaScript

Nov 27th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <title>Log in Sign up</title>
  4. <style>
  5. #log {display:none;}
  6. #sign {display:none;}
  7. #d1 {position:absolute;
  8. top:25%;
  9. left:25%;
  10. background-color:#B8EEF8;
  11. box-shadow: 5px 5px 10px #000000;}
  12. #log {position:absolute;
  13. top:32%;
  14. left:25%;
  15. background-color:#B8EEF8;
  16. box-shadow: 5px 5px 10px #000000;}
  17. #sign {position:absolute;
  18. top:32%;
  19. left:25%;
  20. background-color:#B8EEF8;
  21. box-shadow: 5px 5px 10px #000000;}
  22. #b1 {margin-left:20px;
  23. margin-right:30px;
  24. background-color: white;
  25. color: black;
  26. border: 2px solid #4CAF50;
  27. transition-duration: 0.5s;
  28. cursor: pointer;
  29. border-radius:5px;}
  30. #b1:hover {background-color: #4CAF50;
  31. color: white;}
  32. #b2 {margin-right:20px;
  33. background-color: white;
  34. color: black;
  35. border: 2px solid #008CBA;
  36. transition-duration: 0.5s;
  37. cursor: pointer;
  38. border-radius:5px;}
  39. #b2:hover {background-color: #008CBA;
  40. color: white;}
  41. #b3 {margin-right:10px;
  42. background-color: white;
  43. color: black;
  44. border: 2px solid #FF0000;
  45. transition-duration: 0.5s;
  46. cursor: pointer;
  47. border-radius:5px;}
  48. #b3:hover {background-color: #FF0000;
  49. color: white;}
  50. #t1 {margin: 5px 23px;
  51. border-radius:25px;}
  52. #t2 {margin: 5px 23px;
  53. border-radius:25px;}
  54. #t3 {margin: 5px 23px;
  55. border-radius:25px;}
  56. #t4 {margin: 5px 23px;
  57. border-radius:25px;}
  58. #t5 {margin: 5px 23px;
  59. border-radius:25px;}
  60. #t6 {margin: 5px 23px;
  61. border-radius:25px;}
  62. </style>
  63. <script>
  64. function over1(){document.getElementById("log").style.display = "block";
  65. document.getElementById("sign").style.display = "none";
  66. document.getElementById("t1").required=true;
  67. document.getElementById("t2").required=true;
  68. document.getElementById("t3").required=false;
  69. document.getElementById("t4").required=false;
  70. document.getElementById("t5").required=false;
  71. document.getElementById("t6").required=false;}
  72. function over2(){document.getElementById("sign").style.display = "block";
  73. document.getElementById("log").style.display = "none";}
  74. function over3(){document.getElementById("sign").style.display = "none";
  75. document.getElementById("log").style.display = "none";}
  76. function change(x){document.getElementById(x).style.backgroundColor = "#D8D8F8";}
  77. </script>
  78. </head>
  79. <body style="background:#DDEEFF">
  80. <form>
  81. <div id="d1" width="100%" height="100%"><br/>
  82. <button onmouseover="over1()" id="b1">Log in</button>
  83. <input type="button" onmouseover="over2()" id="b2" value="Sign up">
  84. <button onmouseover="over3()" id="b3">x</button>
  85. <br/><br/></div>
  86. <div id="log">
  87. <input type="text" placeholder=" email" onclick="change('t1')" id="t1"/><br/>
  88. <input type="password" placeholder=" password" onclick="change('t2')" id="t2"/><br/>
  89. </div>
  90. <div id="sign">
  91. <input type="text" placeholder=" username" onclick="change('t3')" id="t3"/><br/>
  92. <input type="text" placeholder=" email" onclick="change('t4')" id="t4"/><br/>
  93. <input type="password" placeholder=" password" onclick="change('t5')" id="t5"/><br/>
  94. <input type="password" placeholder=" confirm password" onclick="change('t6')" id="t6"/><br/>
  95. </div>
  96. </form>
  97. </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment