cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <link href="https://fonts.googleapis.com/css?family=Rubik:400,400i,500" rel="stylesheet">

<div class="grid-container__container">
  <div class="calculator calculator__your-project">
    <h2 class="calculator__title">Your Project</h2>
    <h3 class="calculator__subtitle">What sort of job?</h3>
    <select class="job-dropdown">
      <option class="dropdown-option">Design</option>
      <option class="dropdown-option">Development</option>
      <option class="dropdown-option">Design and Development</option>
      <option class="dropdown-option">Maintenance</option>
    </select>
    <h3 class="calculator__subtitle">How many pages?</h3>
    <select class="pages-dropdown">
      <option class="dropdown-option">1</option>
      <option class="dropdown-option">2-5</option>
      <option class="dropdown-option">6-9</option>
      <option class="dropdown-option">10+</option>
    </select>
    <h3 class="calculator__subtitle budget">What is your budget?</h3>
    <select class="budget-dropdown">
      <option class="dropdown-option" value="1000">£500-£1000</option>
      <option class="dropdown-option" value="2000">£1000-£2500</option>
      <option class="dropdown-option" value="5000">£2500-£5000</option>
      <option class="dropdown-option" value="6000">£5000+</option>
    </select>
    <h3 class="calculator__subtitle">What is the timeframe?</h3>
    <select class="timeframe-dropdown">
      <option class="dropdown-option">1 Week</option>
      <option class="dropdown-option">2-5 Weeks</option>
      <option class="dropdown-option">6-9 Weeks</option>
      <option class="dropdown-option">10+ Weeks</option>
    </select>
  <button id="submit-quote" class="button-style button-style--green">Submit Quote</button>

  </div>
  <div class="calculator calculator__your-quote">
    <h2 class="calculator__title">Your Quote</h2>
    <h3 class="price">£...</h3>
    <p class="calculator__your-quote--info"> - This is not a finalised price but should
      be very close. </p>
    <p class="calculator__your-quote--info"> - Happy? Drop me an email! </p>
    <button id="email-me" class="button-style button-style--green">Email Me</button>
  </div>
</div>
            
          
!
            
              html, body {
  padding: 0;
  margin: 0;
}

html, select, button {
  font-family: 'Rubik', sans-serif;
  background-color: #014f92;
}

.grid-container__container {
  display: grid;
  grid-template-columns: 18% 30% 2.5% 30% 15%;
  grid-template-rows: 15% 70% 15%;
}

.calculator {
  background-color: #f2f4f5;
  height: 480px;
  padding: 5px 40px;
  border-radius: 6px;
  margin: 10px 0;
  
  -webkit-box-shadow: 0px 5px 0px 1px     rgba(216,216,216,1);
  -moz-box-shadow: 0px 5px 0px 1px rgba(216,216,216,1);
  box-shadow: 0px 5px 0px 1px rgba(216,216,216,1);
}

.calculator.calculator__your-project {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

h2.calculator__title {
  font-size: 24px;
  color: #232323;
}

h3.calculator__subtitle {
  font-size: 18px;
  font-weight: 400;
  color: #232323;
}

select {
  border: none;
  background-color: #dfdfdf;
  font-size: 14px;
  color: #5b5b5b;
  padding: 5px;
}

.calculator.calculator__your-quote {
  grid-column: 4 / 5;
  grid-row: 2 / 3;
}

h3.price {
  font-size: 42px;
  color: #0070db;
  text-align: center;
  padding: 50px 0px
}

p.calculator__your-quote--info {
  font-size: 18px;
  font-weight: 400;
  color: #232323;
}

button.button-style {
  display: block;
  padding: 12px 12px;
  font-weight: 500;
  margin-top: 20px;
  border: none;
  outline: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

button.button-style--green {
  background-color: #23c873;
  -webkit-box-shadow: 0px 2px 0px 1px rgba(24,186,102,1);
  -moz-box-shadow: 0px 2px 0px 1px rgba(24,186,102,1);
  box-shadow: 0px 2px 0px 1px rgba(24,186,102,1);
}

@media only screen and (max-width: 750px) {
  
  .grid-container__container {
  display: grid;
  grid-template-columns: 8.5% 40% 2.5% 40% 5%;
  grid-template-rows: 15% 70% 15%;
}
  
}
            
          
!
            
              const jobDropdown = document.querySelector(".job-dropdown");
const pagesDropdown = document.querySelector(".pages-dropdown");
const budgetDropdown = document.querySelector(".budget-dropdown");
const timeframeDropdown = document.querySelector(".timeframe-dropdown");


const price = document.querySelector(".price");
const submitQuote = document.getElementById("submit-quote");

submitQuote.addEventListener('click', function(){
  
  //Hourly Rate x Estimated time of 4 hours per page
  if (pagesDropdown.options[pagesDropdown.selectedIndex].text == "1") {
    answer = 30 * 5;
  } else if (pagesDropdown.options[pagesDropdown.selectedIndex].text == "2-5") {
    answer = 30 * 15;
  } else if (pagesDropdown.options[pagesDropdown.selectedIndex].text == "6-9") {
    answer = 30 * 30;
  } else {
    answer = 30 * 50;
  }
  
  //Multiply depending on type of work
  if (jobDropdown.options[jobDropdown.selectedIndex].text == "Design") {
    answer = answer * 1.5;
  } else if (jobDropdown.options[jobDropdown.selectedIndex].text == "Development") {
    answer = answer * 2;
  } else if (jobDropdown.options[jobDropdown.selectedIndex].text == "Design and Development") {
    answer = answer * 3;
  } else 
    answer = answer;
  
  //Multiply price depending on timeframe
  if (timeframeDropdown.options[timeframeDropdown.selectedIndex].text == "1 Week") {
    answer = answer * 3;
  } else if (timeframeDropdown.options[timeframeDropdown.selectedIndex].text == "2-5 Weeks") {
    answer = answer * 2;
  } else {
    answer = answer;
  }
  
  //If budget is lower than price, take £50 off
   if (budgetDropdown.options[budgetDropdown.selectedIndex].value < answer) {
    answer = answer - 50;
  }
  
  price.innerHTML = "£" + answer;
  
});
            
          
!
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.
Loading ..................

Console