<!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">
<title>Efeito de animação</title>
</head>
<style>
body{
margin: 0;
padding: 0;
}
.container{
width: 100%;
height: 100vh;
position: relative;
background: white;
}
.span-container{
width: 100px;
height: 100px;
transform: translate(-50%, -50%);
position: absolute;
top: 42%;
left: 45%;
}
span{
display: block;
position: absolute;
width: 40%;
height: 40%;
border-radius: 50%;
animation: speed 2s infinite ease-in-out;
}
.one{
background: yellow;
animation-delay: 2s;
}
.two{
background: #a308ce;
animation-delay: 1.5s;
}
.three{
background: greenyellow;
animation-delay: 1s;
}
.four{
background: orangered;
animation-delay: .5s;
}
@keyframes speed{
0%{
transform: translate(0%);
border-radius: 50%;
}
25%{
transform: translate(150%) scale(0.5);
}
50%{
transform: translate(150%, 150%);
border-radius: 50%;
}
75%{
transform: translate(0, 150%) scale(0.5);
border-radius: 0%;
}
}
</style>
<body>
<div class="container">
<div class="span-container">
<span class="one"></span>
<span class="two"></span>
<span class="three"></span>
<span class="four"></span>
</div>
</div>
</body>
</html>
Nenhum comentário:
Postar um comentário