I'm wondering if respectively how it is possible to interweave Font Awesome Lock Icon and Font Awesome Lock Open Icon while toggling/animating them somehow smart. For example there is this flip animation.
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/js/all.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" rel="stylesheet"/>
<div class="fa-5x">
<i class="fas fa-lock fa-flip" style="--fa-animation-duration: 10s; color: red"></i>
<i class="fas fa-unlock fa-flip" style="--fa-animation-duration: 10s; color: green"></i>
</div>
Now for instance it would make sense to superimpose both icons, set one to display: none
and toggle them on click or on hover or whatever. But how to toggle them after half of the animation time so that the exchange takes place at the moment when the respective icon can only be seen as a line from the side? Or do you have a better idea for a reasonable animation?