Widget:StatCalc

Information
This is a weapon stats calculator, which calculates how much speed and damage a weapon has based on the number of teeth, feathers and booze applied to it. Can be found here. Made by this bloke:. document.getElementById('calcStats').addEventListener('click',function{let option=document.getElementById('weaponList').value;let feather=document.getElementById('feather').value;let teeth=document.getElementById('teeth').value;let glass=document.getElementById('glass').value;let output=document.getElementById('statsOutput');if(option==="")return output.innerHTML="Select a weapon from the list.";output.innerHTML="";if(isNaN(feather)||isNaN(teeth)||isNaN(glass)){output.innerHTML="Make sure all inputs are numbers."}else if(+feather<0||+teeth<0||+glass<0){return output.innerHTML="How can you have a negative upgrade."}else if((+feather==0&&+teeth==0&&+glass==0)||(feather==""&&teeth==""&&glass=="")){output.innerHTML="At least one upgrade has to be greater than 0."}else if((+feather+ +teeth+ +glass)>30){output.innerHTML="The total number of upgrades can't exceed 30."}else{let damage=(weaponStats[option].damage+((+teeth*0.1)+(+glass*0.2))-(+feather*0.05)).toFixed(2);let speed=(weaponStats[option].speed-((+teeth*0.05)+(+glass*0.1))+(+feather*0.1)).toFixed(2);if(damage<0)damage=0;if(speed<0)speed=0;document.getElementById('infoSpeed').innerHTML=speed;document.getElementById('infoDamage').innerHTML=damage;updateBars}});document.getElementById('weaponList').addEventListener('change',function{let option=this.value;document.getElementById('infoSpeed').innerHTML=weaponStats[option].speed;document.getElementById('infoDamage').innerHTML=weaponStats[option].damage;document.getElementById('infoBlock').innerHTML=weaponStats[option].block;updateBars});function updateBars{let speedBar=document.getElementById('speedBar');let damageBar=document.getElementById('damageBar');let blockBar=document.getElementById('blockBar');let speed=document.getElementById('infoSpeed').innerHTML;let damage=document.getElementById('infoDamage').innerHTML;let block=document.getElementById('infoBlock').innerHTML;let factor=10;speedBar.style.width=(+speed*factor)+"px";damageBar.style.width=(+damage*factor)+"px";blockBar.style.width=(+block*factor)+"px"}
 * 1) statCalcContainer,#statCalcContainer button:active{background:#242424}#statCalcContainer :focus{outline:0}#statCalcContainer,#statCalcContainer *{box-sizing:border-box}#statCalcContainer{border:1px solid #000;border-radius:4px;color:#fff;margin:1rem 0;padding-bottom:1rem;width:375px}#statCentre{display:flex;justify-content:space-between}#statCentre>div{padding:1rem;width:50%}#statCalcContainer p{margin:0}#statCalcContainer button,#statCalcContainer input,#statCalcContainer select{background:#353535;border:1px solid #000;border-radius:3px;color:#fff;height:25px;padding:3px 6px}#statCalcContainer input,#statCalcContainer select{margin:.25rem 0 .5rem;width:100%}#statCalcContainer button,#statCalcContainer select{cursor:pointer}#statCalcContainer button:hover{background:#454545}#statCalcContainer>div:nth-child(2){text-align:center}#statsSection{display:flex;flex-direction:column;justify-content:space-between}#calcStats{margin-bottom:.5rem}#baseStats{text-align:left}#speed{color:#46c7ff}#damage{color:#e7ff00}#block{color:#f78f17}.statBar{background:red;border-radius:0 4px 4px 0;height:15px;margin:.25rem 0 .5rem;transition:width .65s cubic-bezier(.75,0,.5,1.75);width:0}#speedBar{background:#46c7ff}#damageBar{background:#e7ff00}#blockBar{background:#f78f17}#statsOutput{font-size:.9rem}  Choose a weapon -  Club Crafted Axe Crafted Club  Machete Modern Axe Plane Axe Rusty Axe  Tennis Racket Upgraded Rock Upgraded Stick   Number of Feathers  Number of Teeth  Number of Booze     Speed: 0     Damage: 0     Block: 0      Calculate Stats     var weaponStats={club:{speed:1,damage:7.5,block:10},cAxe:{speed:1,damage:5.5,block:9},cClub:{speed:2,damage:7,block:9},machete:{speed:7.25,damage:5.25,block:0},mAxe:{speed:5,damage:7,block:9},pAxe:{speed:5.5,damage:5.25,block:2},rAxe:{speed:3.5,damage:6,block:10},tennis:{speed:5,damage:2,block:5.5},uRock:{speed:5,damage:7,block:0},uStick:{speed:7,damage:2,block:8}}