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 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

              
                <div id="container">
  <div id="icon">
    <svg viewBox="0 0 180 180">
  <g
     style="display:none"
     id="layer2" />
  <path
     id="triangle"
     d="M 68.384736,134.79292 H 111.18677 L 90.105166,79.825899 Z"
     style="fill:none;stroke:#000000;stroke-width:3.2692914;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
  <g
     style="display:inline"
     id="move">
    <rect
       transform="rotate(0.5)"
       y="42.294559"
       x="39.567299"
       height="28.499998"
       width="28.5"
       id="black"
       style="stroke-width:3.26929116;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:stroke fill markers" />
    <rect
       transform="rotate(0.5)"
       y="44.302197"
       x="116.20583"
       height="21.795811"
       width="21.795813"
       id="empty"
       style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:6.67086601;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
  <path
     id="bottom"
     d="M 41.608981,77.976802 C 140.17896,77.94711 138.82814,77.78509 138.82814,77.78509 v 0"
     style="fill:none;stroke:#000000;stroke-width:2.51338577;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
  </g>
</svg>

  </div>
  <div id="gif"><img src="https://airbnb.design/anotherlens/img/balance.gif" alt="Balance">
  </div>
  <div>
    <p>SVG</p>
  </div>
  <div>
    <p>Original gif</p>
  </div>
</div>
              
            
!

CSS

              
                #container
  display: grid
  grid-template-columns: repeat(2, 1fr)
  margin: 0 auto
  width: 500px   
  text-align: center
  font-family: 'Roboto Condensed', sans-serif;

#icon
  margin: 0 auto
  position: relative

svg
  padding: 0
  margin: 0
  width: 200px
  height: 200px
 
#move
  animation: moves 2s linear infinite
  transform-origin: 50% 100% // works in chrome
  transform-origin: 90px 65px // works in FF - only absolute values in px
  animation-direction: alternate
  transform: rotate(-10deg) translate3d(0,0,0)

@keyframes moves {
0%, 10% {
  transform: rotate(-10deg);
}   
50% {
      transform: rotate(0deg);
   }
   90%, 100% {
      transform: rotate(10deg);
   }
 }

              
            
!

JS

              
                /*
Based on gif: https://airbnb.design/anotherlens/img/balance.gif
Blog post: https://airbnb.design/anotherlens/

Benefits:
- Speed and size can be manipulated
- Crisp at any size
*/
              
            
!
999px

Console