.container { position: relative; } .chain { margin: 45px 100px; height: 100px; width: 310px; position: relative; background: -webkit-linear-gradient(0deg, gold 50%, transparent 50%), -webkit-linear-gradient(0deg, gold 50%, transparent 50%), white; background: -moz-linear-gradient(90deg, gold 50%, transparent 50%), -moz-linear-gradient(90deg, gold 50%, transparent 50%), white; background: linear-gradient(90deg, gold 50%, transparent 50%), linear-gradient(90deg, gold 50%, transparent 50%), white; background-size: 41px 5px; background-repeat: repeat-x; background-position: 20px 0px, 20px 95px; -webkit-animation: bgPos 1s infinite linear; -moz-animation: bgPos 1s infinite linear; animation: bgPos 1s infinite linear; } .belt, .belt-after, .belt .spokes, .belt .spokes:before, .belt .spokes:after, .belt-after .spokes, .belt-after .spokes:before, .belt-after .spokes:after { position: absolute; height: 90px; width: 15px; top: 0px; border-top: 5px solid gold; border-bottom: 5px solid gold; z-index: -1; } .belt, .belt-after { -webkit-animation: borderAnim 8s infinite linear; -moz-animation: borderAnim 8s infinite linear; animation: borderAnim 8s infinite linear; } .belt .spokes, .belt-after .spokes { top: -5px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); } .belt .spokes:before, .belt .spokes:after, .belt-after .spokes, .belt-after .spokes:before, .belt-after .spokes:after { content: ''; } .belt .spokes:before, .belt-after .spokes:before { top: -5px; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); transform: rotate(90deg); } .belt .spokes:after, .belt-after .spokes:after { top: -5px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); } .belt { left: -16px; } .belt-after { right: -16px; } .gear { position: absolute; top: 5px; height: 90px; width: 90px; border-radius: 100%; -webkit-animation: borderAnim 8s infinite linear; -moz-animation: borderAnim 8s infinite linear; animation: borderAnim 8s infinite linear; box-shadow: inset 0px 0px 0px 30px gray, inset 0px 0px 0px 40px white, inset 0px 0px 0px 50px tomato; z-index: 4; } .gear:before, .gear .spokes, .gear .spokes:before, .gear .spokes:after { position: absolute; content: ''; height: 88px; width: 15px; top: -5px; border-top: 6px solid gray; border-bottom: 6px solid gray; } .gear:before { left: 37px; -webkit-transform: rotate(22.5deg); -moz-transform: rotate(22.5deg); transform: rotate(22.5deg); } .gear .spokes { left: 37px; -webkit-transform: rotate(67.5deg); -moz-transform: rotate(67.5deg); transform: rotate(67.5deg); } .gear .spokes:before { top: -6px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); } .gear .spokes:after { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); transform: rotate(90deg); } .chain .belt + .gear { left: -52px; } .chain .belt-after + .gear { right: -52.5px; } .gear-small { position: absolute; left: -91px; top: -20px; height: 50px; width: 50px; border-radius: 50%; -webkit-animation: borderAnim 8s 0.4s infinite linear; -moz-animation: borderAnim 6s infinite linear; animation: borderAnim 6s infinite linear; -webkit-animation-direction: reverse; -moz-animation-direction: reverse; animation-direction: reverse; box-shadow: inset 0px 0px 0px 20px gray; z-index: -2; } .gear-small:before { position: absolute; content: ''; left: 21px; top: -3px; height: 48px; width: 10px; border-top: 4px solid gray; border-bottom: 4px solid gray; } .gear-small .spokes, .gear-small .spokes:before, .gear-small .spokes:after { position: absolute; content: ''; left: 21px; top: -3px; height: 48px; width: 10px; border-top: 4px solid gray; border-bottom: 4px solid gray; } .gear-small .spokes { -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); } .gear-small .spokes:before { left: 0px; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); transform: rotate(90deg); } .gear-small .spokes:after { left: 0px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); } @-webkit-keyframes borderAnim { 0% { -webkit-transform: rotate(360deg); } 100% { -webkit-transform: rotate(0deg); } } @-moz-keyframes borderAnim { 0% { -moz-transform: rotate(360deg); } 100% { -moz-transform: rotate(0deg); } } @keyframes borderAnim { 0% { transform: rotate(360deg); } 100% { transform: rotate(0deg); } } @-webkit-keyframes bgPos { 0% { background-position: 20px 0px, -20px 95px; } 100% { background-position: -20px 0px, 20px 95px; } } @-moz-keyframes bgPos { 0% { background-position: 20px 0px, -20px 95px; } 100% { background-position: -20px 0px, 20px 95px; } } @keyframes bgPos { 0% { background-position: 20px 0px, -20px 95px; } 100% { background-position: -20px 0px, 20px 95px; } } #pull-switch { display: none; } #switch { position: absolute; left: 77px; top: 50px; border-right: 2px dotted tomato; height: 200px; width: 15px; -webkit-transition: height 0.5s; -moz-transition: height 0.5s; transition: height 0.5s; z-index: 10; } #handle { display: block; position: absolute; left: 8px; bottom: 0%; background-color: tomato; width: 16px; height: 16px; border-radius: 50%; cursor: pointer } #pull-switch:checked + #switch > #handle { background-color: seagreen; } #pull-switch:checked + #switch { height: 225px; border-color: seagreen; } #pull-switch ~ .chain .gear-small, #pull-switch ~ .chain .belt, #pull-switch ~ .chain .belt-after, #pull-switch ~ .chain .gear, #pull-switch ~ .chain { -webkit-animation-play-state: paused; -moz-animation-play-state: paused; animation-play-state: paused; } #pull-switch:checked ~ .chain .gear-small, #pull-switch:checked ~ .chain .belt, #pull-switch:checked ~ .chain .belt-after, #pull-switch:checked ~ .chain .gear, #pull-switch:checked ~ .chain { -webkit-animation-play-state: running; -moz-animation-play-state: running; animation-play-state: running; } #pull-switch:checked ~ .chain .belt + .gear, #pull-switch:checked ~ .chain .belt-after + .gear { box-shadow: inset 0px 0px 0px 30px gray, inset 0px 0px 0px 40px white, inset 0px 0px 0px 50px seagreen; }
<div class="container"> <input type="checkbox" id="pull-switch" /> <div id="switch"> <label for="pull-switch" id="handle"></label> </div> <div class="chain"> <div class="gear-small"> <div class="spokes"></div> </div> <div class="belt"> <div class="spokes"></div> </div> <div class="gear"> <div class="spokes"></div> </div> <div class="belt-after"> <div class="spokes"></div> </div> <div class="gear"> <div class="spokes"></div> </div> </div> </div>