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="container">
    <div class="hero">
        <div class="hero__image">
            <div class="hero__image--overlay"></div>
            <div class="hero__child hero__child--primary animation--floating"></div>
            <div class="hero__child hero__child--secondary animation--floating"></div>
            <p class="hero__title animation--title-in">The flaming mountain</p>
            <p class="hero__subtitle animation--title-in">by John Blaine</p>
        </div>
    </div>
</div>
<div class="section">
    <h2>A RICK BRANT SCIENCE-ADVENTURE STORY</h2>
    <hr>
    <p class="section__text">Rock, melting like butter on a hot stove! It is hard to believe, but that is what happens on San Luz, a small island off the coast of South America. When Rick Brant and his pal Dan Scott fly to the famous resort island to join Rick's father, head of the Spindrift Scientific Foundation, a seemingly inactive volcano is about to explode in an eruption which could easily blow San Luz off the map.</p>

    <p>The immediate threat is to a small town at the foot of the volcano, where the air reeks with the fumes of hydrogen sulfide and sulfur dioxide, and it is here that Rick and Scotty help Dr. Brant and his scientist associates set up headquarters, in the hope of finding a way of controlling an eruption that is growing into a certainty with fantastic speed.</p>

    <p>But their efforts to save the island town are hindered by the superior forces of nature, the superstitious fatalism of the people—and sabotage!</p>

    <p>With the earth opening up all around them, Rick, Scotty, and the scientists have little hope of preventing a catastrophe, until a decision is made to unleash the awesome power of atomic energy in a desperate last attempt to fight the volcanic eruption.</p>

    <p>Jam-packed with excitement and swift, tense action, The Flaming Mountain has all the elements that have made the Rick Brant Science Adventure series a favorite with boys all over the world.</p>
    &mdash;
    <h3>CHAPTER I</h3>
    <h4>Vulcan's Hammer</h4>
    <p class="section__text">The entire staff of the world-famed Spindrift Scientific Foundation gathered in the conference room of the big gray laboratory building on the southeast corner of Spindrift Island. It was unusual for the whole staff to be called to a meeting. Even more unusual—not a single member knew what the meeting was about.</p>

    <p>Rick Brant, son of the Spindrift Foundation's director, Dr. Hartson Brant, was perhaps even more mystified than the professional scientists. His father had phoned from Florida with brief instructions. "Rick, I want you and Scotty to make a scale model of San Luz Island. It's off the coast of Venezuela. You'll find it on the sailing chart of the area, and there are references in the library. Be as complete and detailed as possible, and have the model ready by Saturday. Pick me up at Newark Airport Saturday noon. I'll have a guest. Ask Hobart Zircon to call a full staff meeting for two o'clock Saturday."</p>

    <p>Rick and his pal Don Scott had completed the model, which was now resting on a table at the front of the lab conference room. One hour ago he had flown with Scotty in his plane, the Sky Wagon, to Newark Airport where he had picked up his father and a short, white-haired elderly man by the name of Dr. Esteben Balgos.</p>
</div>
<footer class="group footer">
    <div class="pull">
        <small>Images: <a href="http://unsplash.com">Unsplash</a></small>
    </div>
    <div class="push">
        <small>Text: <a href="http://www.gutenberg.org/ebooks/32038">The Project Gutenberg</a></small>
    </div>
</footer>
              
            
!

CSS

              
                /** 
* Imports and plugins 
*/
@use postcss-custom-media;
@use postcss-nested;
@use postcss-simple-vars;
@import url('https://fonts.googleapis.com/css?family=Eczar:400,700|Gentium+Basic');

/** 
* Base 
*/

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Eczar', sans-serif;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Eczar", sans-serif;
    
}

h2 {
    font-family: "Eczar", sans-serif;
    font-size: 26px;
    font-weight: 700;
    padding: 0;
    margin: 56px 0 24px -1.883px;
    text-align: left;
    line-height: 34.5px;
    letter-spacing: -0.45px;
}

