Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<html>
  <body>
    <h1>Simple wheel rotation with SVG and SMIL</h1>
    <p>In this sample you see a simple wheel which I have constructed with <a href="http://o4f.de/adse" target="_blank"><em>Affinity Designer and export it to SVG</em></a>.<br></p>
    <div id="wrapper" style="width:800px;margin-left:auto;margin-right:auto;">
      <div>
      <ul>
        <li>On the left you see the wheel with no animation.</li>
        <li>In the middel the wheel rotates around the exact center.</li>
        <li>On the right the wheel rotates a bit outside of its center.</li>
      </ul>
      </div>
      <div class="container">
      <center>  
      <svg width="170" height="170" viewBox="0 0 178 178" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-miterlimit:1.41421;">
      <g id="wheel">

        <circle cx="84.687" cy="84.687" r="84.687" style="fill:#000;"/>
        <circle cx="84.687" cy="84.687" r="52.527" style="fill:#f6f6f6;"/>
        <circle cx="84.687" cy="84.687" r="39.664" style="fill:#fff;stroke-width:1px;stroke:#58585a;"/>
        <g>
          <circle cx="84.687" cy="84.687" r="39.664" style="fill:#d9dadb;"/>
          <circle cx="84.687" cy="84.687" r="39.664" style="fill:none;stroke-width:2px;stroke-dasharray:31.14,31.14;stroke:#58585a;"/>
        </g>
        <circle cx="84.687" cy="84.687" r="33.231" style="fill:url(#_Radial1);stroke-width:0.25px;stroke:#c6c7c8;"/>
        <path d="M52.225,91.715c-3.973,-17.919 7.333,-35.664 25.251,-39.637c17.919,-3.973 35.664,7.332 39.637,25.251l-64.888,14.386Z" style="fill:#f6f6f6;fill-rule:nonzero;"/>
        <circle cx="84.687" cy="84.687" r="16.08" style="fill:#fff;"/>
        <circle cx="84.687" cy="84.687" r="16.08" style="fill:url(#_Radial2);"/>
        <circle cx="84.687" cy="84.687" r="9.52" style="fill:none;stroke-width:0.15px;stroke:#eceded;stroke-opacity:0.31;"/>
        <path d="M75.814,81.143l8.873,13.026l8.836,-13.026l-8.836,6.703l-8.873,-6.703Z" style="fill:#eceded;fill-rule:nonzero;"/>
        <path d="M75.814,81.143l8.873,13.026l8.836,-13.026l-8.836,9.703l-8.873,-9.703Z" style="fill:#d9dadb;fill-rule:nonzero;"/>
      </g>
      <defs>
        <radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(60.2574,0,0,60.2574,82.9629,93.3584)">
          <stop offset="0%" style="stop-color:#000;stop-opacity:1"/>
          <stop offset="100%" style="stop-color:#000;stop-opacity:0"/>
        </radialGradient>
        <radialGradient id="_Radial2" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(16.9437,0,0,16.9437,84.6865,84.6865)">
          <stop offset="0%" style="stop-color:#000;stop-opacity:0.94902"/>
          <stop offset="92%" style="stop-color:#000;stop-opacity:0.65098"/>
          <stop offset="97%" style="stop-color:#000;stop-opacity:0"/>
          <stop offset="100%" style="stop-color:#000;stop-opacity:0"/>
        </radialGradient>
      </defs>
      </svg>
      </center>
      </div>
      <!--    rotation in the center of the wheel -->
    <div class="container">
      <center>
      <svg width="170" height="170" viewBox="0 0 178 178" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-miterlimit:1.41421;">
      <g id="wheel">

        <circle cx="84.687" cy="84.687" r="84.687" style="fill:#000;"/>
        <circle cx="84.687" cy="84.687" r="52.527" style="fill:#f6f6f6;"/>
        <circle cx="84.687" cy="84.687" r="39.664" style="fill:#fff;stroke-width:1px;stroke:#58585a;"/>
        <g>
          <circle cx="84.687" cy="84.687" r="39.664" style="fill:#d9dadb;"/>
          <circle cx="84.687" cy="84.687" r="39.664" style="fill:none;stroke-width:2px;stroke-dasharray:31.14,31.14;stroke:#58585a;"/>
        </g>
        <circle cx="84.687" cy="84.687" r="33.231" style="fill:url(#_Radial1);stroke-width:0.25px;stroke:#c6c7c8;"/>
        <path d="M52.225,91.715c-3.973,-17.919 7.333,-35.664 25.251,-39.637c17.919,-3.973 35.664,7.332 39.637,25.251l-64.888,14.386Z" style="fill:#f6f6f6;fill-rule:nonzero;"/>
        <circle cx="84.687" cy="84.687" r="16.08" style="fill:#fff;"/>
        <circle cx="84.687" cy="84.687" r="16.08" style="fill:url(#_Radial2);"/>
        <circle cx="84.687" cy="84.687" r="9.52" style="fill:none;stroke-width:0.15px;stroke:#eceded;stroke-opacity:0.31;"/>
        <path d="M75.814,81.143l8.873,13.026l8.836,-13.026l-8.836,6.703l-8.873,-6.703Z" style="fill:#eceded;fill-rule:nonzero;"/>
        <path d="M75.814,81.143l8.873,13.026l8.836,-13.026l-8.836,9.703l-8.873,-9.703Z" style="fill:#d9dadb;fill-rule:nonzero;"/>
        <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="360,84.687,84.687" to="0,84.687,84.687" begin="0s" dur="0.6s" repeatCount="indefinite"/>
      </g>
      <defs>
        <radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(60.2574,0,0,60.2574,82.9629,93.3584)">
          <stop offset="0%" style="stop-color:#000;stop-opacity:1"/>
          <stop offset="100%" style="stop-color:#000;stop-opacity:0"/>
        </radialGradient>
        <radialGradient id="_Radial2" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(16.9437,0,0,16.9437,84.6865,84.6865)">
          <stop offset="0%" style="stop-color:#000;stop-opacity:0.94902"/>
          <stop offset="92%" style="stop-color:#000;stop-opacity:0.65098"/>
          <stop offset="97%" style="stop-color:#000;stop-opacity:0"/>
          <stop offset="100%" style="stop-color:#000;stop-opacity:0"/>
        </radialGradient>
      </defs>
      </svg>
      </center>    
    </div>
