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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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>

<!-- 

Hello Camper!

For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding! 

- The freeCodeCamp Team 

-->

    <header id="header">
      <img src="" alt="" id="header-img" />
      <div id="menu-wrap">
        <input type="checkbox" id="toggler" />
        <div id="burger"><div></div></div>

        <nav id="nav-bar">
          <h1>Drones</h1>
          <div>
            <div>
              <ul class="nav">
                <!--Need to add links to various sections-->
                <li><a href="#overview" class="nav-link">Overview</a></li>
                <li><a href="#tech" class="nav-link">Specs</a></li>
                <li><a href="#buy" class="nav-link">Buy</a></li>
              </ul>
            </div>
          </div>
        </nav>
      </div>
    </header>
    <!--Main seciton-->
    <main>
      <section id="video-section">
        <div class="container">
          <div id="banner-text">
            <a id="overview"></a>
            <h1>The Future of Drone Technology</h1>
            <p>
              Featuring a 1-inch CMOS sensor that can shoot 4K/60fps videos and
              20MP photos, the Phantom 4 Pro V2.0 grants filmmakers absolute
              creative freedom. The OcuSync 2.0 HD transmission system ensures
              stable connectivity and reliability, five directions of obstacle
              sensing ensures additional safety, and a dedicated remote
              controller with a built-in screen grants even greater precision
              and control. [1] A wide array of intelligent features makes flying
              that much easier. The Phantom 4 Pro V2.0 is a complete aerial
              imaging solution, designed for the professional creator.
            </p>

            <a href="" class="btn">Learn More</a>
          </div>
          <div id="drone-img">
            <img src="https://assets.codepen.io/1640434/drone.png" alt="" />
          </div>

          <div id="tech-specs">
            <a id="tech"></a>
            <div>
              <img class="" src="https://assets.codepen.io/1640434/4k.webp" alt="" />
              <h3>4k/60fps</h3>
            </div>
            <div>
              <img class="" src="https://assets.codepen.io/1640434/sensor.webp" alt="" />
              <h3>1-inch Sensor</h3>
            </div>
            <div>
              <img class="" src="https://assets.codepen.io/1640434/obstacles.svg" alt="" />
              <h3>5 direction obstacle sensing</h3>
            </div>
            <div>
              <img class="" src="https://assets.codepen.io/1640434/shutter.webp" alt="" />
              <h3>Mechanical Shutter</h3>
            </div>
            <div>
              <img class="" src="https://assets.codepen.io/1640434/transmission.webp" alt="" />
              <h3>OcuSync Transmission</h3>
            </div>
            <div>
              <img class="" src="https://assets.codepen.io/1640434/flighttime.webp" alt="" />
              <h3>30 Minute Flight Time</h3>
            </div>
          </div>

          <video
            id="video"
            src="https://assets.codepen.io/1640434/drone_mountains_small.mp4"
            autoplay
            loop
            muted
          ></video>
          <video id="forest" src="https://assets.codepen.io/1640434/forest_small.mp4" autoplay loop muted></video>
          <video id="surf" src="https://assets.codepen.io/1640434/surf_small.mp4" autoplay loop muted></video>
        </div>
      </section>
      <section id="call-to-action">
        <div class="form-container container">
          <a id="buy"></a>
          <h2>Sign up to be notified of release</h2>
          <form id="form" action="https://www.freecodecamp.com/email-submit">
            <input
              type="email"
              placeholder="email"
              id="email"
              name="email"
              required
            />
            <input
              type="submit"
              value="Join waiting list"
              id="submit"
              formaction="https://www.freecodecamp.com/email-submit"
            />
          </form>
        </div>
      </section>
    </main>
    <footer>
      <i class="fab fa-facebook-square fa-2x"></i>
      <i class="fab fa-instagram-square fa-2x"></i>
      <i class="fab fa-youtube fa-2x"></i>
      <i class="fab fa-twitter fa-2x"></i>
    </footer>

              
            
!

CSS

              
                * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

main {
  position: relative;
  top: 20px;
}
a {
  text-decoration: none;
  color: #f0f1f2;
}

a:hover {
  color: #758b71;
}

ul {
  list-style: none;
}

img {
  width: 100%;
  z-index: -1; /* drop shadow causes some strange behaviour here */
}

h1,
h2,
h3,
p,
a {
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.2rem;
}

.btn {
  color: #f0f1f2;
  background-color: #24252c;
  border-radius: 3px;
  padding: 10px;
}

video {
  width: 100%;
  height: 100%;
  object-fit: fill;
  box-shadow: black 2px 2px 10px;
}

.container {
  max-width: 1100px; /* standard */
  margin: auto; /* margin auto in middle even margin left and right */
  overflow: hidden; /* stops breaking out */
}

#header{
  position:fixed;
  top:0;
  z-index:5;
}

