Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              <div class="content-box">
  <h1>Hover over left and right arrow to see effect</h1>
  <div class="container cont-example-bg">
    <div class="hover left sign-img">
    </div>
    <div class="hover right sign-img"></div>
  </div>

  <p><img src="https://i2.wp.com/francoismarais.com/wp-content/uploads/2020/01/bg-t-1.png?w=602" alt="sign image without split" width="300"></p>
  <p class="caption">Image without effect</p>
  <p>Photo by <a href="https://www.pexels.com/@pixabay?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pixabay</a> from <a href="https://www.pexels.com/photo/art-background-brick-brick-texture-272254/?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels">Pexels</a>
  </p>

  <p>The effect uses a single image and dynamicly "splits" it into two sections. We then apply an animation to get a fake "3d" effect.</p>

  <p>created by <a href="https://francoismarais.com">Francois Marais</a></p>
</div>
            
          
!

CSS

            
              .content-box {
  color: #fff;
  font-family: "Roboto", sans-serif;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(to bottom, rgb(54, 44, 70), rgb(97, 79, 138));
  padding: 1em 0em;
}

.container {
  height: 300px;
  width: 100%;
  max-width: 602px;
  display: inline-block;
  position: relative;
}

.circle-clip {
  clip-path: circle(210px at center);
}

.left,
.right {
  height: 100%;
  position: absolute;
  width: 100%;
  perspective: 150px;
  transform-style: preserve-3d;
  transform: scaleX(0.88) scaleY(0.95);
}

.left {
  perspective-origin: left center;
  clip-path: polygon(0% 0%, 50% 0%, 50% 100%, 0% 100%);
}

.right {
  perspective-origin: right center;
  clip-path: polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%);
  margin-left: -1px;
}

.left::before,
.right::before {
  content: "";
  background-size: auto;
  background-position-y: 50%;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  background-size: cover;
  transition: transform 0.5s ease-in-out;
}

.sign-img {
  transform: scale(.8);
}

.sign-img::before {
  background: url("https://i2.wp.com/francoismarais.com/wp-content/uploads/2020/01/bg-t-1.png?w=602");
  background-position: 50%;
  background-size: cover;
  background-position: center bottom;
}

.animated.left::before {
  animation: left-side 1.2s ease-in-out infinite;
  -webkit-animation: left-side 1.2s ease-in-out infinite;
  animation-direction: alternate;
}

.animated.right::before {
  animation: right-side 1.2s ease-in-out infinite;
  -webkit-animation: right-side 1.2s ease-in-out infinite;
  animation-direction: alternate;
}

.hover.left:hover::before {
  transform: rotateY(-3deg) scaleX(0.8);
}

.hover.right:hover::before {
  transform: rotateY(3deg) scaleX(0.8);
}

@keyframes left-side {
  0% {
    transform: rotateY(-3deg) scaleX(0.8);
  }

  100% {
    transform: rotateY(0deg) scaleX(1);
  }
}

@keyframes right-side {
  0% {
    transform: rotateY(0deg) scaleX(1);
  }

  100% {
    transform: rotateY(3deg) scaleX(0.8);
  }
}

a {
  color: #fffb00;
}
.caption {
  font-style: italic;
  font-size: 0.8em;
}

            
          
!

JS

            
              
            
          
!
999px

Console