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 lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta charset="UTF-8">
    <link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Playfair+Display:400,700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="css/styles.css">
    <title>Grid Magazine Layout</title>
</head>
<body>

    <div class="ski">
        
        <div class="ski__embrace-wrap">
            <svg class="svg-fire" xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24"><path d="M12 5.887l8.468 14.113h-16.936l8.468-14.113zm0-3.887l-12 20h24l-12-20z"/></svg>
            <svg class="svg-earth" xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24"><path d="M12 5.887l8.468 14.113h-16.936l8.468-14.113zm0-3.887l-12 20h24l-12-20z"/></svg>
            <svg class="svg-water" xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24"><path d="M12 5.887l8.468 14.113h-16.936l8.468-14.113zm0-3.887l-12 20h24l-12-20z"/></svg>
            <svg class="svg-air" xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24"><path d="M12 5.887l8.468 14.113h-16.936l8.468-14.113zm0-3.887l-12 20h24l-12-20z"/></svg>
            
            <h1 class="ski__heading">Embrace The Elements</h1>
            
            <div class="ski__element ski__element--fire">
                <div class="fire--one">F</div>
                <div class="fire--two">I</div>
                <div class="fire--three">R</div>
                <div class="fire--four">E</div>
            </div>
            <div class="ski__element ski__element--earth">
                <div class="earth--one">E</div>
                <div class="earth--two">A</div>
                <div class="earth--three">R</div>
                <div class="earth--four">T</div>
                <div class="earth--five">H</div>
            </div>
            <div class="ski__element ski__element--water">
                <div class="water--one">W</div>
                <div class="water--two">A</div>
                <div class="water--three">T</div>
                <div class="water--four">E</div>
                <div class="water--five">R</div>
            </div>
            <div class="ski__element ski__element--air">
                <div class="air--one">A</div>
                <div class="air--two">I</div>
                <div class="air--three">R</div>
            </div>
        </div>
        
        <div class="ski__creds-wrap">
            <p class="ski__author"><span class="by">By</span> Tommy Ethington</p>
            <p class="ski__illustration"><span class="by">Illustrations by</span> Alex Green/Folio</p>
            <a class="inspiration" href="https://res.cloudinary.com/jduquain/q_auto,f_auto/v1561655083/grid_magazine_5_fjcssc.jpg" target="_blank">Inspiration</a>
        </div>
        
        <div class="ski__para-wrap">
           <p class="ski__para ski__para--one">
               W<span class="para--uppercase">hen the mercury</span> takes a dive, our instict is to head indoors, bundle up, and hibernate until spring. But as any outdoor enthusiast will tell you, the colder months are made for&nbsp;adventure.
           </p> 
           <p class="ski__para ski__para--two">
               Inspired by fire, air, earth, and water Lorem ipsum dolor sit amet, Atque libero soluta perferendis ab unde magnam ipsam accusantium optio, laudantium architecto blanditiis! Tempora blanditiis hic, dignissimos temporibus ut modi, deleniti, quidem officia esse molestiae iusto asperiores, autem voluptas omnis.  
           </p> 
           <p class="ski__para ski__para--three">
               Aperiam sit ab vero nostrum ea temporibus modi quasi esse excepturi, odio velit veniam omnis. Tempora blanditiis hic, dignissimos temporibus ut modi, deleniti, quidem officia esse molestiae iusto asperiores, autem voluptas omnis. Molestiae facilis debitis.
           </p>
        </div>
        
    </div>

</body>
</html>
              
            
!

CSS

              
                :root {
	box-sizing: border-box;
}

*, ::before, ::after {
	box-sizing: inherit;
	text-decoration: none;
	list-style-type: none;
	margin: 0;
	padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 100%;
    max-width: 1280px;
    margin: 0 auto;
    color: #000;
    padding: 0 1.5em;
}

.inspiration {
    font-family: Arial, sans-serif;
    color: #333;
    text-decoration: underline;
    margin: 4em 0 0 5em;
    display: block;
}

.inspiration:hover, .inspiration:focus {
    color: #000;
}

