cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <h1> Overflow-based masking: aliasing artifact 1 </h1>
<!-- Mask and maskee. -->
<div class="container">
  <div id="Mask" class="mask large mask-active mask-anim">
    <div id="MaskContent" class="mask-intermediate mask-content-anim">
      <div data-content-type="text" class="content">
        <div class="text-background">
          <div class="text"> Example Text </div>
        </div>
      </div>
    </div>
  </div>

<!-- Reference content -->
  <div id="MaskOutline" class="mask"></div>
  <div class="reference">
    <div data-content-type="text" class="content">
      <div class="text-background">
        <div class="text"> Example Text </div>
      </div>
    </div>
  </div>
</div>

            
          
!
            
              /** Demo Settings */
body {
  font-family: sans-serif;
}

/** Mask styling. */
.container {
  position: absolute;
  transform-style: preserve-3d;
}

.mask {
  position: absolute;
  width: 200px;
  height: 200px;
  transform-style: preserve-3d;
  border-radius: 200px;
  overflow: hidden;
}

.mask-intermediate {
  transform-style: preserve-3d;
  position: absolute;
  width: 100%;
  height: 100%;
}


/** Maskee and reference content styling. */
.content {
  position: absolute;
  transform-style: preserve-3d;
}

.reference {
  position: absolute;
  left: 500px;
}

.text-background {
  position: absolute;
  width: 340px;
  height: 280px;
  background-color: #c4c4c4;
}

.text {
  position: absolute;
  left: 50px;
  top: 100px;
  font-size: 40px;
}

.mask-anim {
  animation: mask_keys 4s linear 0s infinite normal forwards;
  -moz-animation: mask_keys 4s linear 0s infinite normal forwards;
  -webkit-animation: mask_keys 4s linear 0s infinite normal forwards;
}

.mask-content-anim {
  animation: mask_content_keys 4s linear 0s infinite normal forwards;
  -moz-animation: mask_content_keys 4s linear 0s infinite normal forwards;
  -webkit-animation: mask_content_keys 4s linear 0s infinite normal forwards;
}

@keyframes mask_keys {
  0% {
    transform: translate3d(0px, 0px, 0px);
  }
  50% {
    transform: translate3d(100px, 100px, 0px);
  }
  100% {
    transform: translate3d(0px, 0px, 0px);
  }
}

@keyframes mask_content_keys {
  0% {
    transform: translate3d(0px, 0px, 0px);
  }
  50% {
    transform: translate3d(-100px, -100px, 0px);
  }
  100% {
    transform: translate3d(0px, 0px, 0px);
  }
}

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console