Is there any way to remove overflow: hidden from the top and right part of the box? I don't want dog's ear and nose clipped at the end of animation. At 60%,100% position the dog's nose and ear should not be clipped but his body at the bottom and left should be clipped so that it looks like he put his head through the hole. I thought of using clip-path I cannot find a shape to do it. Is there any css property or technique to do this? Please help.
.box {
width: 500px;
height: 500px;
background-color: orange;
overflow: hidden;
border-radius: 50%;
}
.dog {
width: 115%;
height: 115%;
animation: dogPeeking 5s linear infinite alternate;
}
@keyframes dogPeeking {
0% {
transform: translate(-50%, -10%) rotateY(180deg);
}
60%,100% {
transform: translate(10%, -10%) rotateY(180deg);
}
}
<div class="box">
<img src="https://res.cloudinary.com/ddq2p90tz/image/upload/v1662628751/dog_dr7izv.png" alt="dog" class="dog" />
</div>