registration.html 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!-- 宣告我們要套用模板 -->
  2. {% extends "sign_in_base.html" %}
  3. {% block script %}
  4. <script src="../static/js/registration.js"></script>
  5. {% endblock %}
  6. {% block style %}
  7. <style>
  8. .form-signin {
  9. max-width: 330px;
  10. padding: 15px;
  11. }
  12. .form-signin .form-floating:focus-within {
  13. z-index: 2;
  14. }
  15. .form-signin input[type="email"] {
  16. margin-bottom: -1px;
  17. border-bottom-right-radius: 0;
  18. border-bottom-left-radius: 0;
  19. }
  20. .form-signin input[type="password"] {
  21. margin-bottom: 10px;
  22. border-top-left-radius: 0;
  23. border-top-right-radius: 0;
  24. }
  25. </style>
  26. {% endblock %}
  27. {% block main %}
  28. <form method="post" action="/register">
  29. <img class="mb-4" src="../static/img/ALMIGHTY_RAY.jpg" alt="" >
  30. <img class="mb-4" src="../static/img/SKYAI.jpg" alt="" >
  31. <h1 class="h3 mb-3 fw-normal">Sign up</h1>
  32. <h1 class="h5 mb-5 fw-normal">create a new account</h1>
  33. <div class="form-floating">
  34. <input type="text" class="form-control" name="firstname" placeholder="名/Firstname" required>
  35. <label for="firstname">名/Firstname</label>
  36. </div>
  37. <div class="form-floating">
  38. <input type="text" class="form-control" name="lastname" placeholder="姓/Lastname" required>
  39. <label for="lastname">姓/Lastname</label>
  40. </div>
  41. <div class="form-floating">
  42. <input type="email" class="form-control" id="email" name="email" placeholder="信箱/Email" oninput="setCustomValidity('');" onchange="$.get('/check_email', 'email='+document.getElementById('email').value,function(resText){
  43. if(resText.errMsg){
  44. setCustomValidity('信箱重複');
  45. }
  46. },'json');" required>
  47. <label for="email">信箱/Email</label>
  48. </div>
  49. <div class="form-floating">
  50. <input type="tel" class="form-control" name="phone" placeholder="手機/Phone 09xx-xxx-xxx" minlength="10"
  51. maxlength="14" pattern="[0-9]{4}[0-9]{3}[0-9]{3}"
  52. required>
  53. <label for="phone">手機/Phone 09xx-xxx-xxx</label>
  54. </div>
  55. <div class="form-floating">
  56. <input type="text" class="form-control" id="username" name="username" placeholder="使用者名稱/Username" oninput="setCustomValidity('');" onchange="$.get('/check_username', 'username='+document.getElementById('username').value,function(resText){
  57. if(resText.errMsg){
  58. setCustomValidity('使用者名稱重複');
  59. }
  60. },'json');" required>
  61. <label for="username">使用者名稱/Username</label>
  62. </div>
  63. <div class="form-floating">
  64. <input type="text" class="form-control" id="password" name="password" placeholder="密碼/Password" minlength="6"
  65. maxlength="12" required>
  66. <label for="password">密碼/Password</label>
  67. </div>
  68. <div class="form-floating">
  69. <input type="password" class="form-control" id="confirmpwd" name="confirmpwd" placeholder="確認密碼/Confirm Password" minlength="6"
  70. maxlength="12" oninput="setCustomValidity('');" onchange="if(document.getElementById('password').value != document.getElementById('confirmpwd').value){setCustomValidity('密碼不吻合');}" required>
  71. <label for="confirmpwd">確認密碼/Confirm Password</label>
  72. </div>
  73. <button class="w-40 btn btn-lg btn-secondary" type="submit">Sign up</button>
  74. <button class="w-40 btn btn-lg btn-secondary" type="button" onclick="Login();">Cancel</button>
  75. </form>
  76. {% endblock %}