login.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <html>
  2. <head>
  3. <title>Log In</title>
  4. <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0">
  5. </head>
  6. <style>
  7. body {
  8. background-color: #323C4D; font-family: "Segoe UI", Helvetica, Arial; font-weight: lighter;
  9. font-size: 22px; color: #333; letter-spacing: 1px; color: white; overflow: hidden;
  10. }
  11. .login { left: 50%; position: absolute; top: 50%; transform: translateX(-50%) translateY(-50%); -webkit-transform: translateX(-50%) translateY(-50%); width: 100%; max-width: 370px; text-align: center; }
  12. *:focus { outline: 0; }
  13. input[type=text], input[type=password] {
  14. padding: 10px 0px; border: 0px; display: block; margin: 15px 0px; width: 100%; border-radius: 30px; transition: 0.3s ease-out; background-color: #DDD;
  15. text-align: center; font-family: "Segoe UI", Helvetica, Arial; font-weight: lighter; font-size: 28px; border: 2px solid #323C4D;
  16. }
  17. input[type=text]:focus, input[type=password]:focus {
  18. border: 2px solid #FFF; background-color: #FFF;
  19. }
  20. input[type=checkbox] { opacity: 0; }
  21. input[type=checkbox]:checked + label { color: white; }
  22. input[type=checkbox]:focus + label::before { background-color: #435065; }
  23. input[type=checkbox]:checked + label::before { box-shadow: inset 0px 0px 0px 5px white; background-color: #4DCC6E; }
  24. input.error { border: 2px solid #F44336 !important; animation: shake 1s }
  25. label::before {
  26. content: ""; width: 20px; height: 20px; background-color: #323C4D;
  27. display: inline-block; margin-left: -20px; border-radius: 15px; box-shadow: inset 0px 0px 0px 2px #9EA5B3;
  28. transition: all 0.1s; margin-right: 7px; position: relative; top: 2px;
  29. }
  30. label { vertical-align: -1px; color: #9EA5B3; transition: all 0.3s; }
  31. .button {
  32. padding: 13px; display: inline-block; margin: 15px 0px; width: 100%; border-radius: 30px; text-align: center; white-space: nowrap;
  33. font-size: 28px; color: #333; background: linear-gradient(45deg, #6B14D3 0, #7A26E2 25%, #4962DD 90%);
  34. box-sizing: border-box; margin-top: 50px; color: white; text-decoration: none; transition: 0.3s ease-out;
  35. }
  36. .button:hover, .button:focus { box-shadow: 0px 5px 30px rgba(0,0,0,0.3); }
  37. .button:active { transform: translateY(1px); box-shadow: 0px 0px 20px rgba(0,0,0,0.5); transition: none; }
  38. #login_form_submit { display: none; }
  39. .login-anim { animation: login 1s cubic-bezier(0.785, 0.135, 0.15, 0.86) forwards; }
  40. @keyframes login {
  41. 0% { width: 100%; }
  42. 60% { width: 63px; transform: scale(1); color: rgba(255,255,255,0); }
  43. 70% { width: 63px; transform: scale(1); color: rgba(255,255,255,0); }
  44. 100% { transform: scale(80); width: 63px; color: rgba(255,255,255,0); }
  45. }
  46. @keyframes shake {
  47. 0%, 100% { transform: translateX(0); }
  48. 10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  49. 20%, 40%, 60%, 80% { transform: translateX(10px); }
  50. }
  51. </style>
  52. <body>
  53. <div class="login">
  54. <form action="" method="post" id="login_form" onkeypress="return onFormKeypress(event)">
  55. <!--<input type="text" name="username" placeholder="Username" required/>-->
  56. <input type="password" name="password" placeholder="Password" required/>
  57. <input type="checkbox" name="keep" id="keep"><label for="keep">Keep me logged in</label>
  58. <div style="clear: both"></div>
  59. <a href="#" class="button" onclick="return submit()" id="login_button"><span>Log In</span></a>
  60. <input type="submit" id="login_form_submit"/>
  61. </form>
  62. </div>
  63. <script>
  64. function onFormKeypress(event) {
  65. if (event.keyCode == 13) {
  66. submit()
  67. return false
  68. }
  69. }
  70. function submit() {
  71. var form = document.getElementById("login_form")
  72. if (form.checkValidity()) {
  73. document.getElementById("login_button").className = "button login-anim"
  74. setTimeout(function() {
  75. form.submit()
  76. }, 1000)
  77. } else {
  78. form.submit()
  79. }
  80. return false
  81. }
  82. function badPassword() {
  83. var elem = document.getElementsByName("password")[0]
  84. elem.className = "error"
  85. elem.placeholder = "Wrong Password"
  86. elem.focus()
  87. elem.addEventListener('input', function() {
  88. elem.className = ""
  89. elem.placeholder = "Password"
  90. })
  91. }
  92. result = "{result}"
  93. if (result == "bad_password")
  94. badPassword()
  95. </script>
  96. </body>
  97. </html>