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

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<!-- Start of Product Landing Page -->
<main>
  <header id="header">
    <nav id="nav-bar" class="flex-row">
      <div class="company-name"><a href="#about-us"><img class="header__logo" id="header-img" src="https://image.flaticon.com/icons/svg/1057/1057369.svg" alt="Rando Barber Shop company logo">Rando Barber Shop</a></div>
      <div id="page-links">
        <ul class="flex-row">
          <li><a class="nav-link" href="#about-us">About us</a></li>
          <li><a class="nav-link" href="#products">Products</a></li>
          <li><a class="nav-link" href="#pricing">Pricing</a></li>
        </ul>
      </div>
    </nav>
  </header>
  <!-- Section A: About Us -->
  <section id="about-us" class="flex-row">
      <video id="video" controls>
        <source src="https://player.vimeo.com/external/400273716.hd.mp4?s=8cd0b7c5ffe28591dd8b203f38a69e0f92c88000&profile_id=172&oauth2_token_id=57447761&download=1">
    </video>
    <div id="info" class="flex-column">
      <h1>Rando Barber Shop</h1>
      <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nisi dicta quam voluptates debitis eos soluta doloribus voluptatum cupiditate vero non similique sapiente numquam, aspernatur exercitationem nulla odit dolor eum aliquid.</p>
      <button id="shop-now" name="shop-now" onclick="window.location.href='#pricing';">Shop Now</button>
    </div>
  </section>
  
  
  <!-- Section B: Products -->
  <section id="products" class="flex-row">
    <div id="product__intro" class="flex-column">
      <h2>Something about the best haircuts or something</h2>  
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam, debitis aliquam excepturi dolores eos iure blanditiis ut aut laboriosam! Adipisci dolor tempore facere veniam nobis nulla ad quaerat obcaecati labore aliquid quasi tempora alias animi quod velit enim, quisquam dolore saepe. Iure, neque molestias. Dolorum quo pariatur ipsum tenetur sapiente!</p> 
    </div>
    <div id="img-section" class="container">
      <!--insert images here -->
      <img class="mySlides fade" src="https://images.pexels.com/photos/2068672/pexels-photo-2068672.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260" alt="haircut-1">
      <img class="mySlides fade" src="https://images.pexels.com/photos/2014808/pexels-photo-2014808.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="shave-1"> 
      <img class="mySlides fade" src="https://images.pexels.com/photos/2090770/pexels-photo-2090770.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="haircut-child">
      <img class="mySlides fade" src="https://images.pexels.com/photos/3993449/pexels-photo-3993449.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="hair-washing">
      <img class="mySlides fade" src="https://images.pexels.com/photos/3998402/pexels-photo-3998402.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="haircut-3">
      <img class="mySlides fade" src="https://images.pexels.com/photos/897271/pexels-photo-897271.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="barber-tools">
      <img class="mySlides fade" src="https://images.pexels.com/photos/3998403/pexels-photo-3998403.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="haircut-2">
    </div>
  </section>
  
  
  <!-- Section C: Pricing -->
  <section id="pricing" class="flex-row">
    <ul class="flex-row">
      <li class="card">
        <img src="https://images.pexels.com/photos/1570807/pexels-photo-1570807.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="cutting hair">
        <div class="card-content">
          <h2> $10.00</h2>
          <h3>Trim</h3>
          <hr>
          <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugiat, itaque consequatur tempore modi laborum accusantium enim error magnam ab impedit.</p>
        </div>
      </li>
      <li class="card">
        <img src="https://images.pexels.com/photos/995300/pexels-photo-995300.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" alt="razor blade">
        <div class="card-content">
          <h2>$17.00</h2>
          <h3>Trim + Shave</h3>
          <hr>
          <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Laborum consectetur vero iusto quas, beatae possimus officia maxime magnam corporis repudiandae.</p>
        </div>       
      </li>
      <li class="card">
        <img src="https://images.pexels.com/photos/3993297/pexels-photo-3993297.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260" alt="dye hair">
        <div class="card-content">
          <h2>$20.00</h2>
          <h3>Dye Hair</h3>
          <hr>
          <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus ad nostrum quos neque amet recusandae deleniti dolores, cumque nemo perferendis.</p>
        </div>
      </li>
    </ul>
  </section>
  
  
  <!-- Section D: End of page -->
  <footer>
    <form id="form" action="https://www.freecodecamp.com/email-submit">
      <label for="email">For more information please enter your email address here:</label>
      <input type="email" id="email" name="email" placeholder="example@example.com">     
      <input id="submit" type="submit" value="Submit">
    </form>
    
      <p>Page created by: <a id="codepen" href="https://codepen.io/zukululushikufu">Jeffrey Wan</a></p>
  </footer>
</main>
<!-- End of Product Landing Page -->
              
            
!

CSS

              
                /* reset */
*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html{
  font-size: 10px;
  font-family: Calibri, Helvetica, sans-serif;
  line-height: 1.4;
}


/* ====================

        nav bar

======================*/
.flex-row{
  display: flex;
  flex-direction: row;
}

.flex-column{
  display: flex;
  flex-direction: column;
  
}

nav{
  width: 100%;
  position: fixed;
  padding: 2.5rem;
  color: #333;
  background-color: white;
  z-index: 2;
}


.nav-link{
  position: relative;
  outline: 0;
}

.nav-link::after{
  content: "";
  display: block;
  background: #333;
  top: 130%;
  left: 50%;
  width: 0;
  height: 3px;
  position: absolute;
  transition: width 0.3s ease 0s;
  transform: translate(-50%, 0);
  
}

