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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <body class="app">
    <header class="header">
        <div class="header-content">
            <div class="topbar">
                <button class="icon-btn">
                    <svg width="24" height="24" viewBox="0 0 24 24">
                        <path d="M20 11h-12.17l5.59-5.59-1.42-1.41-8 8 8 8 1.41-1.41-5.58-5.59h12.17v-2z" />
                    </svg>
                </button>
                <div class="topbar-right">
                    <button class="icon-btn">
                        <svg viewBox="0 0 24 24">
                            <path d="M18 16.08c-.76 0-1.44.3-1.96.77l-7.13-4.15c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7l-7.05 4.11c-.54-.5-1.25-.81-2.04-.81-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"
                            />
                        </svg>
                    </button>
                    <button class="icon-btn">
                        <svg viewBox="0 0 24 24">
                            <path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
                        </svg>
                    </button>
                </div>
            </div>
            <div class="bottombar">
                <div class="playerbar">
                    <div class="player">
                        <span class="player-rank">4</span>
                        <h2 class="player-name">MegaMan</h2>
                    </div>
                    <div class="player">
                        <span class="player-rank">7</span>
                        <h2 class="player-name">Kirby</h2>
                    </div>
                </div>
                <div class="scorebar">
                    <div class="icon">
                        <svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" viewBox="0 0 250 250">
                            <path fill="white" d="M130.1 47.5c2.1 4.7 3.6 10 5.6 14.8 9.6 6.9 16.6-2.4 22.3-7.4 3.8 1.5 7 3.5 10.2 5.6-.9 5-1.7 10-2.8 14.8 1.2 4.1 4.7 5.8 7.4 8.4 5.6-.6 10.6-1.8 15.8-2.8 1.8 3.4 4.6 6 5.6 10.2-3.5 4-7.1 7.8-10.2 12.1 0 3.7 1.9 5.6 1.9 9.3 4.7 3 11.1 4.4 16.7 6.5v11.1c-5.9 1.5-10.6 4.2-16.7 5.6-4.8 11.3 3.1 16.1 8.4 22.3-1 4.2-3.8 6.8-5.6 10.2-9.4-2.8-19.9-4.3-23.2 4.6.7 5.4 1.9 10.4 2.8 15.8-3.2 2-6.4 4.1-10.2 5.6-4-3.5-7.8-7.1-12.1-10.2-4.6-.6-5.6 2.4-10.2 1.9-1.4 5.7-3.5 10.7-5.6 15.8h-11.1c-1.9-4.9-3.7-9.9-5.6-14.8-9.6-6.9-16.6 2.4-22.3 7.4-3.8-1.5-7-3.5-10.2-5.6 2.8-9.4 4.3-19.9-4.6-23.2-5.6.6-10.6 1.8-15.8 2.8-1.6-3.7-4.4-6.1-5.6-10.2 3.7-3.7 6.9-8 10.2-12.1 0-3.7-1.9-5.6-1.9-9.3-4.7-3-11.1-4.4-16.7-6.5v-11.1c5.9-1.5 10.6-4.2 16.7-5.6 4.7-11.2-3-16.2-8.4-22.3 1.5-3.8 3.5-7 5.6-10.2 4.6 1.3 10.3 1.5 14.8 2.8 4.1-1.2 5.8-4.7 8.4-7.4-1-5.2-1.6-10.8-2.8-15.8 3.2-2 6.4-4.1 10.2-5.6 3.9 3.5 8 6.9 12.1 10.2 3.7 0 5.6-1.9 9.3-1.9 4.7-6.4 2.5-19.7 17.6-15.8zm-23.2 69.6c-6.7 19.4 10.3 28.2 22.3 26 22.7-4.2 15.3-41.7-9.3-36.2-7.6 1.7-11.9 6.8-13 10.2z"
                            />
                        </svg>
                    </div>
                    <div class="score">
                        2 <span class="score-time">Final</span> <span class="score-winner">3</span>
                    </div>
                    <div class="icon">
                        <svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" viewBox="0 0 250 250">
                            <path d="M96.2 95.8c-8.4 2.6-16.9 5.1-25.2 8-5.6 2-11 4.5-16.4 7-1.9.9-3.7 2.3-5.3 3.7-2 1.8-2.4 3-.9 5.3 1.1 1.8 2.4 3.6 4 5 4.5 3.9 9 7.8 13.9 11.3 7.2 5.1 14.6 9.8 22 14.7-.1 8.8-.3 17.6-.1 26.4.2 5.9.9 11.9 1.6 17.8.3 2.1 1 4.2 1.9 6.1 1.1 2.4 2.2 3.2 4.8 2.5 2.1-.5 4.2-1.2 6-2.3 5.1-3.1 10.2-6.2 15-9.7 7.1-5.3 13.8-10.9 20.7-16.4v.2c8.3 2.8 16.7 5.8 25.1 8.3 5.7 1.7 11.6 2.8 17.4 4 2.1.4 4.3.3 6.4.1 2.7-.3 3.7-1.1 3.9-3.8.1-2.1.1-4.4-.3-6.4-1.4-5.8-2.7-11.6-4.6-17.2-2.8-8.3-6.1-16.5-9.2-24.8 5.2-7.1 10.6-14.1 15.6-21.3 3.4-4.9 6.3-10.1 9.1-15.3 1-1.8 1.6-4 2.1-6.1.5-2.6.1-3.8-2.4-4.8-2-.8-4.1-1.5-6.2-1.6-5.9-.5-11.9-1-17.8-.9-8.8.1-17.6.7-26.4 1.1v-.1c-5.1-7.2-10.1-14.4-15.5-21.4-3.6-4.7-7.7-9.1-11.8-13.4-1.4-1.5-3.3-2.8-5.1-3.8-2.3-1.3-3.6-1.3-5.3.8-1.4 1.6-2.7 3.4-3.5 5.4-2.3 5.5-4.6 11-6.3 16.7-2.6 8.4-4.8 17-7.1 25.5"/>
                        </svg>
                    </div>
                </div>
            </div>
        </div>
    </header>
