<div id="description">
<h2>Приклад 1</h2>
<p>Елемент, що змінюється за допомогою анімації</p>
</div>
<div id="result">
<div class="box"></div>
</div>
#description {
font-style: italic;
text-align: left;
line-height: 1.5;
margin-bottom: 50px;
padding: 12px 16px;
background-color: #f7f7f7;
border: 1px solid #ccc;
}
#result {
display: flex;
justify-content: center;
align-items: center;
height: 200px;
}
.box {
width: 200px;
height: 200px;
background: blue;
animation-name: myAnimation;
animation-duration: calc(cos(0.25turn) * 1s);
}
@keyframes myAnimation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.