Skip to content

Instantly share code, notes, and snippets.

@lmas3009
Created April 1, 2022 05:28
Show Gist options
  • Save lmas3009/276ff987749f4058b5afe869542ec0a6 to your computer and use it in GitHub Desktop.
Save lmas3009/276ff987749f4058b5afe869542ec0a6 to your computer and use it in GitHub Desktop.
CSS Animations
<!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" />
<link rel="stylesheet" href="style.css" />
<title>CSS Animations</title>
</head>
<body>
<h1>Welcome to CSS Animation on Jr Web Dev Youtube Channel</h1>
<div id="animate"></div>
</body>
</html>
body {
background-color: burlywood;
}
h1 {
color: red;
}
#animate {
height: 100px;
width: 100px;
background-color: red;
margin: 30px 0 0 30px;
border-radius: 10px;
animation: animate 2s ease-in-out infinite;
}
@keyframes animate {
0% {
transform: translateX(0%);
}
25% {
transform: translateX(100%) rotate(40deg);
}
50% {
transform: translateX(100%) translateY(100%) rotate(80deg);
}
75% {
transform: translateX(0%) translateY(100%) rotate(40deg);
}
100% {
transform: translateX(0%) translateY(0%);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment