文章来源地址https://www.toymoban.com/news/detail-450751.html
<!DOCTYPE html>
<html>
<head>
<title>Cool Login Page</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding-top: 100px;
overflow: hidden;
}
.background-animation {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background: linear-gradient(-45deg, #fd746c, #ff9068, #48c6ef, #6f86d6);
background-size: 400% 400%;
animation: gradient-animation 15s ease infinite;
}
@keyframes gradient-animation {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.login-container {
max-width: 400px;
margin: 0 auto;
background: #fff;
border-radius: 5px;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
animation: slide-up 0.5s ease;
}
@keyframes slide-up {
from {
transform: translateY(100px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.login-header {
margin-bottom: 20px;
}
.login-header h2 {
color: #333;
font-size: 24px;
}
.login-form {
position: relative;
}
.input-container {
position: relative;
margin-bottom: 20px;
}
.input-container input {
width: 100%;
padding: 10px;
border: none;
border-bottom: 2px solid #ddd;
font-size: 16px;
transition: border-color 0.3s;
}
.input-container input:focus {
outline: none;
border-color: #fd746c;
}
.input-container label {
position: absolute;
top: 10px;
left: 10px;
color: #999;
pointer-events: none;
transition: top 0.3s, font-size 0.3s;
}
.input-container input:focus ~ label,
.input-container input:valid ~ label {
top: -15px;
font-size: 12px;
color: #fd746c;
}
.login-form button {
background: #fd746c;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s;
}
.login-form button:hover {
background: #ff9068;
}
</style>
</head>
<body>
<div class="background-animation"></div>
<div class="login-container">
<div class="login-header">
<h2>Welcome</h2>
</div>
<div class="login-form">
<div class="input-container">
<input type="text" id="username" required>
<label for="username">Username</label>
</div>
<div class="input-container">
<input type="password" id="password" required>
<label for="password">Password</label>
</div>
<button type="submit">Log In</button>
</div>
</div>
</body>
</html>
文章来源:https://www.toymoban.com/news/detail-450751.html
到了这里,关于带渐变色动画特效的登录页面的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!