<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>流光按钮</title>
<style>
*{
margin: 0;
padding: 0;
}
body {
background-color: black;
}
.btn {
border: none;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 400px;
height: 100px;
font-size: 24px;
background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
background-size: 400%;
color: white;
border-radius: 50px;
text-transform: uppercase;
z-index: 1;
}
.btn::before {
content: '';
position: absolute;
top: -5px;
right: -5px;
bottom: -5px;
left: -5px;
border: 1px solid red;
background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);
background-size: 400%;
border-radius: 50px;
filter: blur(20px);
z-index: -1;
}
.btn:hover {
animation: sun 12s infinite;
}
.btn:hover::before {
animation: sun 12s infinite;
}
@keyframes sun {
100% {
background-position: -400% 0;
}
}
</style>
</head>
<body>
<button class="btn">sunButton</button>
</body>
</html>