p {
    font-family: 'Gentium Basic', serif;
    margin-top: 21px;
    font-size: 21px;
    letter-spacing: -0.03px;
    line-height: 1.58;
}

a {
    color: brown;
    text-decoration: none;
    &:hover {
        font-weight: bold;
    }
}

.footer {
    color: white;
    background-color: #d0bcab;
    padding: 24px;
}

.section {
    margin: 0 auto;
    max-width: 650px;
    padding: 0 24px;
    &__text {
        &::first-letter {
            font-size: 32px;
        }  
    }
}

/** 
* Utils 
*/
.group {
    overflow: hidden;
}

.pull {
    float: left;
}

.push {
    float: right;
}

.container {
    position: relative;
    
    display: block;
    width: 100%;
    height: 100vh;
}

.hero {
    position: relative;
    
    display: block;
    width: 100%;
    height: 100vh;

    &__image {
        position: absolute;

        width: 100%;
        height: 100vh;

        clip: rect(0, auto, auto, 0);

        background-image: url(https://res.cloudinary.com/mihael/image/upload/v1548409393/codepen/hero.jpg);
        background-attachment: fixed;
        background-repeat: no-repeat;
        background-size: cover;

        &--overlay {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 1;
            
            background: linear-gradient(to bottom, rgba(121,85,72,0) 0%,rgba(121,85,72,0.17) 21%,rgba(121,85,72,0.5) 80%);
        }
    }
    &__child {
        position: fixed;

        background-repeat: no-repeat;
        backface-visibility: hidden;
        opacity: .8;

        &--primary {
            top: -120px;
            left: 50px;

            width: 819px;
            height: 1621px;

            background-image: url(https://res.cloudinary.com/mihael/image/upload/v1548409393/codepen/cloud-2.png);
        }
        &--secondary {
            top: 0;
            right: 50px;

            width: 300px;
            height: 500px;

            background-size: 300px auto;
            background-image: url(https://res.cloudinary.com/mihael/image/upload/v1548409392/codepen/cloud-1.png);
        }
    }
    &__title {
        position: absolute;
        bottom: 18vh;
        left: 24vw;
        right: 24vw;
        z-index: 1;
        
        opacity: 0;
        
        font-size: calc(6px * 10);
        line-height: calc(6px * 12);

        color: white;

        font-family: 'Eczar', sans-serif;
        font-weight: 200;
        
        text-align: center;
        
        @media screen and (min-width: 768px) {
            bottom: 15vh;
            font-size: calc(6px * 16);
            line-height: calc(6px * 18);    
        }
    }
    &__subtitle {
        position: absolute;
        bottom: 15vh;
        left: 24vw;
        right: 24vw;

        color: white;

        font-family: 'Gentium Basic', serif;
        font-size: 24px;
        line-height: 32px;
        text-align: center;
    }
}

/**
* Animation 
*/

.animation {
    &--floating {
        animation-name: floating;
        animation-duration: 200000ms;
        animation-iteration-count: infinite;
    }
    &--title-in {
        animation: title-in 800ms forwards ease-in-out 750ms;
    }
    &--from-top {
        animation: from-top 350ms forwards cubic-bezier(0.65, 0.05, 0.36, 1);
    }
    &--from-bottom {
        animation: from-bottom 350ms forwards cubic-bezier(0.65, 0.05, 0.36, 1);
    }
}

/**
* Keyframes for specific animation
*/
@keyframes floating {
    0% {
        transform: translateY(0%);
    }
    50% {
        transform: translateY(50%);
    }
    100% {
        transform: translateY(0%);
    }
}

@keyframes title-in {
    0% {
        visibility: hidden;
        opacity: 0;
        transform: translateY(-25%);
    }
    100% {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}
@keyframes from-top {
    0% {
        visibility: hidden;
        opacity: 0;
        transform: translateY(-30%);
    }
    100% {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}
@keyframes from-bottom {
    0% {
        visibility: hidden;
        opacity: 0;
        transform: translateY(15%);
    }
    100% {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console