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

              
                <header id="header">
  <img id="header-img" src="https://image.ibb.co/bw0ZH0/logo.png" alt="Logo" style="width: 150px;">
  <nav id="nav-bar">
    <ul id="nav-list">
      <li><a href="#hero" class="nav-link" onclick="toggleNav()">Home</a></li>
      <li><a href="#features-section" class="nav-link" onclick="toggleNav()">Features</a></li>
      <li><a href="#how-it-works" class="nav-link" onclick="toggleNav()">How it works</a></li>
      <li><a href="#pricing" class="nav-link" onclick="toggleNav()">Pricing</a></li>
    </ul>
    <a href="javascript:void(0);" onclick="toggleNav()" class="icon"><i class="fas fa-bars fa-2x"></i></a>
  </nav>
  <!-- #nav-bar -->
</header>
<!-- #header -->
<div id="hero" class="section">
  <div class="herologo">
    <img src="https://image.ibb.co/mQnyc0/herologo.png" alt="Logo">
  </div>
  <!-- .herologo -->
  <div id="social-buttons">
    <a class="social-btn" target="_blank" href="https://facebook.com"><i class="fab fa-2x fa-fw fa-facebook-f"></i></a><br class="md">
    <a target="_blank" href="https://twitter.com/"><i class="fab fa-2x fa-fw fa-twitter"></i></a><br class="md">
    <a target="_blank" href="https://instagram.com"><i class="fab fa-2x fa-fw fa-instagram"></i></a><br class="md">
  </div>
  <!-- #social-buttons -->
  <form id="form" action="https://www.freecodecamp.com/email-submit">
    <h2 class="text-center">Quick! Place your orders now. Limited stocks available.</h2>
    <input id="email" class="text-center" name="email" type="email" placeholder="Enter your email address" required><br>
    <input id="submit" type="submit">
  </form>
</div>
<!-- #hero -->
<div id="features-section" class="section">
  <h1 class="text-center">Features</h1>
  <!-- .text-center -->
  <div id="features">
    <div class="feature">
      <div class="feature-icon">
        <i class="fas fa-fire fa-5x fa-fw"></i>
      </div>
      <div class="feature-description">
        <h3 class="text-center">Premium Materials</h3>
        <p class="text-center">Our Water Guns are crafted with premium materials. So that you can have fun with it for longer, without worrying about breaking it!</p>
      </div>
    </div>
    <!-- .feature -->
    <div class="feature">
      <div class="feature-icon">
        <i class="fas fa-shipping-fast fa-5x fa-fw"></i>
      </div>
      <div class="feature-description">
        <h3 class="text-center">Fast Shipping</h3>
        <p class="text-center ">Your Water Guns will be delivered within 2 days, no matter where you are in the country!</p>
      </div>
    </div>
    <!-- .feature -->
    <div class="feature">
      <div class="feature-icon">
        <i class="fas fa-undo fa-5x fa-fw"></i>
      </div>
      <div class="feature-description">
        <h3 class="text-center">Easy Return Policy</h3>
        <p class="text-center">We offer a no-questions-asked return policy to our customers for a week. We will even take care of the shipping!</p>
      </div>
    </div>
    <!-- .feature -->
  </div>
  <!-- #features -->
</div>
<!-- #features-section -->
<div id="how-it-works" class="section">
  <h1 class="text-center">See how it works</h1>
  <!-- .text-center -->
  <div id="video-frame">
    <iframe id="video" width="560" height="315" src="https://www.youtube.com/embed/9j7z1nR3ZKU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  </div>
</div>
<!-- #how-it-works -->
<div id="pricing" class="section">
  <h1 class="text-center">Pricing</h1>
  <!-- .text-center -->
  <div class="types">
    <div class="type">
      <div class="type-img">
        <img src="https://image.ibb.co/kp7nn0/pistol.jpg" alt="Water Pistol" class="img-circle">
      </div>
      <!-- .type-img -->
      <div class="type-description">
        <h2 class="text-center">6" Water Pistol</h2>
        <h3 class="text-center price">$5</h3>
        <ul>
          <li>Lorem ipsum dolor sit.</li>
          <li>Lorem ipsum dolor sit amet.</li>
          <li>Lorem ipsum dolor.</li>
        </ul>
        <button class="select">Select</button>
      </div>
      <!-- .type-description -->
    </div>
    <!-- .type -->
    <div class="type">
      <div class="type-img">
        <img src="https://image.ibb.co/gb2bfL/rifles.jpg" alt="Water Rifles" class="img-circle">
      </div>
      <!-- .type-img -->
      <div class="type-description">
        <h2 class="text-center">17" Water Rifle</h2>
        <h3 class="text-center price">$10</h3>
        <ul>
          <li>Lorem ipsum dolor sit.</li>
          <li>Lorem ipsum dolor sit amet.</li>
          <li>Lorem ipsum dolor.</li>
        </ul>
        <button class="select">Select</button>
      </div>
      <!-- .type-description -->
    </div>
    <!-- .type -->
    <div class="type">
      <div class="type-img">
        <img src="https://image.ibb.co/bTLU0L/backpack.jpg" alt="Gun with backpack" class="img-circle">
      </div>
      <!-- .type-img -->
      <div class="type-description">
        <h2 class="text-center">Water Rifle with Backpack</h2>
        <h3 class="text-center price">$20</h3>
        <ul>
          <li>Lorem ipsum dolor sit.</li>
          <li>Lorem ipsum dolor sit amet.</li>
          <li>Lorem ipsum dolor.</li>
        </ul>
        <button class="select">Select</button>
      </div>
      <!-- .type-description -->
    </div>
    <!-- .type -->
  </div>
  <!-- .types -->
