Firstly, I am open to any superior suggestions that could save me some time and effort.
My goal is to create a vertically oriented circular/elliptical carousel. Despite my extensive searching on Google for days, I have not come across anything similar, which surprises me.
The idea is to have elements rotating in a circle pattern. Upon hovering over any element, the rotation of all elements would pause, while the hovered element undergoes an animation like expanding in size.
View this JSFiddle: https://jsfiddle.net/23x7t4dq/
I attempted using a combination of pausing transitions and transformations but none have proven effective.
.circle-container {
margin: 0 auto;
position: relative;
width: 440px;
height: 440px;
background: transparent;
-webkit-animation: rotation 6s linear 0s infinite normal none;
-moz-animation: rotation 6s linear 0s infinite normal none;
-ms-animation: rotation 6s linear 0s infinite normal none;
-o-animation: rotation 6s linear 0s infinite normal none;
animation: rotation 6s linear 0s infinite normal none;
}
.circle {
position: absolute;
top: 170px;
left: 170px;
width: 100px;
height: 100px;
border-radius: 50%;
opacity: 0.7;
}
.circle-container:hover {
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
-o-animation-play-state: paused;
animation-play-state: paused;
}
.circle:nth-child(1) {
-webkit-transform: rotate(0deg) translateX(150px);
-moz-transform: rotate(0deg) translateX(150px);
-ms-transform: rotate(0deg) translateX(150px);
-o-transform: rotate(0deg) translateX(150px);
transform: rotate(0deg) translateX(150px);
background: #ff504f;
}
.circle:nth-child(2) {
-webkit-transform: rotate(72deg) translateX(150px);
-moz-transform: rotate(72deg) translateX(150px);
-ms-transform: rotate(72deg) translateX(150px);
-o-transform: rotate(72deg) translateX(150px);
transform: rotate(72deg) translateX(150px);
background: #ffe63d;
}
.circle:nth-child(3) {
-webkit-transform: rotate(144deg) translateX(150px);
-moz-transform: rotate(144deg) translateX(150px);
-ms-transform: rotate(144deg) translateX(150px);
-o-transform: rotate(144deg) translateX(150px);
transform: rotate(144deg) translateX(150px);
background: #50dc64;
}
.circle:nth-child(4) {
-webkit-transform: rotate(216deg) translateX(150px);
-moz-transform: rotate(216deg) translateX(150px);
-ms-transform: rotate(216deg) translateX(150px);
-o-transform: rotate(216deg) translateX(150px);
transform: rotate(216deg) translateX(150px);
background: #41c39d;
}
.circle:nth-child(5) {
-webkit-transform: rotate(288deg) translateX(150px);
-moz-transform: rotate(288deg) translateX(150px);
-ms-transform: rotate(288deg) translateX(150px);
-o-transform: rotate(288deg) translateX(150px);
transform: rotate(288deg) translateX(150px);
background: #4db5dc;
}
@-webkit-keyframes rotation {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes rotation {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
@-ms-keyframes rotation {
from {
-ms-transform: rotate(0deg);
}
to {
-ms-transform: rotate(360deg);
}
}
@-o-keyframes rotation {
from {
-o-transform: rotate(0deg);
}
to {
-o-transform: rotate(360deg);
}
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
<div class="circle-container">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>