<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div>
<h1>Nguyen Phuc Hung</h1>
<h2>class </h2>
<h3>Hello</h3>
</div>
<div id="ball">
</div>
<script src="script.js"></script>
</body>
</html>
@keyframes bgChange {
0% { background-color: red; }
50% { background-color: yellow; }
100% { background-color: blue; }
}
@keyframes ChangeTall{
0% {transform:translateY(0px) }
100% {transform:translateY(100px) }
}
@keyframes SlideX{
0% {transform:translateX(400px) }
100% {transform:translateX(0px) }
}
div {
width: auto;
height: 50px;
background-color:red;
padding-left:20px;
animation-name:bgChange;
animation-duration:2s;
animation-iteration-count:infinite;
}
h1 {
animation-name:Simulation ;
animation-duration:3s;
animation-iteration-count:infinite;
}
h2 {
animation-name:SlideX;
animation-duration:2s;
animation-iteration-count:infinite;
}
@keyframes Simulation {
0% {transform:translateY(0px) }
50% {
transform: translateY(50px) rotate(-180deg) scale(2);
}
100% {transform:translateY(200px) }
}
@keyframes Hello {
0% {
transform:translateX(0px) rotate(0deg) scale(1);
}
25% {
transform: translateX(50px) rotate(90deg) scale(1.5);
}
50% {
transform: translateX(25px) rotate(180deg) scale(0);
}
75% {
transform: translateX(-50px) rotate(270deg) scale(0.8);
}
100% {
transform: translateX(0px) rotate(360deg) scale(2);
}
}
h3 {
animation-name:Hello;
animation-duration:5s;
animation-iteration-count:infinite;
}
@keyframes ball {
0% { transform: translateY(0px); }
100% { transform: translateY(100px); }
}
#ball {
width:25px;
height:50px;
border-radius:100px;
animation: ball 0.00001s infinite alternate;
}