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 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

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.

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

              
                    <div class="atropos my-atropos">
        <!-- scale container (required) -->
        <div class="atropos-scale">
          <!-- rotate container (required) -->
          <div class="atropos-rotate">
            <!-- inner container (required) -->
            <div class="atropos-inner">
              <div class="container">
                  <h1>Fatal Intensity</h1>
                  <p>Est, praesent fringilla sit lorem ipsum id. Non nulla eget donec neque bibendum. Luctus purus ullamcorper a commodo ut lectus.</p>
                <footer>
                    <div class="cta">
                        
                        <a href="#" class="share">
                            <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M2.25 9C2.25 10.2405 3.2595 11.25 4.5 11.25C5.0955 11.25 5.634 11.0138 6.03675 10.635L10.53 13.203C10.5165 13.3005 10.5 13.398 10.5 13.5C10.5 14.7405 11.5095 15.75 12.75 15.75C13.9905 15.75 15 14.7405 15 13.5C15 12.2595 13.9905 11.25 12.75 11.25C12.1545 11.25 11.616 11.4862 11.2133 11.865L6.72 9.29775C6.7335 9.1995 6.75 9.102 6.75 9C6.75 8.898 6.7335 8.8005 6.72 8.70225L11.2133 6.135C11.616 6.51375 12.1545 6.75 12.75 6.75C13.9905 6.75 15 5.7405 15 4.5C15 3.2595 13.9905 2.25 12.75 2.25C11.5095 2.25 10.5 3.2595 10.5 4.5C10.5 4.602 10.5165 4.6995 10.53 4.79775L6.03675 7.365C5.622 6.97101 5.07205 6.75092 4.5 6.75C3.2595 6.75 2.25 7.7595 2.25 9Z" fill="#2B3F56"/>
                            </svg>
                                
                            Share
                        </a>
                    </div>
                    <p class="date">October 19, 2021</p>
                </footer>
                </div>
            </div>
          </div>
        </div>
      </div>
    
              
            
!

CSS

              
                body {
  background: #B0BFD1;
  margin: 0;
  height: 100vh;
  display: -ms-grid;
  display: grid;
  -ms-flex-line-pack: center;
      align-content: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  font-family: 'Poppins';
}

h1 {
  -webkit-transform: translateX(-90px);
          transform: translateX(-90px);
  font-size: 2.4rem;
  white-space: nowrap;
  margin-top: 0;
  -webkit-transition: -webkit-transform .7s;
  transition: -webkit-transform .7s;
  transition: transform .7s;
  transition: transform .7s, -webkit-transform .7s;
}

img {
  width: 100%;
}

.my-atropos {
  width: 320px;
  background: white url("https://assets.codepen.io/2621168/img_1.jpg") no-repeat 100% -300px;
}

.atropos-scale, .atropos-rotate, .atropos-inner, .container {
  overflow: visible;
  position: relative;
}

.container {
  padding: 2em;
  position: relative;
  z-index: 1;
}

.container:before {
  position: absolute;
  content: '';
  height: 100%;
  width: 100%;
  border: 1px solid black;
  margin-left: -4em;
  margin-top: -4em;
  -webkit-clip-path: polygon(0 0, 0 0, 0 0, 0 0);
          clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  -webkit-transition: -webkit-clip-path .3s;
  transition: -webkit-clip-path .3s;
  transition: clip-path .3s;
  transition: clip-path .3s, -webkit-clip-path .3s;
}

.add-border.container:before {
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
          clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
}

footer {
  margin-top: 5em;
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: (auto)[2];
      grid-template-columns: repeat(2, auto);
}

footer a {
  text-decoration: none;
  background: #DAE3EE;
  font-weight: bold;
  color: #2B3F56;
  display: inline-block;
  text-align: center;
  padding: .5em 1em;
  border-radius: .3em;
}

footer svg {
  -webkit-transform: translateY(3px);
          transform: translateY(3px);
  margin-right: .2em;
}

footer .date {
  color: #47586C;
  font-size: .8rem;
  text-align: right;
}
/*# sourceMappingURL=main.css.map */
              
            
!

JS

              
                
        let title = document.querySelector('h1');
        let container = document.querySelector('.container');

        const myAtropos = Atropos({
            el: '.my-atropos',
            activeOffset: 40,
            shadow: false,
            highlight: false,
            shadowScale: 1.05,
            rotateXMax: 20,
            rotateYMax: 20,
            onEnter() {
                title.style.transform = 'scale(1.15) translateX(-90px)';
                container.classList.add('add-border');
            },
            onLeave() {
                title.style.transform = 'scale(1) translateX(-90px)';
                container.classList.remove('add-border');
            },
            onRotate(x, y) {
                console.log('Rotate', x, y);
            }
        });
              
            
!
999px

Console