Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <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>
 -->
            
          
!
            
              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;
}





            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console