];
$data['round'] = var_export(!empty($_POST['round']), true);
+ if (!empty($_POST['allChange'])) {
+ if ($_POST['allChange'] == "on") {
+ $data['showingSigil'] = ["true", "true", "true", "true"];
+ }
+ else if ($_POST['allChange'] == "off") {
+ $data['showingSigil'] = ["false", "false", "false", "false"];
+ }
+ }
+
$clock['movementSpeed'] = (int)$_POST['movementSpeed'];
$clock['currentPosition'] = (int)$_POST["doomsday"];
$data['timerOffset'] = (int)$_POST['timerOffset'];
}
echo "<input type='checkbox' id='sigilSW' name='sigilSW' value='true'$checked>";
echo "<label for='sigilSW'>Bottom left (SW)</label><br>";
+
+echo "<input type='radio' id='allOn' value='on' name='allChange'>";
+echo "<label for='allOn'>All on</label><br>";
+
echo "</div><div class='split'>";
$checked = "";
if ($data['showingSigil'][0] == "true") {
if ($data['showingSigil'][1] == "true") {
$checked = " checked='checked' ";
}
+echo "<input type='checkbox' id='sigilSE' name='sigilSE' value='true'<?php echo $checked; ?>>";
+echo "<label for='sigilSW'>Bottom right (SE)</label><br>";
+
+echo "<input type='radio' id='allOff' value='off' name='allChange'>";
+echo "<label for='allOff'>All off</label><br>";
?>
- <input type='checkbox' id='sigilSE' name='sigilSE' value='true'<?php echo $checked; ?>>
- <label for='sigilSW'>Bottom right (SE)</label><br>
</div>
</fieldset>
<fieldset>
var newDiscount = 1;
var priceChange = 0;
+var showingSigils = true;
+
// helper function for creating price strings
function makePrice(price) {
if (round == "true") {price = Math.round(price * 100) / 100;}
priceChange = data.priceChange / 100;
newDiscount = data.discount / 100;
+
+ if (data.showingSigil.every(i => i == "false")) {
+ showingSigils = false;
+ } else {
+ showingSigils = true;
+ }
});
// get the requested item data
}
// function handles the periodic drawing of the sigils (2 per second)
function draw() {
+ if (showingSigils == false) {return;} // break if the sigils are not being shown to save resources
fetch("./sigil.json", {cache: "no-store"})
.then(data => data.json())
.then(data => {