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

              
                <!doctype html>
<html>

<head>
    <title>Instagram</title>
</head>

<body>
    <!--
            <header>
                Site Title
                    Instagram Icon
                    Divider
                    Instagram Logo

                Search Box
                    Input
                    Search Icon
                    Search Label

                Main Nav
                    Explore
                    Like
                    Profile
                </header>
    -->
    <svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
        <defs>
            <symbol id="icon-heart" viewBox="0 0 32 32">
                <title>heart</title>
                <path d="M23.6 2c-3.363 0-6.258 2.736-7.599 5.594-1.342-2.858-4.237-5.594-7.601-5.594-4.637 0-8.4 3.764-8.4 8.401 0 9.433 9.516 11.906 16.001 21.232 6.13-9.268 15.999-12.1 15.999-21.232 0-4.637-3.763-8.401-8.4-8.401z"></path>
            </symbol>
            <symbol id="icon-more_horiz" viewBox="0 0 24 24">
                <title>more_horiz</title>
                <path d="M12 9.984c1.078 0 2.016 0.938 2.016 2.016s-0.938 2.016-2.016 2.016-2.016-0.938-2.016-2.016 0.938-2.016 2.016-2.016zM18 9.984c1.078 0 2.016 0.938 2.016 2.016s-0.938 2.016-2.016 2.016-2.016-0.938-2.016-2.016 0.938-2.016 2.016-2.016zM6 9.984c1.078 0 2.016 0.938 2.016 2.016s-0.938 2.016-2.016 2.016-2.016-0.938-2.016-2.016 0.938-2.016 2.016-2.016z"></path>
            </symbol>
        </defs>
    </svg>

    <!-- status-no-location -->
    <main id="main-content" class="actions-content-inactive">
        <article class="post-item">
            <div class="post-item-header">

                <div class="persons-profile-location">
                    <div class="persons-profile">
                        <img src="https://source.unsplash.com/64x64?profile" alt="Unsplash Photo" width="64" height="64" />
                        <a class="persons-profile-name" href="#">Mike Tess</a>
                    </div>
                    <div class="location">
                        <span class="label">Location:</span> <a href="#">Quezon City, Philippines</a>
                    </div>
                </div>

                <div class="published-timestamp">
                    <span class="label">Published Timestamp:</span> <time datetime=""><a href="#" title="April 28, 2017">5 Days Ago</a></time>
                </div>

            </div>
            <div class="post-item-content">
                <div class="post-image">
                    <img src="https://source.unsplash.com/640x640?design" alt="Unsplash Photo" width="640" height="640" />
                </div>

                <div class="social-actions-shortcut">
                    <div class="label">Social Actions Shortcut</div>
                    <ul>
                        <li><a href="#">Like</a></li>
                        <li><a href="#">Comment</a></li>
                    </ul>
                </div>

                <div class="likes">
                    <div class="label">Likes</div>
                    <ul>
                        <li><a href="#">alien</a><span>,</span></li>
                        <li><a href="#">pratt</a><span>,</span></li>
                        <li><a href="#">pavarotti</a></li>
                        <li><span>and</span> <a href="#">drei</a></li>
                    </ul>
                    <span class="like-this-phrase">like this</span>
                </div>

                <div class="owner-caption">
                    <div class="label">Owner Caption</div>
                    <a class="owner-username" href="#">miketess</a><span class="colon">:</span>
                    <p class="first-paragraph-caption">Third time's a charm <a class="hashtag" href="#">#ink</a> <a class="hashtag" href="#">#fleur</a> <a class="hashtag" href="#">#wip</a></p>
                    <p class="paragraph-caption">This is a second paragraph.</p>

                    <p class="paragraph-caption">This is a third paragraph.</p>
                </div>

                <div class="comments">
                    <div class="heading">User Comments</div>
                    <a class="username" href="#">jamie</a><span class="colon">:</span>
                    <p class="first-paragraph-caption">It take one to know one.</p>
                </div>

                <div class="social-component">
                    <div class="heading">Social Component</div>
                    <div class="actions">
                        <button id="social-actions-toggle" class="toggle" title="Actions Toggle"><span class="label">Actions Toggle</span>
                            <svg class="icon icon-more_horiz">
                                <use xlink:href="#icon-more_horiz"></use>
                            </svg></button>
                        <div id="actions-content" class="actions-content">
                            <div class="content">
                                <ul>
                                    <li class="action action-like"><a href="#">Like</a></li>
                                    <li class="action action-comment"><a href="#">Comment</a></li>
                                    <li class="action action-report"><a href="#">Report Inappropriate</a></li>
                                    <li class="action action-embed"><a href="#">Embed</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>

                    <div class="like-shortcut">
                        <a href="#" title="Like"><span class="label">Like</span><svg class="icon icon-heart">
                                <use xlink:href="#icon-heart"></use>
                            </svg></a>
                    </div>

                    <div class="comment-creation">
                        <form action="">
                            <input type="text" class="comment-input" placeholder="Add a comment...">
                            <button class="comment-submit-button" type="submit">Submit</button>
                        </form>
                    </div>
                </div>
            </div>
        </article>
    </main>
    <!--
                <footer>
                Secondary Links
                    About Us
                    Support
                    Blog
                    Press
                    API
                    Jobs
                    Privacy
                    Terms
                    Directory
                    Language

                Copyright Info
                    Copyright Symbol 2017 Instagram
                    All rights reserved.
                </footer>
    -->
