- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Animation direction: animation-direction, step 2</title>
<meta charset="utf-8">
<link rel="stylesheet" href="epoch2.css">
<link rel="stylesheet" href="style.css">
</head>
<body class="mechanical">
<div class="mechanism">
<span class="gear-big"></span>
<span class="gear-small"></span>
</div>
</body>
</html>
CSS
@keyframes clockwise {
to {
transform: rotate(180deg);
}
}
@keyframes counterclockwise {
to {
transform: rotate(-180deg);
}
}
.gear-big {
animation-name: clockwise;
animation-duration: 2s;
}
.gear-small {
animation-name: counterclockwise;
animation-duration: 2s;
}
Goalscompleted
- Set the playback count for both cogwheels to
2
, - then set the alternating direction of playback,
- then change the direction to reverse alternating.