captcha.blade.php 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!-- resources/views/filament/pages/auth/captcha.blade.php -->
  2. <div class="space-y-2">
  3. <div class="flex items-center justify-between">
  4. <span class="text-sm font-medium leading-6 text-gray-950 dark:text-white">
  5. Verification Code
  6. </span>
  7. </div>
  8. <div class="relative bg-white dark:bg-gray-900 rounded-lg p-2">
  9. <div class="flex items-center space-x-4">
  10. {{-- 驗證碼圖片 --}}
  11. <div class="relative">
  12. <img
  13. x-data
  14. x-on:captcha-refreshed.window="
  15. $el.style.opacity = '0';
  16. setTimeout(() => {
  17. $el.src = $wire.captchaImage;
  18. $el.style.opacity = '1';
  19. }, 150);
  20. "
  21. src="{{ $this->captchaImage }}"
  22. alt="Verification Code"
  23. class="h-12 rounded border border-gray-300 dark:border-gray-700 transition-opacity duration-150"
  24. />
  25. {{-- 加載動畫 --}}
  26. <div
  27. wire:loading
  28. wire:target="refreshCaptcha"
  29. class="absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-gray-900/50 rounded"
  30. >
  31. <svg class="animate-spin h-5 w-5 text-primary-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
  32. <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
  33. <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
  34. </svg>
  35. </div>
  36. </div>
  37. {{-- 刷新按鈕 --}}
  38. <button
  39. type="button"
  40. wire:click="refreshCaptcha"
  41. wire:loading.attr="disabled"
  42. class="flex items-center justify-center p-2 rounded-lg text-gray-500 hover:text-primary-500 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-primary-500 dark:focus:ring-offset-gray-900 transition-colors duration-150"
  43. >
  44. <span wire:loading.remove wire:target="refreshCaptcha">
  45. <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  46. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
  47. </svg>
  48. </span>
  49. <span
  50. wire:loading
  51. wire:target="refreshCaptcha"
  52. class="text-primary-500"
  53. >
  54. <svg class="animate-spin h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
  55. <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
  56. <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
  57. </svg>
  58. </span>
  59. </button>
  60. </div>
  61. </div>
  62. </div>