.ski {
    background-image: linear-gradient(95deg, transparent 0%, transparent 85%, #fff 85%), url('https://res.cloudinary.com/jduquain/q_auto,f_auto/v1561652914/ski_rk51xj.jpg');
    background-size: cover;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
}

/******* GRID ITEM 1 and a GRID CONTAINER ***********/
.ski__embrace-wrap {
    justify-self: center;
    align-self: center;
    
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    grid-gap: 1.2em;
    justify-items: center;
    padding-top: 3em;
    
    /* overflow-x is causing vertical scrollbar */
    overflow: hidden;
}

.svg-fire {
    fill: #dd1515;
}

.svg-earth {
    fill: #2c9f2c;
    transform: rotate(180deg);
}

.svg-water {
    fill: #268b8b;
    transform: rotate(180deg);
}

.svg-air {
    fill: #6e93ba;
}

.ski__heading {
    font-family: 'Playfair Display', serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    word-spacing: 3px;
    
    grid-column: 1 / -1;
    white-space: nowrap;
    color: #525252;
}

.ski__element {
    font-weight: 700;
    font-size: 1.4em;
}

.ski__element--fire {
   /*background-image: linear-gradient(to bottom, #dd1515, #cc5414);
   background-clip: text;
   -webkit-background-clip: text;
    color: transparent; */ 
    color: #dd1515;
    
}

[class*=fire--], [class*=water--], [class*=earth--], [class*=air--]  {
    opacity: 0;
    transform: translateY(-6em) scale(10);
}


.ski__element--earth {
   /*background-image: linear-gradient(to bottom, #2c9f2c, rgb(17, 142, 36, .7));
   background-clip: text;
   -webkit-background-clip: text;
   color: transparent; */
   color: #2c9f2c; 
}

.ski__element--water {
   /*background-image: linear-gradient(to bottom, #268b8b, rgb(27, 147, 147, .7));
   background-clip: text;
   -webkit-background-clip: text;
   color: transparent; */
    color: #268b8b;
}

.ski__element--air {
   /*background-image: linear-gradient(to bottom, #6e93ba, #a0c2e6);
   background-clip: text;
   -webkit-background-clip: text;
   color: transparent; */
    color: #6e93ba;
}

.fire--two, .air--two {
    margin-left: .15em;
}

/******* GRID ITEM 2 ***********/
.ski__creds-wrap {
    justify-self: end;
    font-family: 'Playfair Display', serif;
    margin-top: 4em;
}

.by {
    font-size: .8em;
}

.ski__author {
   margin-left: 8em; 
}

.ski__illustration {
   margin-right: 6em; 
}

/******* GRID ITEM 3 ***********/
.ski__para-wrap {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    width: 60%;
    justify-self: end;
}

.ski__para + .ski__para {
    text-indent: 2em;
}

.ski__para--one::first-letter {
    font-family: 'Playfair Display', serif;
    font-size: 5em;
    color: #525252;
    float: left;
    line-height: .8;
    margin-right: .1em;
}


@media (max-width: 1000px) {
    
    .ski__para-wrap {
        font-size: .9em;
        width: 70%;
    }
    
    .ski__para--one::first-letter {
        font-size: 4.5em;
    }
    
    .svg-fire {
        transform: scale(.8);
    }
    
    .svg-earth {
        fill: #2c9f2c;
        transform: rotate(180deg) scale(.8);
    }

    .svg-water {
        fill: #268b8b;
        transform: rotate(180deg) scale(.8);
    }
    
    .svg-air {
        transform: scale(.8);
    }

    .ski__heading {
        font-size: 1.5em;
        letter-spacing: 2px;
        word-spacing: 2px;
    }

    .ski__element {
        font-size: 1.2em;
    }
    
    .ski__creds-wrap {
        font-size: .8em;
    }
    
}

@media (max-width: 760px) {
    
    body {
        padding: 0;
    }
    
    .ski {
        display: block;
        background-image: url('https://res.cloudinary.com/jduquain/q_auto,f_auto/v1561652914/ski_rk51xj.jpg');
        background-size: cover;
        height: 80vh;
    }
    
    .ski__embrace-wrap {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: auto auto auto;
        grid-gap: 1.2em;
        justify-items: center;
    }
    
    .ski__creds-wrap {
        font-family: 'Playfair Display', serif;
        text-align: right;
        margin-right: 2em;
        font-size: .9em;
    }
    
    .ski__illustration {
       margin-right: 2em; 
    }
    
    .inspiration {
        margin: 2em 0 0 3em;
    }
    
    .ski__para-wrap {
        width: 80%;
        margin: 15em 10% 3em 10%;
    }
    
}


@media (max-width: 570px) {
    .ski {
        background-position: center center
    }
}

@media (max-width: 400px) {
    .ski__heading {
        font-size: 1.2em;
    }
    
    .ski__para-wrap {
        width: 90%;
        font-size: .85em;
        margin: 8em 5% 3em 5%;
    }

}



              
            
!

JS

              
                
let skiHeading = document.querySelector('.ski__heading');

let elementsArrayOne = Array.from(document.querySelectorAll('.ski__element--fire div'));
let elementsArrayTwo = Array.from(document.querySelectorAll('.ski__element--earth div'));
let elementsArrayThree = Array.from(document.querySelectorAll('.ski__element--water div'));
let elementsArrayFour = Array.from(document.querySelectorAll('.ski__element--air div'));


let tl = new TimelineMax();

let splitHeading = new SplitText(skiHeading);

let easing = Power4.easeInOut; 

function random(min, max) {
    return (Math.random() * (max - min) + min);
}

// FOUC! 
function randomText() {
    
    splitHeading.chars.forEach((el, idx) => {
        TweenMax.from(el, 2.5, {
           opacity: 0,
            x: random(-500, 500),
            y: random(-500, 500),
            z: random(-500, 500),
            scale: 8.1,
            delay: idx * .02
        })
    })
    
}

tl.add(randomText)


//tl.addLabel('now') 


// DRY this up
tl.staggerTo(elementsArrayOne, 1, {
    opacity: 1,
    y: 0,
    scale: 1,
    ease: easing
}, .1, "+=2.3")
tl.staggerTo(elementsArrayTwo, 1, {
    opacity: 1,
    y: 0,
    scale: 1,
    ease: easing
}, .1, "-=.8")
tl.staggerTo(elementsArrayThree, 1, {
    opacity: 1,
    scale: 1,
    y: 0,
    ease: easing
}, .1, "-=.8")
tl.staggerTo(elementsArrayFour, 1, {
    opacity: 1,
    scale: 1,
    y: 0,
    ease: easing
}, .1, "-=.8")



              
            
!
999px

Console