Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="wrap">
        <div id="demo">
            <div id="panorama">
                <div class="face f1"></div>
                <div class="face f2"></div>
                <div class="face f3">
                </div>
                <div class="face f4">
                    <div class="label" id="l1">
                        Public Library
                        <hr />
                    </div>
                </div>
                <div class="face f5">
                    <div class="label" id="l2">
                        Hospital
                        <hr />
                    </div>
                </div>
                <div class="face f6">
                    <div class="label" id="l3">
                        Middle school
                        <hr />
                    </div>
                </div>
            </div>
        </div>
    </div>
              
            
!

CSS

              
                html, body {
            height: 100%; width: 100%;
        }
        body {
            margin: 0;
            background: #FFF;
        }
        .wrap {
            position: absolute;
            top: 50%; left: 50%;
            height: 400px; width: 400px;
            margin: -240px 0 0 -240px;
            background: #F0F0F0;
            padding: 40px;
            box-shadow: 0 0 3px #DDD;
            border-radius: 3px;
            overflow: hidden;
        }
        #demo {
            height: 100%; width: 100%;
            overflow: hidden;
            position: relative;

            -webkit-perspective: 300px;
               -moz-perspective: 300px;
                    perspective: 300px;
            -webkit-user-select: none;
               -moz-user-select: none;
                    user-select: none;
        }
        #panorama, #panorama .face {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            -webkit-transform-style: preserve-3d;
               -moz-transform-style: preserve-3d;
                    transform-style: preserve-3d;
        }
        #panorama .face, .label {
            -webkit-backface-visibility:hidden;
               -moz-backface-visibility:hidden;
                    backface-visibility:hidden;
        }
        #panorama .face {
            background-image: url("https://labs-ks.netlify.app/panorama.jpg");
        }
        #panorama .face:nth-child(1) {
            background-position: 0 0;
            -webkit-transform: rotateX(90deg) translateZ(-199px);
               -moz-transform: rotateX(90deg) translateZ(-199px);
                    transform: rotateX(90deg) translateZ(-199px);
        }
        #panorama .face:nth-child(2) {
            background-position: -400px 0;
            -webkit-transform: rotateX(-90deg) translateZ(-199px);
               -moz-transform: rotateX(-90deg) translateZ(-199px);
                    transform: rotateX(-90deg) translateZ(-199px);
        }
        #panorama .face:nth-child(3) {
            background-position: -800px 0;
            -webkit-transform: rotateY(90deg) translateZ(-199px);
               -moz-transform: rotateY(90deg) translateZ(-199px);
                    transform: rotateY(90deg) translateZ(-199px);
        }
        #panorama .face:nth-child(4) {
            background-position: 0 -400px;
            -webkit-transform: rotateY(-90deg) translateZ(-199px);
               -moz-transform: rotateY(-90deg) translateZ(-199px);
                    transform: rotateY(-90deg) translateZ(-199px);

        }
        #panorama .face:nth-child(5) {
            background-position: -400px -400px;
            -webkit-transform: translateZ(-199px);
               -moz-transform: translateZ(-199px);
                    transform: translateZ(-199px);
        }
        #panorama .face:nth-child(6) {
            background-position: -800px -400px;
            -webkit-transform: rotateY(180deg) translateZ(-199px);
               -moz-transform: rotateY(180deg) translateZ(-199px);
                    transform: rotateY(180deg) translateZ(-199px);
        }

        .label {
            position: absolute;
            color: #FFF;
            font-size: 16px;
            text-shadow: 1px 1px 2px #000;
            padding: 3px 3px 3px 0;
            font-style: italic;
        }
        .label:before, .label hr {
            position: absolute;
            left: 0; bottom: 0;
            height: 2px;
            background: #FFF;
        }
        .label:before {
            content: '';
            width: 100%;
            box-shadow: 1px 1px 2px rgba(0,0,0,.50);
        }
        .label hr {
            margin: 0; border: 0;
            box-shadow: 1px -1px 2px rgba(0,0,0,.50);
            -webkit-transform: rotate(110deg);
               -moz-transform: rotate(110deg);
                    transform: rotate(110deg);
            -webkit-transform-origin: 1px 1px;
               -moz-transform-origin: 1px 1px;
                    transform-origin: 1px 1px;
        }
        .label hr:before {
            content: '';
            position: absolute;
            right: -3px; top: -3px;
            height: 8px; width: 8px;
            background: #FFF;
            border-radius: 4px;
            box-shadow: 1px -1px 2px rgba(0,0,0,.50);
        }

        #l1 {
            left: 140px; bottom: 30px;
            -webkit-transform: translateZ(50px);
               -moz-transform: translateZ(50px);
                    transform: translateZ(50px);
        }
        #l1 hr {width: 30px;}

        #l2 {
            left: 190px; bottom: 70px;
            -webkit-transform: translateZ(70px);
               -moz-transform: translateZ(70px);
                    transform: translateZ(70px);
        }
        #l2 hr {width: 70px;}

        #l3 {
            left: 190px; bottom: 50px;
            -webkit-transform: translateZ(30px);
               -moz-transform: translateZ(30px);
                    transform: translateZ(30px);
        }
        #l3 hr {width: 50px;}
              
            
