JSFiddle - React, Tailwind, and code Playground
by gagob11
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div class="top">
<input type=submit value="gradient" class="knopka">
</div>
</body>
</html>
CSS
body {
background-image: -webkit-linear-gradient(70deg, #000 0%,#ccc 50%,#000 100%);
}
.knopka {
width: 200px;
height: 60px;
border-radius: 20px;
transition: all 2s linear;
animation-name: spin;
animation-duration: 2s;
}
.knopka:hover{
animation: spin;
transform: rotate(360deg);
}
@keyframes spin {
0%
{top: 0px; background: red; width: 100px;}
50% {
top: 200px; background: yellow; width: 300px;
}
100%{top: 800px; background: white; width: 200px}
}