123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="questions">

  <div>
    <p>How many pages do you need?</p>
    <select>
      <option value="0" selected>-</option>
      <option value="1">1 - 5</option>
      <option value="2">6 - 12</option>
      <option value="3">13+</option>
    </select>
  </div>

  <div>
    <p>Do you have content?</p>
    <select>
      <option value="0" selected>-</option>
      <option value="2">I have it</option>
      <option value="3">I need help organizing it</option>
      <option value="1">Just use placeholder content</option>
    </select>
  </div>
  
  <div>
    <p>Do you have images?</p>
    <select>
      <option value="0" selected>-</option>
      <option value="2">I have images</option>
      <option value="3">I need images</option>
      <option value="1">Use placeholder images</option>
    </select>
  </div>

  <div>
    <p>Do you need a blog or blog-like section?</p>
    <select>
      <option value="0" selected>-</option>
      <option value="2">Yes</option>
      <option value="1">No</option>
      <option value="3">I'll need more than one</option>
    </select>
  </div>

  <div>
    <p>Does your email signup form need to integrate with a third-party email vendor (like Mailchimp or Klaviyo)?</p>
    <select>
      <option value="0" selected>-</option>
      <option value="2">Yes</option>
      <option value="1">No</option>
      <option value="1">I don't want an email signup</option>
    </select>
  </div>
  
  <div id="final">&nbsp;</div>
  
</div>
            
          
!
            
              .questions {
  font-family:helvetica, arial, sans-serif;
  padding-bottom:1em;
}
.questions #final {
  background:rgba(255,255,255,1);
  border:1px solid rgba(0,0,0,.05);
  box-shadow:0 0 1em rgba(0,0,0,.1);
  box-sizing:border-box;
  margin:1em;
  min-height:4.5em;
  min-width:200px;
  padding:2em 1em 1em 1em;
  position:relative;
  z-index:2000;
}
.questions #final:before {
  content:"Package";
  font-size:.5em;
  opacity:.5;
  position:absolute;
  text-transform:uppercase;
  transform:translateY(-150%);
}
.questions #final:after {
  content:"▾ More information below";
  font-size:.5em;
  opacity:.5;
  left:1.75em;
  opacity:.25;
  position:absolute;
  text-transform:uppercase;
  transform:translateY(5.5em);
}
.questions div {
  border-bottom:1px solid rgba(100,100,100,.1);
  padding:1em .5em;
}
.questions div:last-of-type {
  border-bottom:none;
}
            
          
!
            
              var allSelects = document.querySelectorAll("select");

allSelects.forEach(function(e) {
  e.addEventListener('change',findAnswer);
});
findAnswer();

function findAnswer() {
  var final = 0;
  allSelects.forEach(function(e) {
    if (e.options[e.selectedIndex].value > final) {
       final = e.options[e.selectedIndex].value;
     }               
  });
  var finalOutput = document.getElementById("final");
  
  if (final == 3) {
    finalOutput.innerText = "Fully Custom: $4,000 - $10,000";
  } else if (final == 2) {
    finalOutput.innerText = "Finished Site: $2,500";
  } else if (final == 1) {
    finalOutput.innerText = "Foundation: $1,000";
  } else {
    finalOutput.innerText = "";
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console