I currently have this code in the css where it transforms from one color to another but I want to make the duration dynamic according to some values in javascript instead of having it a fixed value.
What are some solutions that I have to achieve it? Here is my current CSS that transform it
ul li.transform a {
color: red;
-webkit-animation-name: transform;
-webkit-animation-duration: 60s;
-webkit-animation-fill-mode: forwards;
animation-name: transform;
animation-duration: 60s;
animation-fill-mode: forwards;
}
@-webkit-keyframes transform{
from { color: red; }
to { color: green; }
}
@keyframes transform {
from { color: red; }
to { color: green; }
}
<ul>
<li class="transform">
<a href="#">link</a>
</li>
</ul>