nav {
  display: inline-flex;
  justify-content: flex-end;
  position: fixed;
  width: 100%;
  font-size: 1.2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  background-color: #24252c;
  color: #f0f1f2;
  padding: 1rem;
  z-index: 5;
}

footer {
  display: flex;
  width: 100%;
  height: 60px;
  font-size: 1.2rem;
  background-color: #24252c;
  color: #f0f1f2;
  margin-top: 3rem;
  padding-top: 1rem;
  justify-content: space-evenly;
  align-items: center;
  overflow-y: hidden;
}

i {
  height: 50px;
  width: 50px;
}

#nav-bar .nav {
  justify-self: flex-end; /* move both items within the grid container to the right */
  display: flex; /* gets items side by side */
  align-items: center;
}

#nav-bar h1 {
  margin-right: auto;
  padding-left: 2rem;
}

#nav-bar .nav a {
  padding: 0rem 1.65rem;
}

#video-section {
  margin: 2rem 0;
}

#video-section h1,
p {
  padding: 3rem;
  text-align: center;
}

#video-section h1 {
  font-size: 3rem;
  padding-bottom: 1rem;
}

#video-section p {
  margin: 1rem 0;
  font-size: 1.2rem;
}
#video-section .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  justify-content: center;
}

#drone-img {
  grid-column: 1/3;
  display: flex;
  text-align: center;

  filter: drop-shadow(1px 5px 4px);
}

#tech-specs {
  display: flex;
  flex-wrap: wrap;
  text-align: center;
  grid-column: 1/3;
  position: relative;
}

#tech-specs div {
  flex-basis: 33.3333333%;
}

#tech-link,
#overview,
#cta {
  display: inline;
  position: absolute; /*  THis approach is probably not ideal but keeps it in CSS and works for this usecase*/
  top: -65px;
}

#tech-specs img {
  height: 50px;
  width: 50px;
}

#banner-text {
  grid-column: 1/3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
}

#video-section .container #video {
  grid-column: 1 / 2;
}

#video-section .container #surf {
  width: 100%;
  height: 100%;
  grid-column: 1 / 3;
}

#call-to-action .container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  text-align: center;
}

form {
  display: flex;
  align-content: center;
  justify-content: center;
}

form > input {
  font-size: 1.3rem;
  padding: 8px;
  border-radius: 5px;
}

#email {
  width: 330px;
  margin-right: 1.5rem;
}

#submit {
  background-color: #24252c;
  color: #f0f1f2;
}

/* Need to do this*/
@media only screen and (max-width: 600px) {
  * {
    padding: 0;
    margin: 0;
  }

  nav > * {
    visibility: hidden;
  }

  #toggler:checked ~ nav > div {
    visibility: visible;
    width: 100%;
    height: 33vh;
  }

  #toggler:checked ~ #nav-bar .nav {
    display: inline-block;
    position: absolute;
    text-align: right;
    top: 25%;
    right: 0;
  }

  #toggler:checked ~ #nav-bar .nav a {
    padding: 1rem 1.65rem;
  }

  #toggler:checked ~ #nav-bar .nav li {
    padding: 1rem;
  }

  #tech-link,
  #overview,
  #cta {
    top: -40vh;
  }

  #menu-wrap {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 3;
  }

  #menu-wrap #toggler {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    cursor: pointer;
    width: 50px;
    height: 50px;
    opacity: 0;
  }

  #menu-wrap #burger {
    position: absolute;
    top: 10px;
    right: 25px;
    z-index: 2;
    width: 50px;
    height: 50px;
    background: rgb(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #menu-wrap #burger > div {
    position: relative;
    width: 100%;
    height: 5px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
  }

  #menu-wrap #burger > div:before,
  #menu-wrap #burger > div:after {
    content: "";
    position: absolute;
    z-index: 2;
    top: -10px;
    width: 100%;
    height: 5px;
    background: white;
  }

  #menu-wrap #toggler:checked + #burger > div {
    transform: rotate(135deg);
  }
  /* turn lines into x */
  #menu-wrap #toggler:checked + #burger > div:before,
  #menu-wrap #toggler:checked + #burger > div:after {
    top: 0;
    transform: rotate(90deg);
  }

  #menu-wrap #burger > div:after {
    top: 10px;
  }

  #video-section .container,
  #call-to-action .container {
    display: flex;
    flex-wrap: wrap;
    padding-bottom: 10px;
  }

  #tech-specs {
    display: flex;
    flex-wrap: wrap;
    text-align: center;
    padding-bottom: 10px;
  }

  #tech-specs div {
    flex-basis: 50%;
    padding-bottom: 10px;
  }

  form {
    flex-basis: 100%;
    flex-wrap: wrap;
    padding-bottom: 10px;
  }

  #email {
    margin: 1rem;
    padding-bottom: 10px;
  }
}

              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console