</body>
              
            
!

CSS

              
                @import url('//fonts.googleapis.com/css?family=Roboto+Slab:300,400,700');

* {  box-sizing: border-box; }

img { display: block; }

.app {
    height: 100vh;
    width: 100%;
    max-width: 600px;
    position: relative;
    height: 100vh;
    margin: 0 auto;
    font-family: 'Roboto Slab', Arial, Helvetica, sans-serif;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

.icon-btn {
    -webkit-appearance: none;
    border: none;
    background: none;
    width: 8vw;
    height: 8vw;
    min-width: 32px;
    min-height: 32px;
    max-width: 40px;
    max-height: 40px;
    svg {
        height: 100%; 
        width: 100%;
        fill: #fff;
    }
}

.icon {
    width: 15vw;
    height: 15vw;
    max-height: 70px;
    max-width: 70px;
    opacity: .8;
    svg {
        height: 100%; 
        width: 100%;
        fill: #fff;
    }
}

.header {
    max-height: 600px * 2 / 3;
    height: 66.6vw;
    background: cadetblue;
    position: relative;
}

.header-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

// Figure 2
////////////////////////////////////
.topbar {
    display: flex;
    justify-content: space-between;
    padding: 2vh 2vw 0;
}

.topbar-right {
    display: inline-flex;
}

// Figure 3
////////////////////////////////////
.bottombar {}

// Figure 4
////////////////////////////////////
.playerbar {
    display: flex;
    justify-content: space-between;
    padding: 0 2vw;
    color: white;
}

.player-rank {
    margin-right: .5vw;
    font-size: 15px;
}
.player-name {
    display: inline;
    font-size: 24px;
    line-height: 1;
    font-weight: 400;
}


// Figure 5
////////////////////////////////////
.scorebar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 2vw 2vh;
}

.score {
    font-size: 64px;
    font-weight: 300;
}

.score-winner {
    font-weight: bold;
}

.score-time {
    font-size: 20px;
}


@media (max-width: 480px) {
    .player-rank { font-size: 12px; }
    .player-name { font-size: 16px; }
    .score-time { font-size: 16px; }
    .score { font-size: 30px; }
}

              
            
!

JS

              
                
              
            
!
999px

Console