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

              
                <svg class="svg-mask">
 <defs>
  <mask id="mask1" maskUnits=" objectBoundingBox" maskContentUnits=" objectBoundingBox">
   <linearGradient id="grad" gradientUnits="objectBoundingBox" x2="0" y2="1">
    <stop stop-color="white" offset="0"/>
    <stop stop-color="white" offset="1"stop-opacity="0.5" />
    <stop stop-color="white" stop-opacity="1" offset="1"/>
   </linearGradient>
    <g transform="translate(150 195) scale(1)">
        <path d="M0 -100 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -100 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100" fill="url(#grad)" stroke="white" stroke-width="8" stroke-linejoin="round" stroke-linecap="round">
          <animate dur="1.5s" repeatCount="indefinite" attributeName="d" 
                   keyTimes="0; 0.2; 1"
                   values="
      M0 -120 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -120 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100; M0 -125 C-45 -180 -115 -140 -115 -100 C-115 -30 -25 -30 0 90 M0 -125 C45 -180 115 -140 115 -100 C115 -30 25 -30 0 90; M0 -120 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -120 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100">
            
            
         </animate>

        </path>
  
    </g>
<!--    <circle cx="0.50" cy="0.5" r="0.5" id="circle" fill="url(#grad)"/> -->
<!--     <rect width="100" height="100" fill="#fff" /> -->
<!--     <polygon id="Star-1" points="98.4999978 153.75 38.2520165 185.424245 49.7583542 118.337123 1.01670635 70.8257603 68.3760155 61.037872 98.5000012 1.1379786e-14 128.624005 61.0378871 195.98331 70.8258091 147.241642 118.337136 158.747982 185.424247" fill="url(#grad)"/> -->
          
  </mask>
 </defs>
</svg>

<svg class="masked-element" width="300" height="300" viewBox="0 0 300 400">
  <g transform="translate(-70 -50) scale(1.5)">
 <image xlink:href="https://s3.eu-west-2.amazonaws.com/website-mj/ra.jpg" width="300" height="300" />
</svg>
  </g>

<!-- <svg class="svg-defs">
  <defs>
        <mask id="clipping" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox">
          <polygon id="Star-1" points="98.4999978 153.75 38.2520165 185.424245 49.7583542 118.337123 1.01670635 70.8257603 68.3760155 61.037872 98.5000012 1.1379786e-14 128.624005 61.0378871 195.98331 70.8258091 147.241642 118.337136 158.747982 185.424247"/>
          
        </mask>
    <mask id="clipping2" />
        <g transform="translate(180 180)">
        <path d="M0 -100 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -100 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100" fill="red" stroke="red" stroke-width="3" >
          <animate dur="1.5s" repeatCount="indefinite" attributeName="d" 
                   keyTimes="0; 0.2; 1"
                   values="
      M0 -120 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -120 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100; M0 -125 C-45 -180 -115 -140 -115 -100 C-115 -30 -25 -30 0 90 M0 -125 C45 -180 115 -140 115 -100 C115 -30 25 -30 0 90; M0 -120 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -120 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100">
            
            
         </animate>

        </path>
  
    </g>
    </mask>
  </defs>
</svg>

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 400 400" width="400" height="400" version="1.0">
    <g transform="translate(180 180)">
        <path d="M0 -100 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -100 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100" fill="red" stroke="red" stroke-width="3" >
          <animate dur="1.5s" repeatCount="indefinite" attributeName="d" 
                   keyTimes="0; 0.2; 1"
                   values="
      M0 -120 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -120 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100; M0 -125 C-45 -180 -115 -140 -115 -100 C-115 -30 -25 -30 0 90 M0 -125 C45 -180 115 -140 115 -100 C115 -30 25 -30 0 90; M0 -120 C-35 -180 -100 -150 -100 -100 C-100 -50 -25 0 0 100 M0 -120 C35 -180 100 -150 100 -100 C100 -50 25 0 0 100">
            
            
         </animate>

        </path>
  
    </g>
</svg>
 -->
              
            
!

CSS

              
                body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-width: 100vw;
}

img {
  width: 500px;
  clip-path: url(#clipping2);  
}

.svg-mask {
  width: 0px;
  height: 0px;
  opacity: 0;

}

.masked-element image {
  mask: url(#mask1);
  
}
.masked-element {
  min-height: 300px;
  min-width: 300px;
  height: 50vh;
  width: 50vh;
}

svg {
  // border: 1px solid black;
}





              
            
!

JS

              
                
              
            
!
999px

Console