<!--    rotation a bit outside the center -->
    <div class="container">
    <center>  
      <svg width="170" height="170" viewBox="0 0 178 178" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-miterlimit:1.41421;">
      <g id="wheel">

        <circle cx="84.687" cy="84.687" r="84.687" style="fill:#000;"/>
        <circle cx="84.687" cy="84.687" r="52.527" style="fill:#f6f6f6;"/>
        <circle cx="84.687" cy="84.687" r="39.664" style="fill:#fff;stroke-width:1px;stroke:#58585a;"/>
        <g>
          <circle cx="84.687" cy="84.687" r="39.664" style="fill:#d9dadb;"/>
          <circle cx="84.687" cy="84.687" r="39.664" style="fill:none;stroke-width:2px;stroke-dasharray:31.14,31.14;stroke:#58585a;"/>
        </g>
        <circle cx="84.687" cy="84.687" r="33.231" style="fill:url(#_Radial1);stroke-width:0.25px;stroke:#c6c7c8;"/>
        <path d="M52.225,91.715c-3.973,-17.919 7.333,-35.664 25.251,-39.637c17.919,-3.973 35.664,7.332 39.637,25.251l-64.888,14.386Z" style="fill:#f6f6f6;fill-rule:nonzero;"/>
        <circle cx="84.687" cy="84.687" r="16.08" style="fill:#fff;"/>
        <circle cx="84.687" cy="84.687" r="16.08" style="fill:url(#_Radial2);"/>
        <circle cx="84.687" cy="84.687" r="9.52" style="fill:none;stroke-width:0.15px;stroke:#eceded;stroke-opacity:0.31;"/>
        <path d="M75.814,81.143l8.873,13.026l8.836,-13.026l-8.836,6.703l-8.873,-6.703Z" style="fill:#eceded;fill-rule:nonzero;"/>
        <path d="M75.814,81.143l8.873,13.026l8.836,-13.026l-8.836,9.703l-8.873,-9.703Z" style="fill:#d9dadb;fill-rule:nonzero;"/>
        <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="360,85.5,85.5" to="0,85,85" begin="0s" dur="0.6s" repeatCount="indefinite"/>
      </g>
      <defs>
        <radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(60.2574,0,0,60.2574,82.9629,93.3584)">
          <stop offset="0%" style="stop-color:#000;stop-opacity:1"/>
          <stop offset="100%" style="stop-color:#000;stop-opacity:0"/>
        </radialGradient>
        <radialGradient id="_Radial2" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(16.9437,0,0,16.9437,84.6865,84.6865)">
          <stop offset="0%" style="stop-color:#000;stop-opacity:0.94902"/>
          <stop offset="92%" style="stop-color:#000;stop-opacity:0.65098"/>
          <stop offset="97%" style="stop-color:#000;stop-opacity:0"/>
          <stop offset="100%" style="stop-color:#000;stop-opacity:0"/>
        </radialGradient>
      </defs>
      </svg>
    </center>
    </div>
    </div>
    </br>
    <p style="clear:both;padding-top:20px">To see this wheel in action on a nice old volvo car in a Swedish environment follow this link: <a href="http://o4f.de/vdani" target="_blank">Volvo Duett - P210</a></p>
  </html>
</html>
              
            
!

CSS

              
                body{
  background-color:#8F8F8F;
}
h1{
  color:#CCC;
  font-family: sans-serif;
  font-weight: 200;
  text-align: center;
}
h2{
  font-size: 1.8em;
}
p{
  color:#EEE;
  font-family: sans-serif;
  font-weight: 100;
  text-align: center;
  font-size: 1em;
}

li{
  color:#EEE;
  font-family: sans-serif;
  font-weight: 100;
  font-size: 1em;
  padding-left: 5px;
  margin-left: 25px;
}


a{
  color: #fff;
  text-decoration: none;
}
a:hover{
  background-color: #fff;
  color: #8F8F8F;
  text-decoration: none;
  padding-left: 3px;
  padding-right: 3px;
}
.container{
  width: 220px;
  height: 185px;
  margin-left: 20px;
  padding-top: 15px;
  background-color: #888888;
  font-family: sans-serif;
  border: 2px solid #999999;
  border-radius: 10px;
  float: left;
}
              
            
!

JS

              
                
              
            
!
999px

Console