组件 CAPTCHA 验证码 Glassmorphism Captcha 组件

Glassmorphism Captcha 组件

一个简单、响应式 glassmorphism 风格的 CAPTCHA 组件,具有灰度配色方案和深色模式支持,适用于博客或内容网站。

预览

HTML 代码

<div class="flex items-center justify-center min-h-screen p-4 bg-gray-100 dark:bg-gray-900 font-sans">

  <div class="w-full max-w-sm mx-auto bg-white/20 dark:bg-gray-800/20 backdrop-blur-lg rounded-2xl shadow-xl border border-white/30 dark:border-gray-700/30 p-6 sm:p-8 transition-all duration-300 ease-in-out">

    <h2 class="text-xl sm:text-2xl font-bold text-gray-800 dark:text-white mb-4 text-center select-none">
      Verify you are human
    </h2>

    <p class="text-sm text-gray-600 dark:text-gray-300 mb-6 text-center select-none">
      To proceed, please check the box below.
    </p>

    <div class="flex items-center justify-center mb-6">
      <label for="captcha-checkbox" class="relative flex items-center cursor-pointer">
        <input type="checkbox" id="captcha-checkbox" class="sr-only peer">
        <div class="w-6 h-6 border-2 border-gray-500 dark:border-gray-400 rounded-md bg-gray-200 dark:bg-gray-700 peer-checked:bg-white dark:peer-checked:bg-gray-200 peer-checked:border-white dark:peer-checked:border-gray-200 transition-all duration-200 ease-in-out flex items-center justify-center">
          <svg class="w-4 h-4 text-gray-800 opacity-0 peer-checked:opacity-100 transition-opacity duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/>
          </svg>
        </div>
        <span class="ml-3 text-base text-gray-700 dark:text-gray-200 select-none">I'm not a robot</span>
      </label>
    </div>

    <div class="flex justify-center">
      <button type="submit" class="bg-gray-400 dark:bg-gray-600 text-white dark:text-gray-200 px-6 py-2 rounded-lg font-semibold hover:bg-gray-500 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-300 dark:focus:ring-gray-500 focus:ring-opacity-75 transition-colors duration-200 ease-in-out select-none">
        Submit
      </button>
    </div>

  </div>

</div>

相关组件

CAPTCHA 组件

干净、简约的 CAPTCHA 组件,采用瑞士/国际排版设计风格,采用海洋/蓝色调。它专为活动和会议网站而设计,响应式并包括深色模式支持。

打开

验证码组件

支持黑暗主题与随机占位符图像的响应式验证码组件,具备微交互功能。

打开

Retro Vintage CAPTCHA 组件

一个简单的 CAPTCHA 组件,设计具有怀旧复古美学、充满活力的配色方案,适用于商业和企业网站,并支持深色模式。

打开