Ok but... can you animate rotation of parent without rotating child? Been trying to crack this for a while but am stuck... :(
.layout {
display: grid;
grid-template-columns: 1fr 4fr;
height: 100vh;
width: 80%;
padding-top: 25px;
gap: 1rem;
}
.nav {
max-width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.profile-pic {
border-radius: 50%;
width:100px;
height:100px;
}
#cont{
background: linear-gradient(to top left, #28b487, #7dd56f);
width: 100%;
border-radius: 50%;
padding: 10px;
margin: 0;
line-height: 0;
position: relative;
animation: rotate 5.2s infinite linear;
}
#box{
background: #000000;
width: 100%;
height: 100%;
border-radius: 50%;
padding: 0;
margin: 0;
}
@keyframes rotate {
from {
transform: rotate(0);
}
to {
transform: rotate(1turn);
}
}
<div class="layout">
<div class="nav">
<!-- a div dynamically positioned on page... -->
<!-- content to animate -->
<div id="cont">
<!-- keep this still -->
<div id="box">
<img src="maple.jpg" class="profile-pic">
</div>
</div>
</div>
</div>