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" encoding="utf-8"?>
<svg viewBox="0 0 160 160" width="300" height="300">
  <defs>
    <clipPath id="svgPath">
      <path d="M122.4,55.5C108.9,32.1,78.9,24,55.5,37.6S24,81.1,37.6,104.5L122.4,55.5L160,0v160H0V0h160L122.4,55.5z">     
      </path>
    </clipPath>
    
    <linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="0%">
      <stop offset="0%" stop-color="blue"></stop>
      <stop offset="100%" stop-color="pink"></stop>
    </linearGradient>
  </defs>
  
  <circle cx="80" cy="80" r="49" fill="url(#gradient)">
    <animateTransform 
      attributeName="transform" 
      type="rotate" 
      from="360 80 80" to="0 80 80" 
      dur="4s" 
      repeatCount="indefinite">
    </animateTransform>
  </circle>
  
  <g style="clip-path: url(#svgPath);">
    
    <g id="inner" transform="matrix(0.866, -0.5, 0.25, 0.433, 80, 80)">
    
      <path d="M 0,70 A 65,70 0 0,0 65,0 5,5 0 0,1 75,0 75,70 0 0,1 0,70Z" fill="#FFF">
      
      <animateTransform 
        attributeName="transform" 
        type="rotate" 
        from="360 0 0"
        to="0 0 0" 
        dur="4s" 
        repeatCount="indefinite">
      </animateTransform>
    </path>
    </g>
  </g>
</svg>
              
            
!

CSS

              
                body {  background:lightblue;
}
              
            
!

JS

              
                /* Upgraded version of Gabriel's "Orbit" SVG Animation

Original: https://codepen.io/guerreiro/pen/obhzc
Gabriel's Codepen profile: https://codepen.io/guerreiro/

About this version's upgrade:
The original made clever use of the transform: matrix() function by making the 'whisp' appear to be on a 3D plane, orbiting around a percieved sphere/circle. 

It made use of a top layer semi-circle <path> to obscure part of the rotation giving us the clever effect that the 'whisp' is passing behind the sphere/circle. This unfortunatly restricted styling to block colour use for the main base circle.

I've reversed the semi-circle masking overlay <path> to a <clipPath> opposite. It now clips the animated 'whisp' and hides it when it passes through the clipPath hole that was made using a zero width tunnel technique documented here: https://css-tricks.com/cutting-inner-part-element-using-clip-path/

A better explantion can be seen on my website at: https://wraxton.com
 

*/
              
            
!
999px

Console