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

              
                <link href='https://fonts.googleapis.com/css?family=Satisfy' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Quicksand:700' rel='stylesheet' type='text/css'>
<div id="logo">
  <center>
      <h1>Price Calculator</h1>
    <h5>301 | Granite & Marble</h5>
  </center>
</div>

<div id="cHolder">
<form METHOD="GET" TARGET="_self">

  <label for="gName">Select Granite:</label>
  <select id="gName" class="gName" name="gName">
    <option value="0" id="empty" name="empty">Select..</option>
    <option value="11.5" id="bGalaxy" name="bGalaxy">Black Galaxy</option>
    <option value="5.5" id="Onyx" name="Onyx">Onyx</option>
  </select>
  <input type="text" id="spfPrice" readonly />
  <br>
  <br>

  <label for="gEdge">Select Edge:</label>
  <select id="gEdge" name="gEdge" class="gName">
    <option value="0" id="empty" name="empty">Select..</option>
    <option value="2.5" id="eOgy" name="eOgy">Ogy</option>
    <option value="1.5" id="eFlat" name="eFlat">Flat</option>
  </select>
  <input type="text" readonly id="ePrice" />
  <br>
  <br>
  

  <label for="width">Width:</label>
  <input type="text" id="width" name="width" />
<select id='measurement' name="measurement">
    <option id="in" name="in" value="in">In.</option>
    <option id="ft" name="ft" value="ft">Ft.</option>
  </select>
  <label for="length">Length:</label>
  <input type="text" id="length" name="length" />
<select id='measurement' name="measurement">
    <option id="in" name="in" value="in">In.</option>
    <option id="ft" name="ft" value="ft">Ft.</option>
  </select>
  <br>
  <br>
<label for="sQty">Sink Qty:</label>
  <select id="sQty" name="sQty" class="sQty">
    <option value="0" id="empty" name="empty">Select..</option>
    <option value="1" id="one" name="one">1</option>
    <option value="2" id="two" name="two">2</option>
     <option value="3" id="three" name="three">3</option>
    <option value="4" id="four" name="four">4</option>
     <option value="5" id="five" name="five">5</option>
    <option value="6" id="six" name="six">6</option>
  </select>
  <br>
  <br>
  
  <input type="button" name="cForm" class="button" id="cForm" value="Calculate"  />
  
   <br>
</form>


<div id="result">
  <br>
  <br>
  <hr>
  
  <form action="#" method="post">
    <h3>Price will be..</h3>
  <label for="gSpf">Granite:</label>
  <input type="text" name="gSpf" id="gSpf" readonly />Sqf
  <br>
  <br>
  <label for="gPrice">Granite Price:</label>
  $
  <input type="text" name="gPrice" id="gPrice" readonly/>
  <br>
  <br>
  <label for="gePrice">Granite Edge Price:</label>
  $
  <input type="text" name="gePrice" id="gePrice" readonly/>
  <br>
  <br>
  <label for="sPrice">Sink Price:</label>
  $
  <input type="text" name="sPrice" id="sPrice" readonly/>
  <br>
  <br>
  <label for="total">Total:</label>
  $
  <input type="text" name="total" id="total" readonly/>
    <label for='type'></label><input name="type" value="" type="checkbox" />All Price is correct. Click to add!<br />
    <br>
    <input type="button" class="button" value="Reload" onClick="history.go(0)">
    <br>
  </form>
</div>
</div>


   
              
            
!

CSS

              
                #result {
  display: none;
}
h1{
  font-family:Satisfy;
}
h5{
  font-family:Quicksand;
  position:relative;
  bottom:30px;
}
body{
  background-color:	#F0F0F0 ;
}
button{
  width:100px;
}
.button{
  width:100px;
  float:right;
}
#cHolder {
  width: 520px;
  height: auto;
  margin: auto;
  padding: 15px;
  border: 2px black solid;
  background-color:#E8E8E8;
  border-radius:5px;
}
h3{
  font-family:Quicksand;
}
label{
  font-size:15px;
  font-family:Tahoma, Geneva, sans-serif;
}
input{
  height:15px;
  width:auto;
  font-size:14px;
}

.gName {
    border: 1px solid #ccc;
    width: 120px;
    overflow: hidden;
    background: #fafafa url("img/icon-select.png") no-repeat 90% 50%;
}

.gName select {
    padding: 5px 8px;
    width: 130%;
    border: none;
    box-shadow: none;
    background: transparent;
    background-image: none;
    -webkit-appearance: none;
}

.gName select:focus {
    outline: none;
}
              
            
!

JS

              
                $(document).ready(
  function() {
    $("#cForm").click(function() {
      $("#result").fadeToggle();
    });
    
      
    
      
      $('#width, #length').keyup(function() {
      var rate = parseFloat($('#width').val()) || 0;
      var box = parseFloat($('#length').val()) || 0;
        if($('#measurement').val() == 'ft' ) {
      $('#gSpf').val(rate * box);
        }else {
          $('#gSpf').val(rate * box / 144);
        }
                                 
      var gSpf = $('#gSpf').val();
      var spfPrice = $('#spfPrice').val();
      $('#gPrice').val(gSpf * spfPrice *3);
  
      
        
      var gePrice = $('#gePrice').val();
      var ePrice = $('#ePrice').val();
      $('#gePrice').val(gSpf * ePrice);
      
        

    });
      
   
    $('#gName').change(function() {
      $('#spfPrice').val($('#gName').val() * 1);
    });

    $('#gEdge').change(function() {
      $('#ePrice').val($('#gEdge').val() * 1);
    });
    
     $('#sQty').change(function() {
      $('#sPrice').val($('#sQty').val() * 20);
    });
    
   
    
   function compute() {
    if ( $('input[name=type]:checked').val() != undefined ) {
        var a = parseInt($('input[name=gPrice]').val());
        var b = parseInt($('input[name=gePrice]').val());
        var c = parseInt($('input[name=sPrice]').val());
        var total = a+b+c;
        $('#total').val(a+b+c);
    }
}

jQuery('form').delegate('input[name=type], input[name=gPrice], input[name=gePrice], input[name=sPrice]','change', compute);
    
   
        
  
  });








              
            
!
999px

Console