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 

-->
<!DOCTYPE html>

    <div id="sidebar">
      <img src="https://assets.codepen.io/1640434/surfer.png" alt="" />
      <!-- User story 1-->

      <h1 id="title">Go Surf</h1>
      <!--User story 2-->

      <p id="description">
        Book your luxury surf holiday
      </p>
    </div>

    <div id="form__body">
      <!--User story 11: need to add placeholder text-->
      <!--User story 3-->
      <h1 id="title-mob" class="mobile-view">Go Surf</h1>
      <!--User story 2-->

      <p id="description-mob" class="mobile-view">
        Book your luxury surf holiday
      </p>
      <form id="survey-form">
        <div class="form-item">
          <!--User story 4 10-->
          <label for="name" id="name-label">Name:</label>
          <input type="text" id="name" required placeholder="Your name" />
        </div>
        <div class="form-item">
          <!--User story 5/6 10-->
          <label for="email" id="email-label">Email:</label>
          <input type="email" id="email" required placeholder="Your email" />
        </div>
        <div class="form-item">
          <!--User story 7/8/9/10-->
          <label for="number" id="number-label">Number of guests:</label>
          <input
            type="number"
            id="number"
            min="1"
            max="10"
            placeholder="Number of guests"
          />
        </div>
        <div class="form-item" id="package-selection">
          <h2>Preferred package:</h2>
          <!-- Add dropdown US 12-->
          <select name="dropdown" id="dropdown">
            <option value="basic-package"
              >Basic package £595
              <span>
                (includes: surf school 5 days, board and wetsuit hire)</span
              >
            </option>
            <option value="basic-plus">
              Basic plus daily Yoga £795
              <span>
                (includes: surf school 5 days, board and wetsuit hire plus
                morning yoga)</span
              >
            </option>
            <option value="lux-package">
              Luxuary package £995<span>
                (includes: everything in basic plus yoga with luxuary beach
                front accomodation)</span
              >
            </option>
          </select>
        </div>

        <div class="form-item" id="meal-choices">
          <h2>
            Dietry preference
          </h2>
          <!-- Add Radio US13-->
          <label>
            Varied Diet (Meat, Fish, Veg)

            <input
              type="radio"
              id="meat-radio"
              name="placeholder-name"
              value="meat"
            />
          </label>

          <label>
            Vegetarian Diet (Eggs, Diary Veg)

            <input
              type="radio"
              id="veg-radio"
              name="placeholder-name"
              value="veg"
            />
          </label>
          <label
            >Vegan Diet (Beans, pulses, veg)
            <input
              type="radio"
              id="vegan-radio"
              name="placeholder-name"
              value="vegan"
            />
          </label>
        </div>

        <div class="form-item extras">
          <!--US 14: need to add value atrib-->
          <h2>
            Optional extras
          </h2>
          <label for="hot-balloon"
            >Hot Airballoon

            <input type="checkbox" id="hot-balloon" value="hot-balloon" />
          </label>
          <label for="kitesurf"
            >Kitesurfing

            <input type="checkbox" id="kitesurf" value="kitesurf" />
          </label>
          <label for="cliff-jump"
            >Cliff Jumping

            <input type="checkbox" id="cliff-jump" value="cliff-jump" />
          </label>
        </div>
        <div class="form-item">
          <!-- US15 Text area-->
          <textarea
            name="extra-info"
            cols="30"
            rows="10"
            placeholder=" Anything else you would like us to know?"
          ></textarea>
        </div>
        <div class="form-item">
          <!--US16 - Submit-->
          <button id="submit">Submit</button>
        </div>
      </form>
    </div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;900&display=swap");

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  font-size: 10px;
}
h1,
p {
  padding-top: 1.6rem;
  color: White;
  letter-spacing: 0.2rem;
}

.mobile-view {
  display: none;
}

h1 {
  font-size: 2.5rem;
  padding-top: 10%;
}

h2 {
  font-size: 2.5rem;
  padding-bottom: 1rem;
}
p {
  font-size: 1.6rem;
}

body {
  max-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 3fr;
  overflow-x: auto;
  font-family: Arial, Helvetica, sans-serif;
}

#sidebar {
  height: 100%;
  position: relative;
  text-align: center;
  -webkit-box-shadow: 42px -1px 45px -32px rgba(0, 0, 0, 0.55);
  -moz-box-shadow: 42px -1px 45px -32px rgba(0, 0, 0, 0.55);
  box-shadow: 42px -1px 45px -32px rgba(0, 0, 0, 0.55);
}

#sidebar img {
  position: absolute;
  display: block;
  max-width: 100%;
  height: 100%;
  z-index: -1;
}
#form__body {
  background: url("https://assets.codepen.io/1640434/sunset.jpeg") center
    no-repeat;
  background-size: cover;
  margin: auto 0;
  padding: 5% 15%;
}
form {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 1%;
}

.form-item {
  padding: 1rem 2rem;
}

.form-item > * {
  font-size: 2rem;
  padding-top: 1rem;
  width: 100%;
}

.extras,
#meal-choices {
  display: flex;
  flex-direction: column;

  width: 50%;
}

label {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

@media only screen and (max-width:900px) {
  body {
    display: grid;
    grid-template-columns: 1fr;
  }

  #sidebar {
    display: none;
  }

  .extras,
  #meal-choices {
    display: flex;
    flex-direction: column;

    width: 100%;
  }
  .mobile-view {
    display: block;
    text-align: center;
  }
  p {
    padding-bottom: 1rem;
  }
}

              
            
!

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