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 charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">

        <link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900" rel="stylesheet">

      <!--  <link rel="stylesheet" href="css/icon-font.css">-->
        <link rel="stylesheet" href="css/style.css">
        <link rel="shortcut icon" type="image/png" href="img/favicon.png">

        <title>Natours | Exciting tours for adventurous people</title>
    </head>
    <body>
         <header class="header">
           <div class="header__logo-box">
             <img src="/img/logo-white.png" alt="logo" class="header__logo">
           </div>
           <div class="header__text-box">
             <h1 class="heading-primary">
               <span class="heading-primary--main">Outdoors</span>
               <span class="heading-primary--sub">Is where life happens</span>
            </h1>

            <a href="#" class="btn btn--white btn--animated">Discover Our Tours</a>
           </div>


        </header>

    </body>
</html>

              
            
!

CSS

              
                /*
COLORS:

Light green: #7ed56f
Medium green: #55c57a
Dark green: #28b485

*/

*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  /*This started as 10px.
  Rem is then calculated by dividing by 10. e.g 10px = 1 rem.
  Convert elements which use px to rem
  Then converted to the 10px to 100%
  We then decrease to 62.5% as we want the font size is be roughly 16px */
  font-size: 62.5%;
}

body {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.7;
  color: #777;
  padding: 3rem;
  box-sizing: border-box;
}

.header {
  height: 95vh;
  background-image: linear-gradient(
    to right bottom,
    rgba(126, 213, 111, 0.8),
    rgba(40, 180, 133, 0.8)),
    url(../img/hero.jpg);
  background-size: cover;
  background-position: top;
  position: relative;

  clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);

}

.header__logo-box {
  position: absolute;
  top: 4rem;
  left: 4rem;
}

/* LOGO ANIMATION
.logo-box:hover .logo{
  animation:moveInRight 1s ease-out
}*/

.header__logo {
  height: 3.5rem;
}


.header__text-box {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  /*THIS CENTERS THE BTN*/
  text-align: center;
}

.heading-primary {
color: #fff;
text-transform: uppercase;
/*THIS STOPS THE MINOR UPWARDS SHIFT IN THE ANIMATION */
backface-visibility: hidden;
/*THIS ADDS WHITE SPACE BETWEEN BTN*/
margin-bottom: 6rem;
}

.heading-primary--main {
  display: block;
  font-size: 6rem;
  font-weight: 400;
  letter-spacing: 3.5rem;
  animation-name: moveInLeft;
  animation-duration: 1s;
  /* CREATES DELAY
  animation-delay: 3; */
  /* REPEATS ANIMATION
  animation-iteration-count: 3; */
  /* TOGGLES THE SPEED OF THE ANIMATION  GOOGLE FOR Eg*/
  animation-timing-function: ease-out;
}



.heading-primary--sub {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 17.5rem;
  /*THIS IS A SIMPLIED VERSION OF ABOVE THE FUNCTION 'ASSUMES'*/
  animation: moveInRight 1s ease-out;
}
/*CREATES ANIMATION*/
@keyframes moveInLeft {
  0% {
    opacity: 0;
    transform: translateX(-10rem);
  }

80% {
  transform: translateX(1rem);
}

100% {
  opacity: 1;
  transform: translate(0);
}
}

@keyframes moveInRight {
  0% {
    opacity: 0;
    transform: translateX(10rem);
  }

80% {
  transform: translateX(-1rem);

}

100% {
  opacity: 1;
  transform: translate(0);
}
}

@keyframes moveInBottom {
  0% {
    opacity: 0;
    transform: translateY(10rem);
  }

100% {
  opacity: 1;
  transform: translate(0rem);
}
}

/* THIS AFFECTS THE LINK BEFORE AND AFTER ITS VISITED*/
.btn:link,
.btn:visited {
  text-transform: uppercase;
  /*THIS REMOVES RED COLOUR WHEN LINK HAS BEEN VISITED(SELECTED)*/
  text-decoration: none;
  padding: 1.5rem 4rem;
  /*W/O THIS IT DISPLAYS AS BLOCK AND COVERS HEADER*/
  display: inline-block;
  border-radius: 10rem;
  /*SHORTHAND FOR ANIMATION*/
  transition: all .2s;
  position: relative;
}

.btn:hover {
  transform: translateY(-3px);
  /*x axis Y axis blur shadow colour NOTE DIFF BELOW THIS CREATES CLICKED EFFECT*/
  box-shadow: 0 10px 20px rgba(0,0,0,.2);
}


/*THIS IS PROPERTIES WHILE BTN IS PRESSED*/
.btn:active {
  /*CREATE CLICK EFFECT*/
  transform: translateY(-1px);
  /*x axis Y axis blur shadow colour*/
  box-shadow: 0 5px 10px rgba(0,0,0,.2);
}


.btn--white {
  background-color: #fff;
  color: #777;
}
/* CONTENT & DISPLAY PROP. ARE REQUIRED. PROP. ARE SET TO 100% TO MATCH BTN*/
.btn::after {
  content: "";
  display: inline-block;
  height: 100%;
  width: 100%;
  border-radius: 10rem;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  transition: all .4s;
}

.btn--white::after {
  background-color: #fff;
}

.btn:hover::after {
  transform: scaleX(1.5) scaleY(1.6);
  opacity: 0;
}

.btn--animated {
  /*PROP NAME DURATION ATTRIBUTE DELAY*/
  animation: moveInBottom .5s ease-out .75s;
  /*BYPASSES CREATING @KEYFRAMES 0% OR INITIAL APPEARENCE OF BTN*/
  animation-fill-mode: backwards;
}

              
            
!

JS

              
                
              
            
!
999px

Console