Update index.php

This commit is contained in:
James 2022-09-26 15:24:38 +02:00
parent 524e2bab52
commit f300ae8b52
1 changed files with 25 additions and 16 deletions

View File

@ -210,9 +210,9 @@
<label> <input id="mob_hp_type_max" name="mob_hp_type" type="radio" onchange="usingHPDice('max')" /> <span>Max</span> </label>
</div>
</div>
<div class="card black" id="HP_hitdice">
<div class="card black" id="HP_hitdice_card">
<div class="card-content white-text">
<span class="card-title">Health definition</span>
<span class="card-title">Health Rolls</span>
<span>How many Dice are used for the calculation?</span>
<div class="input-field s1">
<input placeholder="[X]d10" id="mob_hp_dice_ammount" min="1" type="number" class="white-text validate" />
@ -224,6 +224,7 @@
</div>
</div>
<div class="card black" id="HP_average_card">
<span class="card-title">Health Averages</span>
<div class="card-content white-text">
<span>What's the average HP of the Enemy?</span>
<div class="input-field s1">
@ -232,6 +233,7 @@
</div>
</div>
<div class="card black" id="HP_max_card">
<span class="card-title">Health Maxes</span>
<div class="card-content white-text">
<span>What's the max rolled HP of all enemies?</span>
<div class="input-field s1">
@ -986,28 +988,35 @@
function usingHPDice(e) {
if (e) {
$("#HP_max").hide("fast");
$("#HP_average").hide("fast");
$("#HP_max_card").hide("fast");
$("#HP_average_card").hide("fast");
$("#HP_hitdice_card").show("fast");
$("#mob_hp_avg").val("");
$("#mob_hp_dice_ammount").val("");
$("#mob_hp_dice_type").val("");
$("#HP_hitdice").show("fast");
$("#mob_hp_max").val("");
} else if (e == false) {
$("#HP_max").hide("fast");
$("#HP_hitdice").hide("fast");
$("#mob_hp_avg").val("");
$("#HP_average").show("fast");
$("#mob_hp_max").val("");
} else if (e == "max") {
console.log("hello");
$("#HP_average").hide("fast");
$("#HP_hitdice").hide("fast");
$("#HP_max").show("fast");
} else if (e == false) {
$("#HP_max_card").hide("fast");
$("#HP_hitdice_card").hide("fast");
$("#HP_average_card").show("fast");
$("#mob_hp_avg").val("");
$("#mob_hp_dice_ammount").val("");
$("#mob_hp_dice_type").val("");
$("#mob_hp_max").val("");
} else if (e == "max") {
$("#HP_max_card").show("fast");
$("#HP_hitdice_card").hide("fast");
$("#HP_average_card").hide("fast");
$("#mob_hp_avg").val("");
$("#mob_hp_dice_ammount").val("");
$("#mob_hp_dice_type").val("");
$("#mob_hp_max").val("");
}
calcDiff();
}