.nav-link:hover::after{
  width: 100%;
}

.nav-link:focus, .nav-link:focus::after, .company-name:focus{
  width: 100%;
  color: rgb(220,20,60);
}

::-moz-focus-inner{
  border: 0;  
}

#nav-bar{
  align-items: baseline;
  justify-content: space-around;
  flex-wrap: no-wrap;
}

.header__logo{
  margin-right: 3rem;
  width: 50px;
}

.company-name{
  font-size: 2.5rem;
} 

a{
  color: inherit;
  text-decoration: none;
}

#page-links{
  font-size: 1.8rem;
  margin-left: auto;
}

#page-links li{
  margin-right: 5rem;
  list-style: none;
}



/*====================

  Section A: About us 

=====================*/

#about-us{
  --bg-clr: #f9f6f7;
  
  background: var(--bg-clr, #f9f6f7);
  color: #333;
}

video{
  width: 100%;
  height: auto;
  max-height: 100vh;
}

#info{
  padding: 5rem;
  align-items: flex-start;
  justify-content: center;
}

#info h1{
  text-align: center;
  font-size: 5rem;
  margin-bottom: 3rem;
}

#info p{
  text-align: justify;
  font-size: 1.6rem;
  margin-bottom: 5rem;
  
}

button{
  border: none;
  color: #333333;
  background: #ff971d;
  border-radius: 2em;
  font-size: 1.5rem;
  font-weight: 600;
  padding: 1.5rem 5rem;
  tabindex: 0;
}

button:focus{
  background: rgb(220,20,60);
}

button:hover{
  opacity: 0.85;
  box-shadow: 0 0 0 3px #f9f6f7,0 0 0 6px #ff971d;
  transform: scale(1.05);
}

/*==================== 


  Section B: Products 

=====================*/

#products{
  background: #ffe8d6;
  height: 100vh;
}

#product__intro {
  padding: 5rem;
  width: 100%;
  justify-content: center; 
}

#product__intro h2{
  margin-bottom: 15%;
}

#product__intro h2{
  font-size: 5rem;
}

#product__intro p{
  font-size: 1.6rem; 
}

/* image slideshow */
#img-section{
  background: #f9f6f7;
}

#img-section img{
  display: block;
  margin: 0 auto;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: -5px 0 5px rgba(0, 0, 0, 0.2);
}

.fade {
  animation-name: fade;
  animation-duration: 7.5s;
  animation-timing-function: ease-out;
}

@keyframes fade{
  0%{
    opacity: 0.4;
  }
  
  50%{
    opacity: 1;
  }
  
  100%{
    opacity: 0.4; 
  }
}

.container{
  width: 100%;
  height: 100%;
}

/*====================

  Section C: Pricing 

=====================*/

.card img{
  display: block;
  max-width: 100%;
  height: auto;
}

#pricing{
  background: #f9f6f7;
}

#pricing ul{
  list-style: none;
}

#pricing li{
  margin: 3.5rem;
}

.card-content{
  font-size: 1.6rem;
  padding: 10%;
}

.card-content h2{
  color: rgb(220,20,60);
  padding-bottom: 15%;
}

.card-content h3{
  padding-bottom: 1rem;
}

hr{
  margin-bottom: 1rem;
}

.card-content p{
  text-align: justify;
}

.card{
  background: #fff;
  box-shadow: 0 5px 10px 0 rgba(4,10,41,.2);
  box-shadow: 0 5px 10px 0 rgba(4,10,41,.2);
  text-align: center;
}

/*====================

  Section D: End

=====================*/
footer{
  color: white;
  background: #444;
  padding: 4rem 1.5rem;
  text-align: center;
  font-size: 1.6rem;
}

form{
  margin-bottom: 3rem;
}

form input{
  padding: 0.3rem 2rem;
  tabindex: 0;
}

input:focus{
  box-shadow: 0 0 0 4px #444, 0 0 0 6px rgba(73, 202, 230, 0.5);
}

#codepen:hover{
  color: rgb(220,20,60);
}

/* media query */
@media (max-width: 768px){
  
  /* nav bar */
  #nav-bar, #about-us, #products{
    flex-direction: column;
  }
  
  #header-img{
    width: 35px;
  }
  
  .company-name, #page-links{
    margin: 0 auto;
  }
  
  .company-name{
    font-size: 2.3rem;
    margin-bottom: 2.5rem;
  }
  
  #page-links{
    font-size: 1.7rem;
  }
  
  /* Section A */
  #info h1{
    margin: 0 auto 5% auto;
  }
  
  button{
    margin: 0 auto;
  }
  
  /* Section B */
  #products{
    height: 100%;
    max-width: 100%;
  }
  
  #img-section img{
    height: auto;
  }
  
  /* Section C */
  #pricing ul{
    flex-direction: column;
  }
  
  #pricing li{
    margin: 10%;
  }
}
              
            
!

JS

              
                /* Credits to w3schools.com for slideshow code: https://www.w3schools.com/howto/howto_js_slideshow.asp*/


var slideIndex = 0;
carousel();

function carousel() {
  var i;
  var x = document.getElementsByClassName("mySlides");
  for (i = 0; i < x.length; i++) {
    x[i].style.display = "none";
  }
  slideIndex++;
  if (slideIndex > x.length) {slideIndex = 1}
  x[slideIndex-1].style.display = "block";
  setTimeout(carousel, 7500); // Change image every 7.5 seconds
  
}
              
            
!
999px

Console