In the following script, I would like the magnifying glass to follow the path of the oval (along the black outline) clockwise. How can I manipulate properties to achieve this?
.oval{
background:url(http://s8.postimg.org/wozw0oq9x/oval.png);
width:743px;
height:305px;
margin-top:20px;
margin-left:20px;
}
.glass {
display:block;
background: url(http://s29.postimg.org/5i2f94m83/magnifying_glass.png);
width:100px;
height:83px;
left: 487px;
top: -198px;
position: relative;
-webkit-animation: myOrbit 4s linear infinite;
-moz-animation: myOrbit 4s linear infinite;
-o-animation: myOrbit 4s linear infinite;
animation: myOrbit 4s linear infinite;
}
@keyframes myOrbit {
0% { transform: rotate(0deg) translateX(5px) translateY(120px) rotate(0deg) scale(1); }
25% { transform: rotate(90deg) translateX(5px) translateY(120px) rotate(-90deg) scale(.75); }
50% { transform: rotate(180deg) translateX(5px) translateY(120px) rotate(-180deg) scale(.60); }
75% { transform: rotate(270deg) translateX(5px) translateY(120px) rotate(-270deg) scale(.75); }
100% { transform: rotate(360deg) translateX(5px) translateY(120px) rotate(-360deg) scale(1); }
}
<div class="oval">
</div>
<div class="glass">
</div>
Run codehttps://jsfiddle.net/szq4336q/2/
source
share