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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <div id='app'>

  <hr />
  <div v-if="isVisible" class="container">

    <!-- v-model assigns value from input to given variable (two-way data binding) -->

    <!-- WAX WEIGHT -->
    <input id="waxWeight" class="wax-weight" v-model="waxWeight" placeholder="Wax Weight" />

      <input name="radio" class="radio" type="radio" id="rRbutton1" v-model="metalType" value="silver">
      <label for="rButton1">Sterling Silver</label>
      <input name="radio" class="radio" type="radio" id="rButton6" v-model="metalType" value="bronze">
      <label for="rButton6">Bronze</label>
      <input name="radio" class="radio" type="radio" id="rButton2" v-model="metalType" value="wGold14">
      <label for="rButton2">White Gold 14K</label>
      <input name="radio" class="radio" type="radio" id="rButton3" v-model="metalType" value="wGold18">
      <label for="rButton3">White Gold 18K</label>
      <input name="radio" class="radio" type="radio" id="rButton4" v-model="metalType" value="yGold14">
      <label for="rButton4">Yellow Gold 14K</label>
      <input name="radio" class="radio" type="radio" id="rButton5" v-model="metalType" value="yGold18">
      <label for="rButton5">Yellow Gold 18K</label>

    <!-- BUTTON SIZE -->
    <input id="buttonSize" class="button-size" v-model="buttonSize" placeholder="Button Size" />

    <!-- @keyup.enter is an event modifier -->
    <button @keyup.enter="calc(metalType, waxWeight, buttonSize)" @click="calc(waxWeight, buttonSize, metalType )">Calculate</button>





                import Vue from "";

// Take input data from user for metalType, waxWeight, and buttonSize
// Calculate metalType using formula:
// specificGravity * ((waxWeight * buttonSize) + waxWeight)

  // DATA
  data() {
    return {
      waxWeight: "",
      isVisible: true,
      buttonSize: "",
      specificGravity: "",
      metalType: ""

  components: {},

  // `this` inside methods point to the current Vue instance

  methods: {
    calc: function (waxWeight, buttonSize, metalType) {
      const metals = [
        { type: "silver", specificGravity: 10.3 },
        { type: "wGold14", specificGravity: 12.1 },
        { type: "wGold18", specificGravity: 11.5 },
        { type: "yGold14", specificGravity: 13.6 }

      const specificGravity = metals.find(function (elem) {
        if (elem.type == metalType) {
          return elem.specificGravity;