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

              
                    <header>
        <a href="#" class="logo">Gary Simon</a>
        <nav>
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">About</a></li>
                <li><a href="#">Contact</a></li>
            </ul>
        </nav>
    </header>
    <div class="wrapper">
        <section class="hero">
            <div class="inner">
                <div class="clipper">
                    <h1>Go Musician</h1>
                </div>

                <div class="anim-panel">
                    <p>Start touring all over the place and melting the hearts of chicks.</p>

                    <a href="#" class="read-btn primary">Get Famous</a>
                </div>
            </div>
        </section>

        <section class="sidebar">
            <div class="inner">
                <div class="clipper">
                    <h2>Featured</h2>
                </div>
                <div class="anim-panel">
                    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren.</p>
                    <a href="#" class="read-btn">Read More</a>
                </div>
            </div>
        </section>

        <section class="subscribe">
            <div class="inner">
                <div class="clipper">
                    <h2>Subscribe</h2>
                </div>
                <div class="anim-panel">
                    <p>Get the latest updates about this website and stuff.</p>
                    <input placeholder="Email Address" type="text" name="email">
                    <button class="cta">Subscribe Now</button>
                </div>
            </div>
        </section>
    </div>
              
            
!

CSS

              
                // Variables

$primary-color: #FFEC8B;
$submit-btn-bg-color: black;
$submit-btn-color: white;

body, html {
    margin: 0;
}
body {
    height: 100%;
    font-family: 'Montserrat';
  display: none;
}

header {
    position: absolute;
    padding: 1em;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    width: calc(100% - 2em);
    background: white;
    
    a {
        text-decoration: none;
        color: black;
    }

    a.logo {
        font-weight: bold;
        text-transform: uppercase;
    }

    nav ul {
        list-style-type: none;
        display: flex;
        justify-content: space-around;
        width: 100%;
        margin: 0;
        padding: 0;

        li a {
            padding: 1em;
        }
    }
}

.wrapper {
    display: grid;
    grid-template-columns: auto;

    section {
        padding: 3em;

        h1, h2, .read-btn {
            text-transform: uppercase;
            margin: 0;
        }

        h2 {
            font-size: 1.4rem;
        }

        .read-btn {
            text-decoration: none;
            color: black;
            font-weight: bold;
            background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/2621168/arrow.svg') no-repeat;
            background-size: 8px;
            background-position: 0 1px;
            padding-left: 1em;
        }

        .primary {
            padding: 1.5em 1.5em 1.5em calc(3em + 25px);
            background-position: 3em;
            border: 1px solid gray;
            margin-top: 3em;
            margin-left: -3em;
            display: inline-block;
        }

        .clipper {
            overflow: hidden;
        }
    }
    
    section.hero {
        padding-top: 8em;
        background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/2621168/hero.jpg');
        background-size: cover;

        p {
            width: 70%;
            font-size: 1.2rem;
            margin-bottom: 0;
        }

        h1 {
            font-size: 2.4rem;
        }
    }

    section.sidebar, section.subscribe {
        font-size: .9rem;
        line-height: 1.6em;
    }

    section.sidebar {  
        background: $primary-color;

        .read-btn {
            margin-top: 2em;
            display: block;
            background-position: 0 .3em;
        }
    }

    section.subscribe {

        input {
            width: 100%;
            padding: 1em;
            font-family: 'Montserrat';
            margin-bottom: 1em;
        }

        button {
            width: 100%;
            background: $submit-btn-bg-color;
            color: $submit-btn-color;
            padding: 1em;
            border: none;
            font-family: 'Montserrat';
        }
    }
}

@media only screen and (min-width: 768px) {
    html {
        font-size: 18px;
    }
}

@media only screen and (min-width: 1020px) {

    header {
        background: none;
    }

    .wrapper {
        display: grid;
        grid-template-columns: 70% auto;
        grid-template-rows: 60% auto;
        grid-template-areas:
            "hero featured"
            "hero subscribe";
        height: 100vh;
    }

    section.hero {
        grid-area: hero;

        h1 {
            //margin-top: 20vh;
        }
    }

    section {
        display: grid;
        grid-template-rows: auto;
        align-items: center;
    }
}

@media only screen and (min-width: 1800px) {
    html {
        font-size: 21px;
    }
}
              
            
!

JS

              
                
        document.addEventListener("DOMContentLoaded", function(event) {

            // wait until window is loaded - meaning all images, stylesheets, js, fonts, media assets, and links
            window.addEventListener("load", function(e) {

                    document.body.style.display = 'block';
                var tl = new TimelineMax();

                tl.staggerFrom('section', 2, {
                opacity: 0,
                scale: .5,
                ease: Power2.easeOut
                }, 0.2)

                // show .from() initially
                tl.staggerFrom('h1, h2', .5, {
                opacity: 0,
                y: -40,
                ease: Power2.easeInOut
                }, 0.2, "-=2")

                tl.staggerFrom('.anim-panel', 1, {
                opacity: 0,
                y: -40,
                ease: Power2.easeInOut
                }, 0.2, "-=1.5")

            }, false);
        });
              
            
!
999px

Console