Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <body>
<div class="canvas">
  <div id="items">
  <svg width="19px" height="19px" viewBox="0 0 19 19" style="left:90px;top:0;">
    <circle id="circle-1" stroke="#FF5D5D" fill="none" stroke-width="4.4" cx="9.5" cy="9.5" r="7.3"></circle>
  </svg>
  <svg width="16px" height="16px" viewBox="0 0 16 16" style="left:56px;top:11px">
    <rect id="square-1" stroke="#FFDF00" fill="none" stroke-width="4.4" x="2.2" y="2.2" width="11.6" height="11.6"></rect>
  </svg>
  <svg width="29px" height="10px" viewBox="0 0 29 10" style="left:120px;top:5px">
      <polygon id="w-2" fill="#A4FF42" points="9.39271255 0 29 0 19.6072874 10 0 10"></polygon>
  </svg>
  <svg width="24px" height="18px" viewBox="0 0 24 18" style="left:23px;top:30px">
      <polygon id="tick" fill="#FF6EFD" points="9.28082762 10.1826234 19.8959098 0 24 3.93688946 9.28082762 18 0 9.15367587 4.10409023 5.21678641"></polygon>
  </svg>
  <svg width="20px" height="18px" viewBox="0 0 20 18" style="left:80px;top:28px">
      <polygon id="triangle-2" fill="#61FFFC" points="10 0 0 18 20 18"></polygon>
  </svg>
<svg width="17px" height="17px" viewBox="0 0 17 17" style="left:117px;top:33px">
      <polygon id="cross" fill="#FF6EFD" points="8.5 4.64574899 13.145749 0 17 3.85425101 12.354251 8.5 17 13.145749 13.145749 17 8.5 12.354251 3.85425101 17 0 13.145749 4.64574899 8.5 0 3.85425101 3.85425101 0"></polygon>
</svg>
<svg width="14px" height="14px" viewBox="0 0 14 14" style="left:163px;top:39px">
    <rect id="square-2" fill="#FFDD00" x="0" y="0" width="14" height="14"></rect>
</svg>
<svg width="17px" height="17px" viewBox="0 0 17 17" style="left:45px;top:45px">
    <circle id="circle-2" fill="#FF5D5D" cx="8.5" cy="8.5" r="8.5"></circle>
</svg>
<svg width="21px" height="19px" viewBox="0 0 21 19"style="left:6px;top:62px">
    <polygon id="triangle-1" stroke="#61FFFC" fill="none" stroke-width="4.2" points="10.5 2 2 16 19 16"></polygon>
</svg>
<svg width="17px" height="26px" viewBox="0 0 17 26" style="left:32px;top:74px">
     <polygon fill="#A4FF42" points="32 87 49 74 49 87 32 100"></polygon>
</svg>
<svg width="17px" height="26px" viewBox="0 0 17 26" style="left:32px;top:74px">
      <polygon id="w-2-copy-4" fill="#A4FF42" points="0 13 17 0 17 13 0 26"></polygon>
</svg>
<svg width="14px" height="14px" viewBox="0 0 14 14" style="left:66px;top:72px">
      <rect id="square-2" fill="#FFDD00" x="0" y="0" width="14" height="14"></rect>
</svg>
<svg width="28px" height="13px" viewBox="0 0 28 13" style="left:93px;top:61px">
      <polyline id="w-1" stroke="#A4FF42" fill="none" stroke-width="4.6" points="2 2 8 11 14 2 20 11 26 2"></polyline>
</svg>
<svg width="28px" height="13px" viewBox="0 0 28 13" style="left:93px;top:61px">
      <polyline id="w-1" stroke="#A4FF42" fill="none" stroke-width="4.6" points="2 2 8 11 14 2 20 11 26 2"></polyline>
</svg>
<svg width="21px" height="19px" viewBox="0 0 21 19" style="left:139px;top:55px">
      <polygon id="triangle-1" stroke="#61FFFC" fill="none" stroke-width="4.2" points="10.5 2 2 16 19 16"></polygon>
