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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML

              
                
<a class="badge play first-contact">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 250 250">
    <g id="base">
      <circle class="bg-1" cx="125" cy="125" r="110"/>
      <circle class="sky" cx="125" cy="125" r="95"/>
    </g> 
    <g class="ship">
      <path class="fc-st2" d="M77.4 119.2c4.7 0 8.5 3.8 8.4 8.5 0 4.6-3.8 8.3-8.4 8.3-4.8 0-8.4-3.8-8.4-8.7 0-4.3 3.8-8.1 8.4-8.1zM164.6 127.6c0-4.6 3.8-8.3 8.4-8.3 4.7 0 8.5 3.8 8.5 8.5 0 4.6-3.8 8.3-8.4 8.3-4.8 0-8.5-3.7-8.5-8.5zM125.3 130.5c4.6 0 8.4 3.9 8.4 8.5 0 4.5-3.9 8.4-8.4 8.4-4.7 0-8.5-3.9-8.4-8.7-.1-4.4 3.8-8.2 8.4-8.2z"/>
      <circle class="fc-st3" cx="125" cy="101.7" r="47.4"/>
      <ellipse class="fc-st3" cx="125" cy="119.7" rx="79" ry="36.1"/>
      <path class="fc-st4" d="M125 59.9c-23.1 0-41.8 18.7-41.8 41.8 0 9 18.7 16.9 41.8 16.9s41.8-7.9 41.8-16.9c0-23.1-18.7-41.8-41.8-41.8z"/>
      <path class="fc-st5" d="M125 151.3v38.4"/>
      <g>
        <path class="fc-st5" d="M86.6 146l-13.5 31M163.4 146l13.5 31"/>
      </g>
      <path class="lights" d="M199.4 113.8c-10.9 14-40.1 25.1-74.4 25.1-33.6 0-62.3-10.7-73.7-24.3" id="lights"/>
    </g>
    <g id="alien">
      <path id="head" class="fc-st3" d="M144.4 98.5c0 10.7-8.7 30.2-19.4 30.2s-19.4-19.5-19.4-30.2 8.7-19.4 19.4-19.4 19.4 8.7 19.4 19.4z"/>
      <g class="eyes">
        <path d="M131.6 108.3c-3.2.1-4.3-1.6-3.1-3.8 2-3.4 5.1-5.3 9-5.8 1.1-.1 2.3 0 2.9 1.1.6 1.1.2 2.1-.4 3-2.1 3.4-5.2 5.1-8.4 5.5zM113.2 98.9c3.4.6 6.7 2.2 8.7 5.8 1.1 2 .2 3.5-2.1 3.7-3.4.3-8.5-2.9-9.8-6.1-.9-2.1.2-3.4 3.2-3.4z"/>
      </g>
    </g>
  </svg>
  <h3>1st contact</h3>
</a> 

<a class="badge play ninja-status">
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 250 250">
    <circle class="bg-1" cx="125" cy="125" r="110"></circle>
    <g id="ninja">
      <defs>
        <circle id="SVGID_1_" cx="125" cy="125" r="95"/>
      </defs>
      <clipPath id="mask">
        <use xlink:href="#SVGID_1_" overflow="visible"/>
      </clipPath>
      <g class="st1">
        <path id="bust" class="head bust" d="M56.3 213.4c19 14.8 42.8 23.6 68.7 23.6 61.9 0 112-50.1 112-112 0-1.4 0-2.8-.1-4.2L56.3 213.4z"/>
        <circle id="head" class="head" cx="125" cy="125" r="75"/>
        <g class="eyes">
          <path class="eye-slot" d="M161.1 94.7C123 95.9 85 97.2 47 98.5c-.8 11.5-1.5 22.9-2.2 34.3 40.4-.5 80.5-1 120.8-1.5-1.5-12.3-3-24.4-4.5-36.6z"/>
          <path class="head left-eye" d="M72.1 117c-.4 1.4-.7 2.7-1.3 3.8-1.5 2.9-5.5 4.6-9.2 4.1-2.9-.4-5.4-2.7-6.1-6-.3-1.1 0-2.4.2-3.6.1-.6.5-1.2.8-1.9-3.1-.6-6.1-1.2-9.2-1.9.3-2.3.6-4.5.9-6.9 11.8 2.5 23.4 4.9 35.2 7.4-.3 2.4-.7 4.6-1 7.1-3.6-.7-7-1.4-10.3-2.1z"/>
          <path class="head right-eye" d="M138.5 102.8c.3 2.2.7 4.3.9 6.4 0 .2-.5.6-.8.6-2.6.6-5.1 1.1-7.7 1.7-.2.1-.5.1-.7.2.9 2.7.9 5.4-.5 7.8-1 1.8-2.7 2.8-4.6 3.3-5 1.3-8.5-1.4-10.2-7.8-3.4.7-6.9 1.4-10.4 2.2-.4-2.4-.7-4.7-1-7.1 11.6-2.4 23.2-4.8 35-7.3z"/>
        </g>
        <path class="mouth" d="M134.9 161.9c-8.1 6.8-18.6 11-30.1 11-2.6 0-5.2-.2-7.7-.6"/>
      </g>
    </g>
  </svg>
  <h3>eagle eye</h3>
