123

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.

            
              <div id="content">
    <h1>Lorem ipsum</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio maxime asperiores velit dolore quisquam, dicta numquam, nam optio ea odio vitae impedit cum illum vero.</p>
    <img src="https://habrastorage.org/files/fba/247/ebf/fba247ebfbca4cfe95fd55db33468be8.jpg" alt="" />
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda molestiae provident iste expedita eligendi animi dolorem maiores incidunt nobis. Ad neque voluptas quo dolorem a mollitia ratione ab laborum inventore!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta aut qui, neque fugit aliquid. Sit, consequuntur veniam magnam. Ut quo atque quasi neque distinctio eos sint maiores ea soluta repellat. Animi hic neque veritatis consequuntur sunt id magni ea? Quia dolorum iure, accusantium rem, iste culpa atque numquam magnam dicta illum facere sapiente corporis fuga facilis sint repellat temporibus libero voluptatibus doloremque at quos neque dolores labore cupiditate cumque. Distinctio quae eos, esse maiores, facere expedita maxime accusantium veritatis, consequatur quia, sequi quisquam. Ipsam optio iure alias. Iusto quasi rerum, optio placeat. Corporis ullam debitis harum beatae excepturi, ipsum omnis!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti quisquam est ratione illo reiciendis doloremque natus optio quaerat, explicabo quo cumque illum ab iste sint ducimus beatae hic molestiae voluptatem distinctio aliquid totam, quam, soluta. Maxime porro, ducimus facilis, esse quisquam nulla, eligendi quas commodi at vitae dignissimos sapiente eos?</p>
    <img src="https://habrastorage.org/files/fba/247/ebf/fba247ebfbca4cfe95fd55db33468be8.jpg" alt="" />
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sint nemo fugit error, ducimus, ipsam qui, ab perspiciatis omnis quod vitae iure itaque dignissimos culpa similique sequi beatae. Vero architecto error aliquam sunt minus qui inventore quidem quis accusantium, quos corporis iusto harum suscipit culpa doloribus laborum eligendi similique repellendus nulla optio nisi modi. Ipsum asperiores, nihil necessitatibus veritatis numquam, in delectus aut reiciendis nam id. Delectus vero quas, totam! Consequatur architecto maxime reiciendis cupiditate accusantium inventore, laborum necessitatibus commodi, praesentium, quod et nemo blanditiis odit. Hic voluptas quis, est ad quae eaque id labore, minima quas tempora sapiente harum. Rem.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Porro rem aspernatur, fuga quas officiis ipsa dolorem impedit quae fugit temporibus.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio laboriosam nemo enim maxime quae, pariatur deserunt aliquid ex non, doloremque unde illo explicabo vel magni repellendus velit, ut illum sapiente!</p>
</div>
<div id="mirror">
    <div id="mirror-content"></div>
</div>
<div id="mirror-2">
    <div id="mirror-content-2"></div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Ubuntu);

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0557A5;
    font: 400 1em / 1.2 Ubuntu;
    margin-bottom: 100px;
    min-width: 360px;
}

p + p {
    margin-top: 1em;
}

img {
    background: #ccc;
    margin: 1em auto;
    width: 100%;
}

#content,
#mirror,
#mirror-2 {
    background: #FFFFFF;
    box-shadow: 0 0 1em rgba(0, 0, 0, .3);
    padding: 1em;
    margin: 1em auto;
    width: 90%;
}

#mirror,
#mirror-2 {
    position: fixed;
    left: 5%;
    bottom: 0;
    height: 100px;
    max-height: 100px;
    overflow: hidden;
    opacity: .6;
    transform: perspective(150px) rotateX(210deg) scale(1.2);
    
    #mirror-content,
    #mirror-content-2 {
        margin-top: -100vh;
        transform: translateY(225px);
    }
}

#mirror-2 {
    bottom: -.5em;
    opacity: .1;
}
            
          
!
            
              document.getElementById('mirror-content').innerHTML = document.getElementById('content').innerHTML;

document.getElementById('mirror-content-2').innerHTML = document.getElementById('content').innerHTML;

$(window).on('scroll', function () {
    $('#mirror').scrollTop($(this).scrollTop());
    
    $('#mirror-2').scrollTop($(this).scrollTop());
});
            
          
!
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