身份验证组件
一个简单的身份验证组件,采用 Neumorphism 风格和单色配色方案设计,适用于社交媒体界面。它包括一个带有电子邮件和密码字段的登录表单、一个登录按钮和一个注册链接。该组件响应迅速,并支持深色模式。
HTML 代码
<div class="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-800">
<div class="bg-white dark:bg-gray-900 shadow-lg rounded-lg p-8 w-80 neumorphism">
<h2 class="text-center text-xl font-semibold text-gray-800 dark:text-gray-200">Login</h2>
<form class="mt-6">
<div class="mb-4">
<label class="block mb-2 text-gray-700 dark:text-gray-300" for="email">Email</label>
<input type="email" id="email" class="w-full p-2 rounded shadow-inner border border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-400" placeholder="[email protected]" required>
</div>
<div class="mb-6">
<label class="block mb-2 text-gray-700 dark:text-gray-300" for="password">Password</label>
<input type="password" id="password" class="w-full p-2 rounded shadow-inner border border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-400" placeholder="••••••••" required>
</div>
<button type="submit" class="w-full bg-blue-500 hover:bg-blue-400 text-white font-bold py-2 rounded focus:outline-none focus:ring-2 focus:ring-blue-600">Log In</button>
</form>
<p class="mt-4 text-center text-gray-600 dark:text-gray-400">Don't have an account? <a href="#" class="text-blue-500 hover:underline">Sign up</a></p>
<div class="flex justify-center mt-4">
<img class="w-12 h-12 rounded-full border-2 border-blue-500" src="https://randomuser.me/api/portraits/men/1.jpg" alt="User Avatar">
</div>
<img src="https://picsum.photos/200/100" alt="Random Image" class="mt-4 rounded-lg shadow-lg w-full h-auto">
</div>
</div>
<style>
.neumorphism {
box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.2),
-8px -8px 16px rgba(255, 255, 255, 0.7);
border-radius: 20px;
}
</style>