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.

            
              <!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="BBC.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

</head>

    <body bgcolor="black">
<div class='sheet'>
<div class="container-fluid">

    <h1 class='title'>Bar Bell Buddy</h1>

 
<div Class='sections'> 
 <h1> Find Your Percentage </h1>
 <p1 class='sections'> Please enter your max lift and desired percentage you intend on lifting at.  We have accounted for the bar weight in our calculation.  For example, enter your max squat and then the percentage you want to lift.  We will tell you how much weight to put onto the bar </p1> 
 </div>


<form id='myform' class="form">

<input id='male' type="radio" name="gender" value="male" checked> Male

<input id='female' type="radio" name="gender" value="female" checked> Female<br>

<input id='kilos' type="radio" name="measurement" value="Kilos" checked> Kilos

<input id='pounds' type="radio" name="measurement" value="Pounds" checked> Pounds<br>

Please enter max weight: <br>

<input id='max' type="text" name="maxWeight"><br>

Please enter desired percentage: <br>

<input id='percentage' type="text" name="desiredPercentage"><br>

<input type="button" value="Submit" onclick="calculateWeight();">

</form>

<br>

    <div class='result' id='result' class='answerBox'>

 <p></p>

    </div> 








<div class="col-md-6">
<h1 class='sections'> Convert Kilos to Pounds </h1>

<p class='sections'> Enter the total weight you are lifting (including the bar)</p>

<form id='myform' class="form">


Please Enter Kilos: <br>

<input id='weight' type="text" name="Weight"><br>


<input type="button" value="Submit" onclick="ConvertKilos()">

</form>

 <div class='result' id='result2' class='answerBox'>

<p></p>

    </div> 
   </div>


<div class="col-md-6">


<h1 class='sections'> Convert Pounds to Kilos </h1>

<p class='sections'> Enter the total weight you are lifting (including the bar)</p>

<form id='myform' class="form">


Please Enter Pounds: <br>

<input id='weight' type="text" name="Weight"><br>


<input type="button" value="Submit" onclick="ConvertPounds()">

</form>
<div class='result' id='result3' class='answerBox'>

<p></p>

    </div> 
    </div>
    












<p></p>
<p></p>
<p></p>
<p></p>


<div class='youtube'>

<p> Need Motivation?</p>


<iframe width="385" height="345"
src="https://youtube.com/embed/3eGgWEr-Vv8">
</iframe>

</div>


<div class='disclaimer'> <p>*This app is not liable for any injury occuring while using this app*</p>
</div>
</div>
</div>
 
<!--this is how to link JS files -->   

<script src="BBC.js"></script> 



    </body>

</html>
            
          
!
            
              .sheet{
	background-color: black;
}
.answerBox{
	color:red;
	border-color:white;
	text-align: center;

}

.form{
color: red;
background-color:black;
text-align:center;
border-color: white;
font-size: 35px;
}

.result{
	font-size: 35px;
	text-align: center;
	color: red;

}
.sections{
	color:white;
	text-align:center;
	background-color: black;
}

.title{
	color: blue;
	text-align: center;
	font-size: 75px;
}

.youtube{
	text-align: center;
	color: green;
	font-size: 40px;
	text-decoration: underline;
}


.disclaimer{
	color: red;
	font-size: 15px;
	text-align: right;
}

.footer1{
  text-align: center;
  list-style-type: none;
  text-decoration:none; 
}
.footer{
  background-color: black;
  list-style-type: none;
  width: 100%;
  text-align: center;
  text-decoration:none; 

            
          
!
            
              var max;

var perc;

var calculatedResult; 

var enterWeight; 

var enterPercentage;

var plates = [45, 35, 25, 15, 10, 5, 2.5];

function calculateWeight () { 

 max = document.getElementById('max');

  perc = document.getElementById('percentage');

  enterWeight = max.value; 

  enterPercentage = perc.value;  

  calculatedResult = enterWeight * enterPercentage / 100; 

  

  if (document.getElementById('male').checked === true && document.getElementById('pounds').checked === true) {  

    calculatedResult = calculatedResult - 45; 

  } 

  else if (document.getElementById('male').checked === true && document.getElementById('kilos').checked === true)
   { 

    calculatedResult = calculatedResult - 20; 

  } 
else if (document.getElementById('female').checked === true && document.getElementById('pounds').checked === true)
   { 

    calculatedResult = calculatedResult - 35; 

  } 
else
 {
  calculatedResult = calculatedResult - 15.8;
}
  console.log('enterWeight', enterWeight); 

  console.log('enterPercentage', enterPercentage);

  console.log(calculatedResult); 

  document.getElementById('result').innerHTML = 'Load Up ' + calculatedResult 

  

}


/* trying to display the plates they should use 

var plates = [45, 35, 25, 10, 5, 2.5];
var putThemOn = [0,0,0,0,0,0];

function whatPlates(calculatedWeightToLift){
  
  var i = 0;

  while (i < plates.length) {
    if (2*plates[i]<=calculatedWeightToLift) {
      calculatedWeightToLift = calculatedWeightToLift - (2*plates[i]);
      putThemOn[i] += 2;
    }
    if (2*plates[i]>=calculatedWeightToLift) {
      i++;
    }
  }
  return putThemOn;
}
console.log(whatPlates(425));

function doubleIt(inpoot) {
  var fortyFive = inpoot[0];
  var thirtyFive = inpoot[1];
  var twentyFive = inpoot[2];
  var ten = inpoot[3];
  var five = inpoot[4];
  var twoPointFive = inpoot[5];
  return"Put on " + fortyFive + " 45 lb. plates, " + (fortyFive/2) + " on each side," +
  "\n Put on " + thirtyFive + " 35 lb. plates, " + (thirtyFive/2) + " on each side," +
  "\n Put on " + twentyFive + " 25 lb. plates, " + (twentyFive/2) + " on each side," +
  "\n Put on " + ten + " 10 lb. plates, " + (ten/2) + " on each side," +
  "\n Put on " + five + " 5 lb. plates, " + (five/2) + " on each side," +
  "\n Put on " + twoPointFive + " 2.5 lb. plates, " + (twoPointFive/2) + " on each side";
}




console.log(doubleIt(putThemOn)); */


/* converting weight functions */
function ConvertKilos () { 

 weight = document.getElementById('weight');

  enterWeight2 = weight.value; 

  calculatedResult2 = enterWeight2 * 2.20;

  console.log('enterWeight2', enterWeight2); 


  document.getElementById('result2').innerHTML = calculatedResult2 + " " + "pounds"
}

/* Converting pounds to kilos*/
function ConvertPounds () { 

 weight = document.getElementById('weight');

  enterWeight3 = weight.value; 

  calculatedResult3 = enterWeight3 / 2.20;

  console.log('enterWeight3', enterWeight3); 


  document.getElementById('result3').innerHTML = calculatedResult3 + " " + "kilos"
}
            
          
!
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