</a>

<a class="badge play helpful-hero">
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 250 250">
    <g id="base">
    <path class="h-st0" d="M125 237c61.9 0 112-50.1 112-112H13c0 61.9 50.1 112 112 112z"/>
    <circle class="h-st1" cx="125" cy="125" r="112"/>
  </g>
  <g class="h-st3">
    <path class="cape-trim" d="M125,232c13.4,0,26.3-2.4,38.3-6.7L125,159l-38.3,66.3C98.7,229.6,111.6,232,125,232z"/>
    <circle class="h-st2" cx="125" cy="125" r="73"/>
    <path class="h-st0" d="M125 52c-40.3 0-73 32.7-73 73h146c0-40.3-32.7-73-73-73z"/>
    <path class="h-st3" d="M185.2 87L125 97.6 64.8 87l-11.9 30 24.4 36.1 47.7-18.5 47.7 18.5L197 117z"/>
    <path class="h-st2" d="M97.1 119c-.4 1.4-.7 2.7-1.3 3.8-1.5 2.9-5.5 4.6-9.2 4.1-2.9-.4-5.4-2.7-6.1-6-.3-1.1 0-2.4.2-3.6.1-.6.5-1.2.8-1.9-3.1-.6-6.1-1.2-9.2-1.9.3-2.3.6-4.5.9-6.9 11.8 2.5 23.4 4.9 35.2 7.4-.3 2.4-.7 4.6-1 7.1-3.6-.7-7-1.4-10.3-2.1z"/>
    <path class="h-st3 nose" d="M167.8 60.6l14.6-19.4 2.8 45.8zM79.1 60.6L64.5 41.2 61.7 87z"/>
    <path class="h-st4 mouth" d="M125 174l31-12"/>
    <path class="h-st4" d="M114 153h22"/>
    <path class="cape" d="M13 129h39M195 129h39"/>
    <circle class="h-st6" cx="125" cy="125" r="73"/>
    <path class="h-st2" d="M151.6 119c.4 1.4.7 2.7 1.3 3.8 1.5 2.9 5.5 4.6 9.2 4.1 2.9-.4 5.4-2.7 6.1-6 .3-1.1 0-2.4-.2-3.6-.1-.6-.5-1.2-.8-1.9 3.1-.6 6.1-1.2 9.2-1.9-.3-2.3-.6-4.5-.9-6.9-11.8 2.5-23.4 4.9-35.2 7.4.3 2.4.7 4.6 1 7.1 3.6-.7 7.1-1.4 10.3-2.1z"/>
  </g>
  </svg>
  <h3>Helpful hero</h3>
</a>






              
            
!

CSS

              
                $base-color: $neutral-70;

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  height: 100vh;
  background: #fff;
}
.flip-container, .badge {
  border-radius: 50%;
}
.badge {
  width: 156px;
  margin: 5%;
  align-self: center;
  svg {
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    width: 100%;
    background: white;
  }
  h3 {
    text-transform: uppercase;
    // text-shadow: 
    //   -3px 3px white, 
    //   3px 3px white, 
    //   3px 3px white, 
    //   3px -3px white;
    text-align: center;
    color: $base-color;
    font-size: 20px;
    font-weight: 800;
    margin: 10px 0;
  }
}

// Common
.bg-1{fill:white;stroke:$base-color;stroke-width:15;stroke-miterlimit:10;} 

