diff options
Diffstat (limited to 'pages/bitset.php')
-rw-r--r-- | pages/bitset.php | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/pages/bitset.php b/pages/bitset.php index 11031e2..8c63bc5 100644 --- a/pages/bitset.php +++ b/pages/bitset.php @@ -1,7 +1,7 @@ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -if (!$isLoggedIn) header("Location: /login") and die(); +if (!$isLoggedIn) header("Location: /-/login") and die(); $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; @@ -10,7 +10,7 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include <br> <div class="container"> <div id="page-content"> - <h2>Bitset Calculator</h2> + <h2>Bitset calculator</h2> </div> <div style="display:grid; grid-template-columns: repeat(48, 1fr);"> <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-1" class="font-monospace tooltip-nohelp text-muted" style="text-align: center;cursor: pointer;">0</div> @@ -27,8 +27,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-12" class="font-monospace tooltip-nohelp text-muted" style="text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-13" class="font-monospace tooltip-nohelp text-muted" style="text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-14" class="font-monospace tooltip-nohelp text-muted" style="text-align: center;cursor: pointer;">0</div> - <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-15" class="font-monospace tooltip-nohelp text-muted" style="text-align: center;cursor: pointer;">0</div> - <div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-16" class="font-monospace tooltip-nohelp text-muted" style="text-align: center;cursor: pointer;">0</div> + <div data-bs-toggle="tooltip" title="Fronts less frequently" id="binary-bit-15" class="font-monospace tooltip-nohelp" style="color: #198754;text-align: center;cursor: pointer;">0</div> + <div data-bs-toggle="tooltip" title="Non verbal in real life" id="binary-bit-16" class="font-monospace tooltip-nohelp" style="color: #20c997;text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Eatable food" id="binary-bit-17" class="font-monospace tooltip-nohelp" style="color: #d63384;text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Eatable food" id="binary-bit-18" class="font-monospace tooltip-nohelp" style="color: #d63384;text-align: center;cursor: pointer;">0</div> <div data-bs-toggle="tooltip" title="Ability to use magic" id="binary-bit-19" class="font-monospace tooltip-nohelp" style="color: #fd7e14;text-align: center;cursor: pointer;">0</div> @@ -108,6 +108,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include let magic = parseInt(binString.substring(2 + 16, 5 + 16), 2); let sensitivity = parseInt(binString.substring(5 + 16, 8 + 16), 2); let ageSpells = binString.substring(31 + 16, 32 + 16) !== "0"; + let nonverbal = binString.substring(15, 16) !== "0"; + let lessFrequent = binString.substring(14, 15) !== "0"; document.getElementById("value-0").value = sharedMemory; document.getElementById("value-1").value = little; @@ -125,6 +127,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include document.getElementById("value-13").value = sensitivity; document.getElementById("value-14").value = species3; document.getElementById("value-15").checked = ageSpells; + document.getElementById("value-16").checked = nonverbal; + document.getElementById("value-17").checked = lessFrequent; } } @@ -171,6 +175,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include let species2 = binString.substring(21 + 16, 25 + 16); let species3 = binString.substring(25 + 16, 29 + 16); let food = parseInt(binString.substring(16, 2 + 16), 2); + let nonverbal = binString.substring(15, 16) !== "0"; + let lessFrequent = binString.substring(14, 15) !== "0"; let magic = parseInt(binString.substring(2 + 16, 5 + 16), 2); let sensitivity = parseInt(binString.substring(5 + 16, 8 + 16), 2); @@ -190,6 +196,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include document.getElementById("value-10").checked = plush; document.getElementById("value-14").value = species3; document.getElementById("value-15").checked = ageSpells; + document.getElementById("value-16").checked = nonverbal; + document.getElementById("value-17").checked = lessFrequent; calculateOutput(); @@ -213,6 +221,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include let val13 = document.getElementById("value-13").value; let val14 = document.getElementById("value-14").value; let val15 = document.getElementById("value-15").checked; + let val16 = document.getElementById("value-16").checked; + let val17 = document.getElementById("value-17").checked; let val0bin = parseInt(val0).toString(2); val0bin = val0bin.length === 1 ? "0" + val0bin : val0bin; @@ -241,8 +251,10 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include let val9bin = val9 ? "1" : "0"; let val10bin = val10 ? "1" : "0"; let val15bin = val15 ? "1" : "0"; + let val16bin = val16 ? "1" : "0"; + let val17bin = val17 ? "1" : "0"; - let bin = "0000000000000000" + val11bin + val12bin + val13bin + val0bin + val4bin + val1bin + val5bin + val6bin + val7bin + val8bin + val2bin + val3bin + val14bin + val9bin + val10bin + val15bin; + let bin = "00000000000000" + val17bin + val16bin + val11bin + val12bin + val13bin + val0bin + val4bin + val1bin + val5bin + val6bin + val7bin + val8bin + val2bin + val3bin + val14bin + val9bin + val10bin + val15bin; console.log(bin, parseInt(bin, 2)); @@ -364,7 +376,15 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include <label style="margin-bottom:5px;"> <input type="checkbox" id="value-15" onchange="updateFromSelection();"> Affected by age spells - </label><img alt="" src="/assets/icons/visibility-private.svg" style="filter:invert(1);width:24px;margin-left:5px;margin-top:-5px;" title="This information will remain private" data-bs-toggle="tooltip"> + </label><img alt="" src="/assets/icons/visibility-private.svg" style="filter:invert(1);width:24px;margin-left:5px;margin-top:-5px;" title="This information will remain private" data-bs-toggle="tooltip"><br> + <label style="margin-bottom:5px;"> + <input type="checkbox" id="value-16" onchange="updateFromSelection();"> + Non verbal in real life + </label><img alt="" src="/assets/icons/visibility-public.svg" style="filter:invert(1);width:24px;margin-left:5px;margin-top:-5px;" title="This information will be shown publicly" data-bs-toggle="tooltip"><br> + <label style="margin-bottom:5px;"> + <input type="checkbox" id="value-17" onchange="updateFromSelection();"> + Fronts less frequently + </label><img alt="" src="/assets/icons/visibility-public.svg" style="filter:invert(1);width:24px;margin-left:5px;margin-top:-5px;" title="This information will be shown publicly" data-bs-toggle="tooltip"> </p> </div> |