LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
.box {
  width: 100px;
  height: 100px;
  fill: url(#linear);
  clip-path: url(#clipping);
}

svg {
  margin-top: 50px;
  transform: scale(2.5, 2.5);
  -webkit-transform: scale(2.5, 2.5);
}

.container {
  width: 100px;
  margin: 10% auto;
}
JS
$(function(){
  $c1 = $('#color-1');
  $c2 = $('#color-2');
  $('svg').on('click', function() {
    var randHue = Math.round(Math.random() * 360);
    var newC1 = 'hsl(' + randHue + ', 100%, 50%)',
        newC2 = 'hsl(' + (randHue + 90) % 360 + ', 100%, 50%)';
    $c1.attr('stop-color', newC1);
    $c2.attr('stop-color', newC2);
  });
});
Term
Thu, 02/22/2018 - 23:49

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv