JSFiddle - React, Tailwind, and code Playground
HTML
<div class="scales">
<div class="shoulders">
<span class="rope"></span>
<span class="rope"></span>
</div>
<div class="tripod"></div>
</div>
CSS
.scales {
position: relative;
margin: 50px;
width: 200px;
height: 200px;
}
.tripod,
.shoulders {
position: absolute;
width: 100%;
height: 15px;
margin-top: 40px;
background: #333;
border-radius: 5px;
z-index: 5;
}
.shoulders::before {
position: absolute;
content: '';
left: 50%;
top: 50%;
margin-top: -3px;
margin-left: -3px;
width: 6px;
height: 6px;
background: #fff;
color: #f00;
border-radius: 3px;
}
.tripod {
margin-top: 50%;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
z-index: 0;
}
.rope {
position: absolute;
top: 0;
margin-top: 10px;
width: 10px;
height: 50px;
background: #333;
-webkit-transform-origin: 50% 0;
-moz-transform-origin: 50% 0;
-o-transform-origin: 50% 0;
-ms-transform-origin: 50% 0;
transform-origin: 50% 0;
}
.rope:nth-of-type(1) {
margin-left: 20px;
}
.rope:nth-of-type(2) {
right: 0;
margin-right: 20px;
}
.rope::after {
position: absolute;
top: 100%;
margin-top: -10px;
margin-left: -20px;
content: '';
width: 30px;
height: 30px;
border: 10px solid #060;
border-radius: 50%;
}
.rope:first-child::after {
border-color: #900;
}
/**/
.shoulders {
-webkit-animation: swing 4s linear 0s infinite;
-moz-animation: swing 4s linear 0s infinite;
-o-animation: swing 4s linear 0s infinite;
animation: swing 4s linear 0s infinite;
}
.rope {
-webkit-animation: antiswing 4s linear 0s infinite;
-moz-animation: antiswing 4s linear 0s infinite;
-o-animation: antiswing 4s linear 0s infinite;
animation: antiswing 4s linear 0s infinite;
}
@-webkit-keyframes swing {
0% {
-webkit-transform: rotate(0deg);
}
25% {
-webkit-transform: rotate(45deg);
}
75% {
-webkit-transform: rotate(-45deg);
}
100% {
...