!

JS

              
                window.requestAnimFrame = (function() {
            return  window.requestAnimationFrame       ||
                    window.webkitRequestAnimationFrame ||
                    window.mozRequestAnimationFrame    ||
                    function(callback) {
                        window.setTimeout(callback, 1000 / 60);
                    };
        })();


        var Demo = {

            loaded: 0,
            drag: false,
            speed: 0.5,
            brake: 1,
            r: 0,

            Down: function(e) {
                Demo.o = Demo.r;
                Demo.x = Demo.r + e.clientX;
                Demo.drag = true;
                Demo.time = new Date();
            },

            Move: function(e) {
                if (Demo.drag) {
                    Demo.r = Demo.x - e.clientX;
                    Demo.p.style.webkitTransform = 'rotateY(' + Demo.r * 180 / 400 + 'deg)';
                    Demo.p.style.mozTransform = 'rotateY(' + Demo.r * 180 / 400 + 'deg)';
                    Demo.p.style.transform = 'rotateY(' + Demo.r * 180 / 400 + 'deg)';
                }
            },

            Up: function() {
                if (Demo.drag) {
                    var time = new Date() - Demo.time;
                    var path = Demo.r - Demo.o;
                    Demo.speed = path / time * 5;
                    Demo.brake = 1.01;
                    Demo.drag = false;
                }
            },

            Spin: function() {
                if (!Demo.drag) {
                    Demo.r += Demo.speed;
                    Demo.speed /= Demo.brake;
                    Demo.p.style.webkitTransform = 'rotateY(' + Demo.r * 180 / 400 + 'deg)';
                    Demo.p.style.mozTransform = 'rotateY(' + Demo.r * 180 / 400 + 'deg)';
                    Demo.p.style.transform = 'rotateY(' + Demo.r * 180 / 400 + 'deg)';
                }
                window.requestAnimFrame(Demo.Spin);
            },

            Bind: function() {
                Demo.e.addEventListener('mousedown', Demo.Down, false);
                Demo.e.addEventListener('mousemove', Demo.Move, false);
                Demo.e.addEventListener('mouseup', Demo.Up, false);
                Demo.e.addEventListener('mouseleave', Demo.Up, false);
                window.requestAnimFrame(Demo.Spin);
            },

            Init: function() {
                Demo.e = document.getElementById('demo');
                Demo.p = document.getElementById('panorama');
                Demo.l = document.getElementById('loader');
                Demo.Bind();
            }
        };


        document.addEventListener('DOMContentLoaded', Demo.Init, false);
              
            
!
999px

Console