</div>
<!-- #pricing -->

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

CSS

              
                $blue: #5d44ff;
$x: #ede9e9;
$gray: #e6e4e2;
$orange: #ffae44;
$white: #fff;
$text-default: #000;

$comp: #ffac3f;

@import url('https://fonts.googleapis.com/css?family=Montserrat');

html {
	scroll-behavior: smooth;
}

body {
	// background: $orange;
	// font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow-x:hidden;
	font-family: "Montserrat",sans-serif;
	margin: 0;
	padding: 0;
}

.section {
	padding: 40px;
	padding-top: 75px;
}

.text-center {
	text-align: center;
}
.img-circle {
	max-width: 150px;
	border-radius: 50%;
}

#header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	padding: 10px;
	background: $comp;
	z-index: 10;
  border-bottom: 3px solid $blue;
	#header-img {
		max-width: 110px;
		margin-left: 30px;
	}
  
	ul {
		margin-right: 30px;
		list-style: none;
		li {
			font-size: calc(16px + 0.5vw);
			font-weight: bold;
			display: inline;
			padding: 10px;
			a {
				text-decoration: none;
				color: $blue;
			}
		}
	}
  
  .icon {
    display: none;
  }
}

#features-section
	#features {
		max-width: 1000px;
		margin: 0 auto;	
		// padding: 10px;
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		.feature {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-bottom: 20px;
			// justify-content: center;
			.feature-icon {
				padding: 20px 50px;
				.fas {
					color: $orange;	
				}
			}
			.feature-description {
				width: 100%;
			}
		}
	}


#hero {
	background: $orange;
	padding-top: 90px;
	color: white;
	.herologo {
		text-align: center;
		img {
			width: 300px;
		}
	}
	#form {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		text-align: center;
		#email {
			padding: 10px;
			border-style: solid;
			border-color: $blue;
			border-radius: 5px;
			min-width: 250px;
			font-family: FontAwesome, "Montserrat", sans-serif;
		}
		#email:focus {
			// box-shadow: 0 0 5px $blue;
		}
		#submit {
			background: $blue;
			padding: 10px;
			color: white;
			font-weight: bold;
			border-color: $blue;
			border-style: solid;
			border-radius: 2px;
			cursor: pointer;
		}
	}
}

#how-it-works {
	background: $orange;
	#video-frame {
		display: flex;
		justify-content: space-around;
		align-items: center;
	}
}
.types {
	display: flex;
	flex-direction: row;
	justify-content: space-around;
	align-items: center;
	/*margin: 30px;*/
}

.type {
  -webkit-box-shadow: 2px 2px 2px 2px #D6D6D6;
  box-shadow: 2px 2px 2px 2px #D6D6D6;
	width: 30%;
	min-width: 300px;
	max-width: 350px;
	/*max-width: 350px;*/
	border-top: 5px $blue solid;
	border-radius: 5px;
}

.type-img {
	background: #fffbf7;
	display: flex;
	min-height: 175px;
	justify-content: center;
	align-items: center;

	img {
		// border: 3px $blue solid;
	}
}

.type-description {
	background: $comp;
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
  
  .price {
    margin-top: 0;
    color: $blue;
  }
  
  .select {
    background: $blue;
    padding: 10px;
    color: white;
    font-weight: bold;
    border-color: $blue;
    border-style: solid;
    border-radius: 2px;
    cursor: pointer;
  }
}





 #social-buttons {
    position: absolute;
	// z-index: -10;
}

i.fab {
	display: inline-block;
	color: $orange;	
	background: white;
  border-radius: 60%;
  padding: 10px;
  margin: 10px;
}

@media screen and (max-width: 992px) {
	#features {
		width: 80vw;
		flex-direction: column!important;
	}
	.types {
		flex-direction: column!important;
    .type {
      margin-bottom: 20px;
    }
	}
}

@media (max-width: 1024px) {
    #social-buttons {
        display: flex;
        position: relative;
        justify-content: center;
        left: 0;
    }
    .md {
        display: none;
    }
} 

@media screen and (max-width: 768px) {
  #header {
    .icon {
      display: block;
      margin-right: 30px;
    }
    ul {
      display: none;
    }
    
    ul.responsive {
      // border-top: 2px solid $blue;
      border-bottom: 4px solid $blue;
      display: block;
      position: absolute;
      top: 60px;
      right: 0;
      margin: 10px;
      width: 100%;
      text-align: center;
      padding-right: 15px;
      background: $orange;
      li {
        display: block;
      }
    }
  }
}
              
            
!

JS

              
                function alignBtn() {
  if (window.innerWidth > 1024) {
    document.getElementById("social-buttons").style.top =
      document.getElementById("hero").offsetHeight / 2 - 50 + "px";
  } else {
    document.getElementById("social-buttons").style.top = "";
  }
}

function toggleNav() {
  var x = document.getElementById('nav-list');
  if (x.className === "") {
    x.className += "responsive";
  } else {
    x.className = "";
  }
}
alignBtn();
window.addEventListener("resize", alignBtn);

              
            
!
999px

Console