HTML
<div class="container">
<div class="holder">
<div class="holderBars"></div>
<div class="cradles">
<div class="cradle cradle-first">
<div class="line"></div>
<div class="circle">
<svg viewBox="0 0 10 15" class="svg-3">
<!--<path d="M8,1 Q2,2 1,8"/>-->
<path d="M4,3 Q1,5 1,10"/>
</svg>
</div>
</div>
<div class="cradle cradle-middle">
<div class="line"></div>
<div class="circle">
<svg viewBox="0 0 10 15" class="svg-3">
<!--<path d="M8,1 Q2,2 1,8"/>-->
<path d="M4,3 Q1,5 1,10"/>
</svg>
</div>
</div>
<div class="cradle cradle-middle">
<div class="line"></div>
<div class="circle">
<svg viewBox="0 0 10 15" class="svg-3">
<!--<path d="M8,1 Q2,2 1,8"/>-->
<path d="M4,3 Q1,5 1,10"/>
</svg>
</div>
</div>
<div class="cradle cradle-middle">
<div class="line"></div>
<div class="circle">
<svg viewBox="0 0 10 15" class="svg-3">
<!--<path d="M8,1 Q2,2 1,8"/>-->
<path d="M4,3 Q1,5 1,10"/>
</svg>
</div>
</div>
<div class="cradle cradle-last">
<div class="line"></div>
<div class="circle">
<svg viewBox="0 0 10 15" class="svg-3">
<!--<path d="M8,1 Q2,2 1,8"/>-->
<path d="M4,3 Q1,5 1,10"/>
</svg>
</div>
</div>
</div>
<div class="holder__bottomBar pos-left"></div>
<div class="holder__bottomBar pos-right"></div>
</div>
</div>
ES6
//Inspired by https://dribbble.com/shots/3405520-001-Newton-s-Cradle
TweenMax.fromTo('.fire', .03, {x: -.5, y: -.4}, {x: .5, y: .4, repeat: -1, yoyo: true})
var tl = new TimelineMax({repeat: -1});
tl
.fromTo('.cradle-last', .5, {transform: 'rotate(-45deg)'}, {transform: 'rotate(0)', ease: Power1.easeIn})
.to('.cradle-last', .2, {transform: 'rotate(2deg)'})
.to('.cradle-middle', .2, {rotation: '2deg'}, '-=.2')
.to('.cradle-middle', .2, {rotation: 0})
.to('.cradle-last', .2, {transform: 'rotate(0)'}, '-=.2')
.to('.cradle-first', .5, {rotation: '45deg', ease: Power1.easeOut}, '-=.4')
.to('.cradle-first', .5, {rotation: '0', ease: Power1.easeIn})
.to('.cradle-first', .2, {rotation: '-2deg'})
.to('.cradle-middle', .2, {rotation: '-2deg'}, '-=.2')
.to('.cradle-middle', .2, {rotation: 0})
.to('.cradle-first', .2, {rotation: '0'}, '-=.2')
.to('.cradle-last', .5, {transform: 'rotate(-45deg)'}, '-=.4')
tl.timeScale(2.5);
//SLOW MOTION
document.querySelector('.holder').addEventListener('mouseenter', () => tl.timeScale(.2))
document.querySelector('.holder').addEventListener('mouseleave', () => tl.timeScale(2.5))
//SCALE DEPENDS ON WINDOW SIZE
function scaleCradle() {
const holderWidth = 850,
windowWidth = window.innerWidth,
scale = windowWidth / holderWidth > 1 ? 1 : windowWidth / holderWidth;
document.querySelector('.holder').style.transform = `scale(${scale})`;
}
scaleCradle()
window.addEventListener('resize', scaleCradle);