Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

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.

            
              <div class="frame">
  <div class="content">
    <h1>Radar animation</h1>
    
    <svg version="1.0" id="radar" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
       width="509.426px" height="381.718px" viewBox="0 0 509.426 381.718" enable-background="new 0 0 509.426 381.718"
       xml:space="preserve">
        <polygon id="back" fill-rule="evenodd" clip-rule="evenodd" fill="#D9D9D9" points="403.4,106.209 402.4,104.477 255.593,189.236 
          255.593,19.718 253.593,19.718 253.593,189.13 106.592,104.218 105.593,105.951 252.685,190.915 105.786,275.727 106.786,277.459 
          253.593,192.7 253.593,362.218 255.593,362.218 255.593,192.595 402.093,277.218 403.093,275.486 256.684,190.916 		"/>
      <path id="dots" fill-rule="evenodd" clip-rule="evenodd" fill="#FFC575" d="M366.593,116.218c-5.523,0-10,4.477-10,10
          c0,5.523,4.477,10,10,10s10-4.477,10-10C376.593,120.695,372.116,116.218,366.593,116.218z M352.593,239.274
          c-5.523,0-10,4.477-10,10c0,5.523,4.477,10,10,10s10-4.477,10-10C362.593,243.751,358.116,239.274,352.593,239.274z
           M253.482,249.274c-5.523,0-10,4.477-10,10s4.477,10,10,10c5.523,0,10-4.477,10-10S259.005,249.274,253.482,249.274z
           M159.093,234.274c-5.523,0-10,4.477-10,10c0,5.523,4.477,10,10,10s10-4.477,10-10
          C169.093,238.751,164.616,234.274,159.093,234.274z M159.093,130.218c0-5.523-4.477-10-10-10s-10,4.477-10,10
          c0,5.523,4.477,10,10,10S159.093,135.741,159.093,130.218z M255.093,41.218c-5.523,0-10,4.477-10,10c0,5.523,4.477,10,10,10
          s10-4.477,10-10C265.093,45.695,260.616,41.218,255.093,41.218z"/>
        <polygon id="mask" fill-rule="evenodd" clip-rule="evenodd" fill="#FFC575" points="254.593,50.718 149.593,129.718 159.25,244.128 
          253.593,261.718 352.593,248.7 367.093,125.718 		"/>
          <polygon id="mask2" fill-rule="evenodd" clip-rule="evenodd" fill="#FFC575" points="254.593,50.718 149.593,129.718 159.25,244.128 
          253.593,261.718 352.593,248.7 367.093,125.718 		"/>
        <path id="lines" fill-rule="evenodd" clip-rule="evenodd" fill="#FFC575" d="M161.159,248.058l91.271,13.776l0.597-3.955l-91.271-13.776
          L161.159,248.058z M256.854,257.649l0.389,3.981l91.61-8.948l-0.389-3.981L256.854,257.649z M365.511,126.74l-14.307,118.476
          l3.971,0.48l14.307-118.476L365.511,126.74z M367.204,123.055l-111.5-74.5l-1.111,1.663l-1.21-1.593l-106,80.5l2.298,3.026
          l-2.246,0.157l7.825,112.098l3.99-0.279l-7.825-112.098l-1.38,0.096l104.621-79.453l110.315,73.708L367.204,123.055z"/>
    <g id="texts">
      <text transform="matrix(1 0 0 1 237.7392 11.7183)">Front</text>
      <text transform="matrix(1 0 0 1 232.3003 378.2183)">System</text>
      <text transform="matrix(1 0 0 1 413.4819 104.2184)">Management</text>
      <text transform="matrix(1 0 0 1 -0.21 104.2184)">Communication</text>
      <text transform="matrix(1 0 0 1 21.77 287.4594)">Architecture</text>
      <text transform="matrix(1 0 0 1 413.4824 287.2184)">Back</text>
    </g>
    </svg>
  </div>
  <div class="author"><a href="https://ggaulard.github.io">Guillaume Gaulard <i class="fa fa-external-link"></i></a></div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Roboto:100);

#radar {
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  //max-width:509.426px;
  width: 100%
}
            
          
!
            
              var radar = Snap("#radar");
var radarMask = Snap("#mask");
var radarMask2 = Snap("#mask2");
var radarLines = Snap("#lines");
var radarDots = Snap("#dots");

var p = radar.path("M10-5-10,15M15,0,0,15M0-5-20,15").attr({
        fill: "none",
        stroke: "#FFC575",
        strokeWidth: 5
    });
// To create pattern,
// just specify dimensions in pattern method:
p = p.pattern(0, 0, 10, 10);
// Then use it as a fill on big circle
radarMask2.attr({
    fill: p
});

radarMask.attr({
    mask: radarMask2
});

radarMask.attr({fill: "r(0.5, 0.65, 0.6)#FFC575-#fff"});

var radarGroup = radar.group(radarMask, radarLines, radarDots);

var scale = 0;

var box = radar.getBBox();
var c = {x:box.cx + 9, y: box.cy}

function animate(){
  radarGroup.transform('s0,'+c.x+','+c.y)
  radarGroup.animate({ transform: 's1,'+c.x+','+c.y }, 1000, mina.bounce);
}

animate();

radar.click(animate);


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console