</svg>
<svg width="19px" height="19px" viewBox="0 0 19 19" style="top:97px">
        <circle id="circle-1" stroke="#FF5D5D" fill="none" stroke-width="4.4" cx="9.5" cy="9.5" r="7.3"></circle>
</svg>
<svg width="14px" height="14px" viewBox="0 0 14 14"style="left:15px;top:139px">        
  <rect id="square-2" fill="#FFDD00" x="0" y="0" width="14" height="14"></rect>
</svg>
<svg width="17px" height="17px" viewBox="0 0 17 17" style="left:32px;top:110px">
        <polygon id="cross" fill="#FF6EFD" points="8.5 4.64574899 13.145749 0 17 3.85425101 12.354251 8.5 17 13.145749 13.145749 17 8.5 12.354251 3.85425101 17 0 13.145749 4.64574899 8.5 0 3.85425101 3.85425101 0"></polygon>
</svg>
<svg width="20px" height="18px" viewBox="0 0 20 18" style="left:30px;top:160px">
    <polygon id="triangle-2" fill="#61FFFC" points="10 0 0 18 20 18"></polygon>
</svg>
<svg width="17px" height="17px" viewBox="0 0 17 17" style="left:51px;top:144px">
        <circle id="circle-2" fill="#FF5D5D" cx="8.5" cy="8.5" r="8.5"></circle>
</svg>
<svg width="21px" height="19px" viewBox="0 0 21 19" style="left:61px;top:109px">
        <polygon id="triangle-1" stroke="#61FFFC" fill="none" stroke-width="4.2" points="10.5 2 2 16 19 16"></polygon>
</svg>
<svg width="20px" height="20px" viewBox="0 0 20 20" style="left:85px;top:100px">
        <polygon id="square-2-copy-3" fill="#FFDD00" points="9.89949494 -5.68434189e-14 19.7989899 9.89949494 9.89949494 19.7989899 -3.55271368e-15 9.89949494"></polygon>
</svg>
<svg width="24px" height="18px" viewBox="0 0 24 18" style="top:136px;left:79px">
        <polygon id="tick" fill="#FF6EFD" points="9.28082762 10.1826234 19.8959098 0 24 3.93688946 9.28082762 18 0 9.15367587 4.10409023 5.21678641"></polygon>
</svg>
<svg width="16px" height="16px" viewBox="0 0 16 16" style="left:64px;top:179px">
        <rect id="square-1" stroke="#FFDF00" fill="none" stroke-width="4.4" x="2.2" y="2.2" width="11.6" height="11.6"></rect>
</svg>
<svg width="19px" height="19px" viewBox="0 0 19 19" style="left:107px;top:80px">
        <circle id="circle-1" stroke="#FF5D5D" fill="none" stroke-width="4.4" cx="9.5" cy="9.5" r="7.3"></circle>
</svg>
<svg width="28px" height="13px" viewBox="0 0 28 13" style="left:97px;top:170px">
        <polyline id="w-1" stroke="#A4FF42" fill="none" stroke-width="4.6" points="2 2 8 11 14 2 20 11 26 2"></polyline>
</svg>
<svg width="21px" height="19px" viewBox="0 0 21 19" style="left:91px;top:190px">
        <polygon id="triangle-1" stroke="#61FFFC" fill="none" stroke-width="4.2" points="10.5 2 2 16 19 16"></polygon>
</svg>
<svg width="17px" height="17px" viewBox="0 0 17 17" style="left:113px;top:125px">
        <polygon id="cross" fill="#B7FF6A" points="8.5 4.64574899 13.145749 0 17 3.85425101 12.354251 8.5 17 13.145749 13.145749 17 8.5 12.354251 3.85425101 17 0 13.145749 4.64574899 8.5 0 3.85425101 3.85425101 0"></polygon>
</svg>
<svg width="29px" height="10px" viewBox="0 0 29 10" style="left:120px;top:106px">
        <polygon id="w-2" fill="#FF8DFD" points="9.39271255 0 29 0 19.6072874 10 0 10"></polygon>
</svg>
<svg width="29px" height="10px" viewBox="0 0 29 10" style="left:122px;top:188px">
        <polygon id="w-2" fill="#A4FF42" points="9.39271255 0 29 0 19.6072874 10 0 10"></polygon>