</body>

</html>
              
            
!

CSS

              
                .persons-profile-name,
.likes a,
.owner-username,
.username,
.hashtag {
    color: black;
    text-decoration: none;
}

.persons-profile-name,
.likes a,
.owner-username,
.username {
    font-weight: bold;
}

.hashtag {
    color: red;
}

.persons-profile-name {
    padding: 16px;
    vertical-align: middle;
}

.persons-profile-name,
.location a,
.published-timestamp a {
    display: inline-block;
    padding: 4px 8px;
}

.persons-profile img {
    display: inline-block;
    vertical-align: middle;
    border-radius: 50%;
    border: 1px solid lightgray;
}

.published-timestamp .label,
.location .label,
.social-actions-shortcut .label,
.likes .label,
.owner-caption .label,
.owner-caption .label,
.owner-caption .colon,
.comments .colon,
.comment-submit-button {
    display: none;
}

.social-actions-shortcut ul,
.likes ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.likes ul {
    display: inline-block;
}

.likes li {
    display: inline-block;
}

.like-this-phrase {
    display: inline-block;
}

.owner-username,
.username {
    display: inline-block;
}

.owner-caption .paragraph-caption,
.comments .paragraph-caption {
    display: block;
}

.owner-caption .first-paragraph-caption,
.comments .first-paragraph-caption {
    display: inline-block;
}

.comment-input
{
    margin: 0;
    padding: 0;
    border: 0;

    font-size: 16px;
}

html {
    font-family: sans-serif;
}

.published-timestamp a {
    color: gray;
    text-decoration: none;
}

.post-item {
    max-width: 640px;
    background-color: white;

    border: 1px solid lightgray;

    border-radius: 4px;
    margin: 0 auto;
}

.post-item-header {
    display: flex;
}

.persons-profile-location {
    flex-grow: 1;
    position: relative;
    padding: 16px;
}

.published-timestamp {
    flex-grow: 1;
    text-align: right;
    padding: 16px;
}

.location,
.persons-profile-name {
    margin-left: 56px;
}

.location a {
    color: black;
    text-decoration: none;
}

.persons-profile img {
    position: absolute;
    width: 48px;
    height: 48px;
}

.status-no-location .persons-profile,
.status-no-location .published-timestamp {
    /* Comment */
    display: flex;
    align-items: center;
    min-height: 48px;
}

.status-no-location .published-timestamp {
    justify-content: flex-end;
}

.social-component {
    display: flex;
}

.social-component .heading {
    display: none;
}

.social-component .like-shortcut {
    order: 1;
}

.social-component .comment-creation {
    flex-grow: 1;
    order: 2;
}

.social-component .actions {
    order: 3;
}

.comment-creation .comment-input {
    width: 100%;
    height: 48px;
}

.comment-creation .comment-input:focus {
    outline: none;
}

