$white: #fff; @mixin transition($animation) { -webkit-transition: $animation .25s ease-in-out; -moz-transition: $animation .25s ease-in-out; -ms-transition: $animation .25s ease-in-out; -o-transition: $animation .25s ease-in-out; transition: $animation .25s ease-in-out; } @keyframes easeInElastic { 0% { transform: scale(1); } 25% { transform: scale(1.135); } 100% { transform: scale(0); } } @keyframes easeInElasticVisible { 0% { transform: scale(1); } 25% { transform: scale(1.135); } 100% { transform: scale(.85); } } @keyframes easeOutElastic { 0% { transform: scale(0); }; 60% { transform: scale(1.135); } 80% { transform: scale(.95); } 100% { transform: scale(1); } } @keyframes easeOutElasticVisible { 0% { transform: scale(.85); }; 20% { transform: scale(1.05); } 40% { transform: scale(.95); } 100% { transform: scale(1); } } *, *::before, *::after { box-sizing: border-box; } body { background: #3f4145; z-index: -99; } .logo a { position: absolute; top: 50%; left: 50%; display: block; width: 100px; height: 100px; margin-top: -50px; margin-left: -50px; cursor: pointer; span { position: absolute; display: block; width: 100px; height: 100px; background: #00b1d4; border-radius: 50%; box-shadow: 1px 3px 6px rgba(0,0,0, .15); transform: scale(0); } } .cdunn { position: relative; width: 100%; height: auto; @include transition(all); } .cdunn-path { position: absolute; width: 100%; height: auto; @include transition(all); } .logo.animate a span { animation: easeInElastic .35s forwards; } .logo.animate a .cdunn { animation: easeOutElasticVisible .5s forwards; } .logo.animate a:focus span, .logo.animate a:hover span { animation: easeOutElastic .5s forwards; } .logo.animate a:focus .cdunn, .logo.animate a:hover .cdunn { animation: easeInElasticVisible .35s forwards; } .logo a:focus .cdunn-path, .logo a:hover .cdunn-path { fill: $white; }