</svg>
<svg width="20px" height="18px" viewBox="0 0 20 18" style="left:130px;top:147px">
        <polygon id="triangle-2" fill="#FFE437" points="10 0 0 18 20 18"></polygon>
</svg>
<svg width="17px" height="17px" viewBox="0 0 17 17" style="left:143px;top:121px">
        <circle id="circle-2" fill="#83FFFC" cx="8.5" cy="8.5" r="8.5"></circle>
</svg>
<svg width="16px" height="16px" viewBox="0 0 16 16" style="top:82px;left:152px;">
        <rect id="square-1" stroke="#FFDF00" fill="none" stroke-width="4.4" x="2.2" y="2.2" width="11.6" height="11.6"></rect>
</svg>
<svg width="17px" height="17px" viewBox="0 0 17 17" style="left:175px;top:67px">
        <polygon id="cross" fill="#FF7F7F" points="8.5 4.64574899 13.145749 0 17 3.85425101 12.354251 8.5 17 13.145749 13.145749 17 8.5 12.354251 3.85425101 17 0 13.145749 4.64574899 8.5 0 3.85425101 3.85425101 0"></polygon>
</svg>
<svg width="24px" height="18px" viewBox="0 0 24 18" style="left:180px;top:98px">
        <polygon id="tick" fill="#FF6EFD" points="9.28082762 10.1826234 19.8959098 0 24 3.93688946 9.28082762 18 0 9.15367587 4.10409023 5.21678641"></polygon>
</svg>
<svg width="28px" height="13px" viewBox="0 0 28 13" style="left:170px;top:133px">
        <polyline id="w-1" stroke="#A4FF42" fill="none" stroke-width="4.6" points="2 2 8 11 14 2 20 11 26 2"></polyline>
</svg>
<svg width="19px" height="19px" viewBox="0 0 19 19" style="left:161px;top:157px">
        <circle id="circle-1" stroke="#FF5D5D" fill="none" stroke-width="4.4" cx="9.5" cy="9.5" r="7.3"></circle>
</svg>
  </div>
  <svg width="80" height="80" viewBox="0 0 24 24" fill="#fff" id="ic-search">
    <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
</svg>
<!--   <svg width="10" height="10" style="left:27px;top:27px">
    <circle fill="#fff" cx="5" cy="5" r="5"></circle>
  </svg> -->
  </div>
</body>
            
          
!

CSS

            
              body{
  background:#57068c;
  width:100%;
  height:100%;
  overflow:hidden;
}
.canvas{
  position:relative;
  width:224px;
  margin:20px auto;
}
svg {
  position:absolute;
  transform-origin:center;
  transform:scale(0.5);
  transition:.5s;
}
#ic-search {
  opacity:.8;
  transform:translate(4px,6px);
  animation: searching 5s   cubic-bezier(0.42,-0.33, 0.44, 1.45) 0s infinite normal forwards running
}

@keyframes searching {
  0% {
    transform:translate(4px,6px);
  }
  33% {
    transform:translate(94px,10px);
  }
  67% {
    transform:translate(8px,138px);
  }
  100% {
    transform:translate(152px,108px);
  }
}

            
          
!

JS

            
              window.setInterval(function(){
  var matrix = $('#ic-search').css('transform').replace(/[^0-9\-.,]/g, '').split(',');
  var x = matrix[12] || matrix[4];
  var y = matrix[13] || matrix[5];
  x=Number(x)+29.5;
  y=Number(y)+29.5;
  $('#ic-search').css('transform','translate');
  $('#items').children('svg').each(function(){
    var svgX=$(this).css('left');
    var svgY=$(this).css('top');
    // console.log(svgY);
    svgX=Number(svgX.slice(0,svgX.length-2))+10;
    svgY=Number(svgY.slice(0,svgY.length-2))+10;
    var dist=Math.sqrt((x-svgX)*(x-svgX)+(y-svgY)*(y-svgY));
    // console.log(dist);
    if(dist<20) {
      $(this).css('transform','scale(2)');
    } else {
      $(this).css('transform','scale(0.5)');
    }
  })
}, 10);

            
          
!
999px

Console