cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!-- Tomasz Drozdowicz (c) 2017 CC30BY -->
<div class="rowwrap">
  <div id="cloudy" onclick="select(this.id)" class="svg"></div>
  <div id="diamond" onclick="select(this.id)" class="svg"></div>
  <div id="video" onclick="select(this.id)" class="svg"></div>
  <div id="swiss" onclick="select(this.id)" class="svg"></div>
  <div id="puzzle" onclick="select(this.id)" class="svg"></div>
  <div id="gamepad" onclick="select(this.id)" class="svg"></div>
  <div id="writing" onclick="select(this.id)" class="svg"></div>
  <div id="levels" onclick="select(this.id)" class="svg"></div>
  <div id="flask" onclick="select(this.id)" class="svg"></div>  
</div>

<div class="footer">Icons made by <a href="http://www.flaticon.com/authors/maxim-basinski" title="Maxim Basinski">Maxim Basinski</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
<div class="footer">Tomasz Drozdowicz 2017 @<a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>

<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
  <filter id="init">
    <feColorMatrix type="saturate" values="0"/>
  </filter>
  <filter id="hover">
    <feGaussianBlur stdDeviation="0" />
    <feColorMatrix type="hueRotate" values="75"/>
  </filter>
  <filter id="click">
    <feColorMatrix type="hueRotate" values="100"/>
  </filter>
  <filter id="active">
    <feColorMatrix type="matrix" values="0 .0 1 0 0  0 0 1 0 0  1 1 1 1 0  0 0 0 1 0"/>
  </filter>
</svg>
            
          
!
            
              /*Tomasz Drozdowicz (c) 2017 CC30BY */
.footer, .footer a {
  font-family: arial;
  font-size: 11px;
  color: #888;
  padding: 5px;
  margin-bottom: 10px;
  background: #e8e8e8;
}
.footer a {
  text-decoration: none;
  font-weight: bold;
}
.footer a:hover {
  color: red;
}
.rowwrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;      
  margin-bottom: 10px;
  overflow: hidden;
  background: #e8e8e8;
}
.svg {
  height: 140px;
  width: 140px;
  margin: auto;
  padding: 10px; 
  float: left;
  transform: scale(0.75, 0.75);
  filter: url(#init);
  transition: 0.2s all linear;
}
.svg:hover {
  transform: scale(0.9, 0.9);
  filter: none;
}
.svg:active {
  filter: url(#click);  
  animation-name: shake-rotate;
  animation-duration: 100ms;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  transition: 0.2s all linear;
}
.selected {
  filter: url(#active) brightness(110%);
  transform: scale(1, 1);
  animation: spin 0.3s linear;
  transition: 0.2s all linear;
}
.selected:hover {
  filter: url(#active) brightness(90%);
  transition: 0.2s all linear;
}
.selected:active {
  filter: url(#active) brightness(90%);
  animation-name: shake-rotate;
  animation-duration: 100ms;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  transition: 0.2s all linear;
}
@keyframes shake-rotate {
  2% {
    transform: translate(0, 0) rotate(7.5deg); }
  4% {
    transform: translate(0, 0) rotate(2.5deg); }
  6% {
    transform: translate(0, 0) rotate(2.5deg); }
  8% {
    transform: translate(0, 0) rotate(-0.5deg); }
  10% {
    transform: translate(0, 0) rotate(2.5deg); }
  12% {
    transform: translate(0, 0) rotate(-5.5deg); }
  14% {
    transform: translate(0, 0) rotate(0.5deg); }
  16% {
    transform: translate(0, 0) rotate(0.5deg); }
  18% {
    transform: translate(0, 0) rotate(2.5deg); }
  20% {
    transform: translate(0, 0) rotate(1.5deg); }
  22% {
    transform: translate(0, 0) rotate(-5.5deg); }
  24% {
    transform: translate(0, 0) rotate(3.5deg); }
  26% {
    transform: translate(0, 0) rotate(4.5deg); }
  28% {
    transform: translate(0, 0) rotate(5.5deg); }
  30% {
    transform: translate(0, 0) rotate(0.5deg); }
  32% {
    transform: translate(0, 0) rotate(-0.5deg); }
  34% {
    transform: translate(0, 0) rotate(6.5deg); }
  36% {
    transform: translate(0, 0) rotate(4.5deg); }
  38% {
    transform: translate(0, 0) rotate(-5.5deg); }
  40% {
    transform: translate(0, 0) rotate(6.5deg); }
  42% {
    transform: translate(0, 0) rotate(-4.5deg); }
  44% {
    transform: translate(0, 0) rotate(6.5deg); }
  46% {
    transform: translate(0, 0) rotate(1.5deg); }
  48% {
    transform: translate(0, 0) rotate(-6.5deg); }
  50% {
    transform: translate(0, 0) rotate(6.5deg); }
  52% {
    transform: translate(0, 0) rotate(4.5deg); }
  54% {
    transform: translate(0, 0) rotate(-6.5deg); }
  56% {
    transform: translate(0, 0) rotate(-5.5deg); }
  58% {
    transform: translate(0, 0) rotate(7.5deg); }
  60% {
    transform: translate(0, 0) rotate(3.5deg); }
  62% {
    transform: translate(0, 0) rotate(6.5deg); }
  64% {
    transform: translate(0, 0) rotate(2.5deg); }
  66% {
    transform: translate(0, 0) rotate(-4.5deg); }
  68% {
    transform: translate(0, 0) rotate(-3.5deg); }
  70% {
    transform: translate(0, 0) rotate(-3.5deg); }
  72% {
    transform: translate(0, 0) rotate(0.5deg); }
  74% {
    transform: translate(0, 0) rotate(-5.5deg); }
  76% {
    transform: translate(0, 0) rotate(4.5deg); }
  78% {
    transform: translate(0, 0) rotate(-1.5deg); }
  80% {
    transform: translate(0, 0) rotate(1.5deg); }
  82% {
    transform: translate(0, 0) rotate(2.5deg); }
  84% {
    transform: translate(0, 0) rotate(0.5deg); }
  86% {
    transform: translate(0, 0) rotate(-2.5deg); }
  88% {
    transform: translate(0, 0) rotate(7.5deg); }
  90% {
    transform: translate(0, 0) rotate(4.5deg); }
  92% {
    transform: translate(0, 0) rotate(-6.5deg); }
  94% {
    transform: translate(0, 0) rotate(0.5deg); }
  96% {
    transform: translate(0, 0) rotate(5.5deg); }
  98% {
    transform: translate(0, 0) rotate(-6.5deg); }
  0%, 100% {
    transform: translate(0, 0) rotate(0); } }

@keyframes spin { 
  50% { 
    transform: rotate(180deg); 
  }
  100% { 
    transform: rotate(0deg); 
  } 
}
.svg#cloudy {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/cloudy.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#diamond {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/diamond.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#video {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/play-video.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#swiss {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/swiss-army-knife.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#puzzle {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/puzzle.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#gamepad {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/gamepad.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#writing {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/writing.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#levels {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/levels.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
.svg#flask {
  background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/727862/flask.svg');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0%;
}
            
          
!
            
              //Tomasz Drozdowicz (c) 2017 CC30BY
function select(id) {
  var elem = document.getElementById(id);
  var ch = elem.parentNode.children;
  if(elem.className === 'svg') {
      for(var i = 0; i < ch.length; i++) {
          ch[i].className = ch[i].className.replace(new RegExp('\\b' + ' selected' + '\\b', 'g'), '');
      };
      elem.className += ' ' + 'selected';
  } else {
      elem.className = 'svg';
  }
}
            
          
!
999px
Loading ..................

Console