.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke-width: 0;
    stroke: currentColor;
    fill: currentColor;
}

.like-shortcut .label {
    display: none;
}

.like-shortcut a,
.actions .toggle
{
    display: flex;
    width: 48px;
    height: 48px;
    color: black;
    color: hsla( 0, 0%, 0%, .25 );
    justify-content: center;
    align-items: center;
}

.actions .toggle .label {
    display: none;
}

.actions .toggle svg {
    width: 24px;
    height: 24px;
}

.actions .toggle {
    margin: 0;
    padding: 0;
    border: 0;
    background-color: transparent;
    cursor: pointer;
}

.like-shortcut a:hover,
.actions .toggle:hover {
    color: hsla( 0, 0%, 0%, .5 );
}

.post-image {
    text-align: center;
}

.post-image img {
    width: 100%;
    height: auto;
    max-width: 640px;
    min-width: 320px;
}

.social-actions-shortcut {
    display: none;
}

.likes {
    padding: 16px;
}

.owner-caption {
    padding: 16px;
    padding-top: 0;
}

.comments {
    padding: 16px;
    padding-top: 0;
}

.owner-caption p, .comments p {
    margin-top: auto;
}

.owner-caption p:last-of-type, .comments p:last-of-type {
    margin-bottom: auto;
}

.comments .heading {
    display: none;
}

.social-component {
    position: relative;
}

.social-component::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    width: calc( 100% - 32px );
    height: 1px;
    background-color: lightgray;
}

.likes a, .owner-caption a, .comments a {
    color: #003569;
}

.actions-content .content {
    width: calc( 100% - 96px );
    min-width: calc( 320px - 96px );
    max-width: calc( 640px - 96px );
    background-color: white;
    border: 1px solid lightgray;
    box-shadow: 0 0 32px hsla( 0, 0%, 0%, .0625 );
    border-radius: .125rem;
}

.actions-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.actions-content a {
    box-sizing: border-box;
    display: flex;
    text-align: center;
    text-decoration: none;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 16px;
    border-bottom: 1px solid lightgray;
    color: black;
}

.actions-content li:last-child a {
    border-bottom: 0;
}

.actions-content a:hover {
    background-color: lightgray;
}

.actions-content {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY( -50% );
    z-index: 99;
    width: 100%;
    display: flex;
    justify-content: center;
}

.actions-content-active::before {
    content: '';
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: hsla( 0, 0%, 0%, .5 );
    z-index: 1;
}

.actions-content-inactive .actions-content {
    display: none;
}

html.no-scroll {
    overflow-y: hidden;
}
              
            
!

JS

              
                (function($) {
    var $html = $(document.documentElement),
        $document = $(document),
        $socialActionsToggle = $("#social-actions-toggle"),
        $axnsCt = $("#actions-content"),
        $axnsCtCt = $axnsCt.find(".content"),
        $mainContent = $("#main-content"),
        axnsCtActCss = "actions-content-active",
        axnsCtInactCss = "actions-content-inactive",
        scrollCss = "scroll",
        noScrollCss = "no-scroll";

    // Activate
    function axnsCtAct() {
        $mainContent.addClass(axnsCtActCss).removeClass(axnsCtInactCss);
        $html.addClass(noScrollCss).removeClass(scrollCss);
        console.log("axnsCtAct");
    }

    // Deactivate
    function axnsCtDeact() {
        $mainContent.addClass(axnsCtInactCss).removeClass(axnsCtActCss);
        $html.addClass(scrollCss).removeClass(noScrollCss);
        console.log("axnsCtDeact");
    }
    axnsCtDeact();

    // Click
    $socialActionsToggle.on("click", function() {
        if ($mainContent.hasClass(axnsCtInactCss)) {
            axnsCtAct();
        } else if ($mainContent.hasClass(axnsCtActCss)) {
            axnsCtDeact();
        }
    });

    // Outside Click
    $document.on("click", function(e) {
        if (
            $mainContent.hasClass(axnsCtActCss) &&
            !$(e.target).closest($axnsCtCt).length &&
            !$(e.target).closest($socialActionsToggle).length
        ) {
            axnsCtDeact();
        }
    });
})(jQuery);

              
            
!
999px

Console