register.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <div class="fixed inset-0 bg-gray-50 dark:bg-[#0f1419] z-[60] flex flex-col">
  2. <div class="flex-1 flex flex-col items-center justify-center px-6">
  3. <div class="w-full max-w-sm">
  4. <div class="text-center mb-8">
  5. <div class="w-16 h-16 mx-auto mb-4 bg-gradient-to-br from-[#00d68f] to-[#00b377] rounded-2xl flex items-center justify-center shadow-lg shadow-green-500/25">
  6. <span class="text-white text-2xl font-bold">+</span>
  7. </div>
  8. <h1 class="text-2xl font-bold text-gray-900 dark:text-white mb-1">创建账号</h1>
  9. <p class="text-sm text-gray-500 dark:text-gray-400">注册后即可开始学习</p>
  10. </div>
  11. <div class="space-y-4">
  12. <div class="bg-white dark:bg-gray-800 rounded-xl px-4 py-3.5 flex items-center gap-3 border border-gray-200 dark:border-gray-700 focus-within:border-green-500 dark:focus-within:border-green-400 transition-colors">
  13. <fa-icon [icon]="faMobileAlt" class="text-gray-400 dark:text-gray-500 text-lg w-5 text-center flex-shrink-0"></fa-icon>
  14. <input
  15. [(ngModel)]="phone"
  16. type="tel"
  17. placeholder="请输入手机号"
  18. maxlength="11"
  19. class="flex-1 bg-transparent outline-none text-base text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500"
  20. autocomplete="tel"
  21. />
  22. </div>
  23. <div class="bg-white dark:bg-gray-800 rounded-xl px-4 py-3.5 flex items-center gap-3 border border-gray-200 dark:border-gray-700 focus-within:border-green-500 dark:focus-within:border-green-400 transition-colors">
  24. <fa-icon [icon]="faLock" class="text-gray-400 dark:text-gray-500 text-lg w-5 text-center flex-shrink-0"></fa-icon>
  25. <input
  26. [(ngModel)]="password"
  27. [type]="showPassword() ? 'text' : 'password'"
  28. placeholder="请输入密码(至少6位)"
  29. class="flex-1 bg-transparent outline-none text-base text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500"
  30. autocomplete="new-password"
  31. />
  32. <button
  33. (click)="togglePassword()"
  34. class="w-8 h-8 flex items-center justify-center text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition-colors flex-shrink-0"
  35. tabindex="-1"
  36. >
  37. <fa-icon [icon]="showPassword() ? faEye : faEyeSlash" class="text-base"></fa-icon>
  38. </button>
  39. </div>
  40. <div class="bg-white dark:bg-gray-800 rounded-xl px-4 py-3.5 flex items-center gap-3 border border-gray-200 dark:border-gray-700 focus-within:border-green-500 dark:focus-within:border-green-400 transition-colors">
  41. <fa-icon [icon]="faLock" class="text-gray-400 dark:text-gray-500 text-lg w-5 text-center flex-shrink-0"></fa-icon>
  42. <input
  43. [(ngModel)]="confirmPassword"
  44. [type]="showConfirmPassword() ? 'text' : 'password'"
  45. placeholder="请再次输入密码"
  46. class="flex-1 bg-transparent outline-none text-base text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500"
  47. autocomplete="new-password"
  48. (keydown.enter)="register()"
  49. />
  50. <button
  51. (click)="toggleConfirmPassword()"
  52. class="w-8 h-8 flex items-center justify-center text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition-colors flex-shrink-0"
  53. tabindex="-1"
  54. >
  55. <fa-icon [icon]="showConfirmPassword() ? faEye : faEyeSlash" class="text-base"></fa-icon>
  56. </button>
  57. </div>
  58. @if (errorMsg()) {
  59. <p class="text-sm text-red-500 px-1 animate-fadeIn">{{ errorMsg() }}</p>
  60. }
  61. <button
  62. (click)="register()"
  63. [disabled]="isLoading()"
  64. class="w-full py-3.5 bg-gradient-to-r from-[#00d68f] to-[#00b377] text-white font-semibold text-base rounded-xl shadow-lg shadow-green-500/25 hover:shadow-green-500/40 active:scale-[0.98] transition-all duration-200 disabled:opacity-60 disabled:active:scale-100 flex items-center justify-center gap-2"
  65. >
  66. @if (isLoading()) {
  67. <span class="inline-block w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"></span>
  68. <span>注册中...</span>
  69. } @else {
  70. <span>注 册</span>
  71. }
  72. </button>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="py-6 text-center">
  77. <button (click)="goLogin()" class="text-sm text-gray-500 dark:text-gray-400">
  78. 已有账号?<span class="text-green-600 dark:text-green-400">返回登录</span>
  79. </button>
  80. </div>
  81. </div>