summaryrefslogtreecommitdiff
path: root/pages/bitset.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/bitset.php')
-rw-r--r--pages/bitset.php50
1 files changed, 34 insertions, 16 deletions
diff --git a/pages/bitset.php b/pages/bitset.php
index 8c63bc5..0d2d10e 100644
--- a/pages/bitset.php
+++ b/pages/bitset.php
@@ -1,9 +1,7 @@
<?php
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn;
-if (!$isLoggedIn) header("Location: /-/login") and die();
-
-$title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn;
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php';
?>
@@ -25,8 +23,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
<div data-bs-toggle="tooltip" title="Value reserved for future use" id="binary-bit-10" 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-11" 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-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="Age regressor" id="binary-bit-13" class="font-monospace tooltip-nohelp" style="color: #877e19;text-align: center;cursor: pointer;">0</div>
+ <div data-bs-toggle="tooltip" title="Sexually active" id="binary-bit-14" class="font-monospace tooltip-nohelp" style="color: #871985;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>
@@ -40,12 +38,12 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
<div data-bs-toggle="tooltip" title="Shared memory access" id="binary-bit-25" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#fa77ef;">0</div>
<div data-bs-toggle="tooltip" title="Shared memory access" id="binary-bit-26" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#fa77ef;">0</div>
<div data-bs-toggle="tooltip" title="Median system" id="binary-bit-27" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color: #a14700;">0</div>
- <div data-bs-toggle="tooltip" title="Little/age regressor" id="binary-bit-28" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#b277fa;">0</div>
- <div data-bs-toggle="tooltip" title="Little/age regressor" id="binary-bit-29" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#b277fa;">0</div>
+ <div data-bs-toggle="tooltip" title="Little/younger" id="binary-bit-28" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#b277fa;">0</div>
+ <div data-bs-toggle="tooltip" title="Little/younger" id="binary-bit-29" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#b277fa;">0</div>
<div data-bs-toggle="tooltip" title="Protector" id="binary-bit-30" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#77faab;">0</div>
<div data-bs-toggle="tooltip" title="Fictive" id="binary-bit-31" class="font-monospace tooltip-nohelp text-info" style="text-align: center;cursor: pointer;">0</div>
<div data-bs-toggle="tooltip" title="Not talking" id="binary-bit-32" class="font-monospace tooltip-nohelp text-danger" style="text-align: center;cursor: pointer;">0</div>
- <div data-bs-toggle="tooltip" title="Host" id="binary-bit-33" class="font-monospace tooltip-nohelp text-primary" style="text-align: center;cursor: pointer;">0</div>
+ <div data-bs-toggle="tooltip" title="Most common fronter" id="binary-bit-33" class="font-monospace tooltip-nohelp text-primary" style="text-align: center;cursor: pointer;">0</div>
<div data-bs-toggle="tooltip" title="1st species" id="binary-bit-34" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#fab277;">0</div>
<div data-bs-toggle="tooltip" title="1st species" id="binary-bit-35" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#fab277;">0</div>
<div data-bs-toggle="tooltip" title="1st species" id="binary-bit-36" class="font-monospace tooltip-nohelp" style="text-align: center;cursor: pointer;color:#fab277;">0</div>
@@ -64,7 +62,7 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
</div>
<br>
<p>
- <b>Input:</b> <input onchange="calculateInput();" onkeydown="calculateInput()" onkeyup="calculateInput()" value="2048" id="input" type="number" class="form-control" style="width:256px;display: inline-block;color:white;background:#111;border-color:#222;" maxlength="10" max="4294967295" min="2048"><br>
+ <b>Input:</b> <input onchange="calculateInput();" onkeydown="calculateInput()" onkeyup="calculateInput()" value="2048" id="input" type="number" class="form-control" style="width:256px;display: inline-block;color:white;background:#111;border-color:#222;" maxlength="15" max="281474976710655" min="2048"><br>
<b>Output:</b> <code id="output-bin">0b000000000000000000000000000000000000100000000000</code>, <code id="output-hex">0x000008000000</code>, <code id="output-dec">2048</code>
</p>
<script>
@@ -110,6 +108,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
let ageSpells = binString.substring(31 + 16, 32 + 16) !== "0";
let nonverbal = binString.substring(15, 16) !== "0";
let lessFrequent = binString.substring(14, 15) !== "0";
+ let sexuallyActive = binString.substring(13, 14) !== "0";
+ let ageRegressor = binString.substring(12, 13) !== "0";
document.getElementById("value-0").value = sharedMemory;
document.getElementById("value-1").value = little;
@@ -129,6 +129,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
document.getElementById("value-15").checked = ageSpells;
document.getElementById("value-16").checked = nonverbal;
document.getElementById("value-17").checked = lessFrequent;
+ document.getElementById("value-18").checked = sexuallyActive;
+ document.getElementById("value-19").checked = ageRegressor;
}
}
@@ -148,7 +150,7 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
}
function calculateInput() {
- if (parseInt(document.getElementById("input").value).toString().length > 10) return;
+ if (parseInt(document.getElementById("input").value).toString().length > 15) return;
let binString = ("0".repeat(48 - parseInt(document.getElementById("input").value).toString(2).length)) + parseInt(document.getElementById("input").value).toString(2);
let bin = binString.split("").map((i) => parseInt(i));
@@ -179,6 +181,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
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);
+ let sexuallyActive = binString.substring(13, 14) !== "0";
+ let ageRegressor = binString.substring(12, 13) !== "0";
document.getElementById("value-0").value = sharedMemory;
document.getElementById("value-1").value = little;
@@ -198,6 +202,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
document.getElementById("value-15").checked = ageSpells;
document.getElementById("value-16").checked = nonverbal;
document.getElementById("value-17").checked = lessFrequent;
+ document.getElementById("value-18").checked = sexuallyActive;
+ document.getElementById("value-19").checked = ageRegressor;
calculateOutput();
@@ -223,6 +229,8 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
let val15 = document.getElementById("value-15").checked;
let val16 = document.getElementById("value-16").checked;
let val17 = document.getElementById("value-17").checked;
+ let val18 = document.getElementById("value-18").checked;
+ let val19 = document.getElementById("value-19").checked;
let val0bin = parseInt(val0).toString(2);
val0bin = val0bin.length === 1 ? "0" + val0bin : val0bin;
@@ -253,8 +261,10 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
let val15bin = val15 ? "1" : "0";
let val16bin = val16 ? "1" : "0";
let val17bin = val17 ? "1" : "0";
+ let val18bin = val18 ? "1" : "0";
+ let val19bin = val19 ? "1" : "0";
- let bin = "00000000000000" + val17bin + val16bin + val11bin + val12bin + val13bin + val0bin + val4bin + val1bin + val5bin + val6bin + val7bin + val8bin + val2bin + val3bin + val14bin + val9bin + val10bin + val15bin;
+ let bin = "000000000000" + val19bin + val18bin + val17bin + val16bin + val11bin + val12bin + val13bin + val0bin + val4bin + val1bin + val5bin + val6bin + val7bin + val8bin + val2bin + val3bin + val14bin + val9bin + val10bin + val15bin;
console.log(bin, parseInt(bin, 2));
@@ -288,11 +298,11 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
</select>
<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>
- <b>Little/age regressor: </b><select class="tooltip-nohelp form-select" style='display:inline-block;width:max-content;color:white;background-color:#111;border-color:#222;background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23ffffff&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' id="value-1" onchange="updateFromSelection();">
+ <b>Little/younger: </b><select class="tooltip-nohelp form-select" style='display:inline-block;width:max-content;color:white;background-color:#111;border-color:#222;background-image:url("data:image/svg+xml,%3csvg xmlns=&apos;http://www.w3.org/2000/svg&apos; viewBox=&apos;0 0 16 16&apos;%3e%3cpath fill=&apos;none&apos; stroke=&apos;%23ffffff&apos; stroke-linecap=&apos;round&apos; stroke-linejoin=&apos;round&apos; stroke-width=&apos;2&apos; d=&apos;M2 5l6 6 6-6&apos;/%3e%3c/svg%3e");' id="value-1" onchange="updateFromSelection();">
<option value="0" selected>None</option>
<option value="2">Little</option>
<option value="3">Younger</option>
- <option value="1">Age regressor</option>
+ <option value="1" disabled>Age regressor (old)</option>
</select>
<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>
@@ -363,7 +373,7 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
</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-8" onchange="updateFromSelection();">
- Host
+ Most common fronter
</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-9" onchange="updateFromSelection();">
@@ -384,7 +394,15 @@ $title = "Bitset calculator"; require_once $_SERVER['DOCUMENT_ROOT'] . '/include
<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">
+ </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-18" onchange="updateFromSelection();">
+ Sexually active
+ </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-19" onchange="updateFromSelection();">
+ Age regressor
+ </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>
</p>
</div>