Learn how to create Color, Shape, and Position changing Animation using only HTML and CSS.
Watch the animation tutorial video here-
The VS Code extensions used in this video are Live Server, Bracket Pair Colorizer, and Prettier.
HTML Source Code-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<div class="box"></div>
</body>
</html>
CSS Source Code-
body{
background-color: #333;
}
.box{
height: 150px;
width: 150px;
position: relative;
animation-name: shifting;
animation-duration: 4s;
animation-iteration-count: infinite;
}
@keyframes shifting{
0%{background-color:red; left:25vw; top:25vh; border-radius:0;}
25%{background-color:orange; left:60vw; top:25vh; border-radius:50%;}
50%{background-color:yellow; left:60vw; top:60vh; border-radius: 0;}
75%{background-color:green; left:25vw; top:60vh; border-radius: 50%;}
100%{background-color:red; left:25vw; top:25vh; border-radius:0;}
}
Download CSS source file
0 Comments