// Alien
.sky{fill:#26cfff;} 
.eyes {fill:white;} 
.fc-st3{fill:$base-color;} 
.fc-st4{fill:white;} 
.fc-st5{fill:none;stroke:$base-color;stroke-width:11.286;stroke-linecap:round;stroke-miterlimit:10;} 
.ship {
  transition: all .3s ease;
  transform-origin: 50% 50%;
}
svg:hover .ship {
  transform: rotate(-20deg);
}
.lights {
  fill:none;
  stroke: white;
  stroke-dasharray: 5px, 20px;
  stroke-width:6.7714;
  stroke-linecap:round;
  stroke-miterlimit:10;
}
.first-contact.play {
  .lights {
    animation: light-bar 3s linear infinite;
  }
  .ship {
    animation: ship-fly 3s ease infinite;
  }
  .eyes {
    animation: blink 5s linear infinite;
    animation-delay: 1s;
  }
}
@keyframes light-bar {
  0%   { stroke-dasharray: 5px, 20px; }
  50%  { stroke-dashoffset: 300px; }
  100% { stroke-dasharray: 5px, 20px; }
}
@keyframes ship-fly {
  0% { transform: rotate(-20deg); }
  50% { transform: rotate(20deg); }
  100% { transform: rotate(-20deg); }
}
@keyframes blink {
  0% {}
  1% {
    fill: transparent;
    stroke: white;
  }
  3% {
    fill: white;
    stroke: transparent;
  }
  100% {}
}

// Ninja
.st0 {fill:none;stroke:$base-color;stroke-width:15;stroke-miterlimit:10;} 
.st1 {clip-path:url(#mask);} 
.head {fill:$base-color;} 
.eye-slot {fill:#FFFFFF;} 
.eyes {}
.mouth {fill:none;stroke:#FFFFFF;stroke-width:6;stroke-miterlimit:10;}

.ninja-status.play {
  .eyes {
    animation: eye-move 4s ease infinite;
  }
  .eye-slot {
    animation: slot-move 4s ease infinite;
  }
  .mouth {
    transform-origin: 150px 150px;
    animation: mouth-move 4s ease infinite;
  }
  .bust {
    transform-origin: 140px 70px;
    animation: bust-move 4s ease infinite;
  }
}
.ninja-status.play .eye-slot {
  animation: slot-move 4s ease infinite;
}
@keyframes eye-move {
  5% {transform: translateX(60px)}
  49% {transform: translateX(60px)}
}
@keyframes slot-move {
  5% {transform: translateX(-20px)}
  49% {transform: translateX(-20px)}
}
@keyframes mouth-move {
  5% {transform: rotate(20deg) translate(20px); stroke-dasharray: 50px 50px; stroke-dashoffset: 20px;}
  49% {transform: rotate(20deg) translate(20px); stroke-dasharray: 50px 50px; stroke-dashoffset: 20px;}
  100% { stroke-dasharray: 50px 50px; stroke-dashoffset: 2px;}
}
@keyframes bust-move {
  5% {transform: rotate(30deg) translate(20px)}
  49% {transform: rotate(30deg) translate(20px)}
}

// Hero
.h-st0{fill:$highlight-30;} 
.h-st1{fill:none;stroke:$base-color;stroke-width:15;stroke-miterlimit:10;} 
.h-st2{fill:#FFFFFF;} 
.h-st3{fill:$base-color;} 
.h-st4{fill:none;stroke:$base-color;stroke-width:7;stroke-miterlimit:10;} 
.cape{fill:none;stroke:$base-color;stroke-width:12;stroke-miterlimit:10;} 
.h-st6{fill:none;stroke:$base-color;stroke-width:12.6533;stroke-miterlimit:10;}
 
.helpful-hero.play .cape {
  animation: cape-move .8s cubic-bezier(.02,.29,.05,.91) infinite;
}
.cape-trim {
  fill:$base-color;
  stroke-width:11;
  stroke-miterlimit:10;
  transform-origin: 50% 0;
} 
.play .h-st3 {
  animation: trim-move .8s ease infinite;
}
.play .cape-trim {
  animation: capetrim-move .8s ease infinite;
}


@keyframes cape-move {
  80% {transform: translateY(-8px)}
}
@keyframes trim-move {
  50% {transform: translateY(2px)}
}
@keyframes capetrim-move {
  50% {transform: scaleX(1.5)}
}

              
            
!

JS

              
                $(".badge").click(function(){
  $(this).toggleClass("play");
});
              
            
!
999px

Console