<h2>hover</h2>
<figure class="fig">
<div class="back">
<div class="clip">
<img class="img" src="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/320/facebook/327/rocket_1f680.png" alt="">
</div>
</div>
</figure>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #012;
margin: 0;
min-height: 100vh;
color: #eee;
font-family: sans-serif;
}
.fig {
position: relative;
width: 200px;
height: 200px;
}
.fig::before {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
background-color: #fff;
}
.img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform: translate(-25%, 0) rotate(45deg);
transition: transform 500ms;
}
.clip {
position: absolute;
inset: 0;
clip-path: inset(0 -100% 0 0 round 50%);
}
.back {
position: absolute;
inset: 0;
transform: rotate(-45deg);
}
.fig:hover .img {
transform: translate(5%, 0) rotate(45deg);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.