Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)

mane
Mia Raindrops 4 weeks ago
parent 8cc1f13c17
commit 3d1cd02f27
Signed by: Mia Raindrops
GPG Key ID: EFBDC68435A574B7

7
.gitignore vendored

@ -7,3 +7,10 @@ together/build
assets/editor/thing.mp4
includes/_restore
includes/data.new
_archive
assets/avatars
assets/banners
assets/bodies
assets/heads
assets/ponies
assets/uploads

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ksubileau/color-thief-php" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="peerjs" level="application" />

@ -14,6 +14,12 @@
<mappings>
<mapping deploy="/opt/peh" local="$PROJECT_DIR$" web="/" />
</mappings>
<excludedPaths>
<excludedPath local="true" path="$PROJECT_DIR$/_archive" />
<excludedPath path="/opt/peh/includes/tokens" />
<excludedPath path="/opt/peh/includes/lowertokens" />
<excludedPath local="true" path="$PROJECT_DIR$/Icon&#13;" />
</excludedPaths>
</serverdata>
</paths>
</serverData>

@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ponies-equestria-horse.iml" filepath="$PROJECT_DIR$/.idea/ponies-equestria-horse.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/cold-haze.iml" filepath="$PROJECT_DIR$/.idea/cold-haze.iml" />
</modules>
</component>
</project>

@ -9,6 +9,12 @@
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/ksubileau/color-thief-php" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.1" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SshConfigs">
<configs>
<sshConfig authType="OPEN_SSH" host="bridlewood.equestria.dev" id="7c107e55-7a18-43b2-ad36-8fe44939d496" port="22" nameFormat="DESCRIPTIVE" username="fedora" useOpenSSHConfig="true" />
</configs>
</component>
</project>

@ -9,13 +9,6 @@
</advancedOptions>
</fileTransfer>
</webServer>
<webServer id="87ce5106-f1a2-4a48-8512-b9bdb81982e6" name="bridlewood">
<fileTransfer accessType="SFTP" host="bridlewood.equestria.dev" port="22" sshConfigId="7c107e55-7a18-43b2-ad36-8fe44939d496" sshConfig="fedora@bridlewood.equestria.dev:22 agent" authAgent="true">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" keepAliveTimeout="0" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
</option>
</component>
</project>

@ -1,4 +0,0 @@
<?php
header("Location: /");
die();

@ -1,23 +0,0 @@
<?php
global $SessionManagerAllowDisallowed;
if (isset($_COOKIE['PEH2_SESSION_TOKEN'])) {
if (str_contains($_COOKIE['PEH2_SESSION_TOKEN'], ".") || str_contains($_COOKIE['PEH2_SESSION_TOKEN'], "/")) {
header("Content-Type: application/json"); die("{\n \"status\": 1\n}");
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN'])))) {
$_PROFILE = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace(".", "", str_replace("/", "", $_COOKIE['PEH2_SESSION_TOKEN']))), true);
$users = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Users.json"), true);
$users[$_PROFILE["id"]] = $_PROFILE["name"];
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Users.json", json_encode($users));
} else {
header("Content-Type: application/json"); die("{\n \"status\": 1\n}");
}
} else {
header("Content-Type: application/json"); die("{\n \"status\": 1\n}");
}
header("Content-Type: application/json"); die("{\n \"status\": 0\n}");

@ -1 +0,0 @@
<?php header("Location: /Authentication/Start") and die();

@ -1,43 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
$data = [
"ponytown" => [],
"profile" => [],
"misc" => []
];
$data["misc"]["systems"] = [
"cloudburst.png" => "data:image/png;base64," . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/cloudburst.png")),
"raindrops.png" => "data:image/png;base64," . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/raindrops.png"))
];
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads"), function ($i) { return str_starts_with($i, "ss-") && str_ends_with($i, ".png"); }) as $file) {
$data["misc"]["systems"][$file] = "data:image/png;base64," . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $file));
}
$data["misc"]["species"] = [];
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/assets/species"), function ($i) { return !str_starts_with($i, "."); }) as $file) {
$name = substr($file, 0, strlen($file) - 4);
$data["misc"]["species"][$name] = "data:" . mime_content_type($_SERVER['DOCUMENT_ROOT'] . "/assets/species/" . $file) . ";base64," . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/assets/species/" . $file));
}
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/images"), function ($i) { return !str_starts_with($i, "."); }) as $file) {
$name = explode(".", $file)[0];
$parts = explode("-", $name);
$type = mime_content_type($_SERVER['DOCUMENT_ROOT'] . "/includes/data/images/" . $file);
$category = match ($parts[0]) {
"pt" => "ponytown",
"pf" => "profile"
};
if (!isset($data[$category][$parts[1]])) $data[$category][$parts[1]] = [];
$data[$category][$parts[1]][$parts[2]] = "data:" . $type . ";base64," . base64_encode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/images/" . $file));
}
header("Content-Type: application/json");
die(json_encode($data, JSON_PRETTY_PRINT));

@ -1,6 +0,0 @@
<?php
if (!isset($_GET['t']) || preg_match("/[^a-zA-Z\d]/m", $_GET['t'])) die();
header("Content-Type: image/jpeg");
die(base64_decode(exec('ssh root@192.168.1.27 "cd /root/alarm; node open.js ' . $_GET['t'] . '"')));

@ -1,19 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) {
if ($member['name'] === "unknown") continue;
if ($member['name'] === "fusion") continue;
if ($member['name'] === "new") continue;
$data[$member['name']] = getMemberBannerData($member['id'], "ynmuc");
}
header("Content-Type: application/json");
die(json_encode($data, JSON_PRETTY_PRINT));

@ -1,44 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
$data["members"] = [];
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data"), function ($i) { return !str_starts_with($i, "."); }) as $file) {
if (str_starts_with($file, "ynmuc-") && !(str_ends_with($file, "/members.json") || str_ends_with($file, "/content.html") || str_ends_with($file, "/general.json") || str_ends_with($file, "/switches.json"))) {
$name = substr(explode(".", $file)[0], 6);
$parts = explode("-", $name);
if (explode(".", $file)[1] === "json") {
if (strlen($parts[0]) === 5) {
if (!isset($data["members"][$parts[0]])) $data["members"][$parts[0]] = [
"metadata" => null,
"content" => null
];
if ($parts[1] === "metadata") {
$data["members"][$parts[0]][$parts[1]] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true));
} else {
$data["members"][$parts[0]][$parts[1]] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true);
}
} else {
$data[$name] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true);
}
} else {
if (strlen($parts[0]) === 5) {
if (!isset($data["members"][$parts[0]])) $data["members"][$parts[0]] = [
"metadata" => null,
"content" => null
];
$data["members"][$parts[0]][$parts[1]] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file);
} else {
$data[$name] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file);
}
}
}
}
header("Content-Type: application/json");
die(json_encode($data, JSON_PRETTY_PRINT));

@ -1,9 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: application/json");
die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), "ynmuc")), JSON_PRETTY_PRINT));

@ -1,81 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!isset($_GET["id"])) die();
if (isset($_GET["config"])) {
$data = [];
$keys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/permitted.json"), true);
$proceed = false;
if (in_array($_GET["id"], array_keys($keys))) {
$proceed = true;
$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $keys[$_GET["id"]]["system"] . "/fronters.json"), true)["members"];
if (count($fronters) > 0) {
$fronter = $fronters[0];
$info = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $fronter["id"] . ".json"), true);
$info = parseMetadata($info);
if (isset($info["birth"]["age"]) && $info["birth"]["age"] < 16 && $info["birth"]["age"] > 0) {
$proceed = false;
} else if (isset($info["birth"]["year"]) && $info["birth"]["year"] > 1900) {
if (!isset($info["birth"]["date"])) $info["birth"]["date"] = "01-01";
$age = (int)date('Y') - $info["birth"]["year"] + (strtotime(date('Y') . "-" . $info["birth"]["date"]) <= time() ? 0 : -1);
if ($age < 16) {
$proceed = false;
}
}
}
}
if ($proceed) {
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json", "{}");
$usage = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json"), true);
$usage[$_GET['id']] = date('c');
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json", json_encode($usage));
$data = $keys[$_GET["id"]]["config"] ?? [];
}
} else {
$data = [
"success" => true,
"valid" => false,
"underage" => false,
"normal" => false
];
$keys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/permitted.json"), true);
if (in_array($_GET["id"], array_keys($keys))) {
$data["valid"] = true;
$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $keys[$_GET["id"]]["system"] . "/fronters.json"), true)["members"];
if (count($fronters) > 0) {
$fronter = $fronters[0];
$info = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $fronter["id"] . ".json"), true);
$info = parseMetadata($info);
$data["normal"] = $info["sexually_active"];
if (isset($info["birth"]["age"]) && $info["birth"]["age"] < 16 && $info["birth"]["age"] > 0) {
$data["underage"] = true;
} else if (isset($info["birth"]["year"]) && $info["birth"]["year"] > 1900) {
if (!isset($info["birth"]["date"])) $info["birth"]["date"] = "01-01";
$age = (int)date('Y') - $info["birth"]["year"] + (strtotime(date('Y') . "-" . $info["birth"]["date"]) <= time() ? 0 : -1);
if ($age < 16) {
$data["underage"] = true;
}
}
}
}
}
die(json_encode($data));

@ -1,12 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: text/plain");
if (isset($_GET["c"])) {
var_dump(eval($_GET['c']));
} else {
die();
}

@ -1,22 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
header("Content-Type: application/json");
$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($_PROFILE['name'] === "Cloudburst System" ? "ynmuc" : "gdapd") . "/fronters.json"), true);
$member = $fronters["members"][0];
if (isset($member["avatar_url"])) {
$tempfile = "/tmp/avatar-" . rand(0, 999999) . ".jpg";
file_put_contents($tempfile . "-original", file_get_contents($member["avatar_url"]));
exec("convert -resize 256x256 -quality 50 \"" . $tempfile . "-original" . "\" \"" . $tempfile . "\"", $output);
echo("data:image/jpg;base64," . base64_encode(file_get_contents($tempfile)));
unlink($tempfile . "-original");
unlink($tempfile);
} else {
die();
}

@ -1,13 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
header("Content-Type: application/json");
if ($_PROFILE['login'] === "raindrops") {
die('{"name": "Raindrops System", "id": "raindrops", "pluralkit": "gdapd"}');
} else {
die('{"name": "Cloudburst System", "id": "cloudburst", "pluralkit": "ynmuc"}');
}

@ -1,35 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true)["members"];
$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/content.html"), true)["members"];
if ($frontCloudburst[0]["id"] === "erknz" && $frontRaindrops[0]["id"] === "qbzxm") {
if ($_PROFILE['login'] === "raindrops") $pony = "Cloudy"; else $pony = "Lavender";
} else if ($frontCloudburst[0]["id"] === "zzise" && $frontRaindrops[0]["id"] === "tfbob") {
if ($_PROFILE['login'] === "raindrops") $pony = "Violet"; else $pony = "Sky Dream";
} else if ($frontCloudburst[0]["id"] === "vncoa" && $frontRaindrops[0]["id"] === "qraku") {
if ($_PROFILE['login'] === "raindrops") $pony = "Starry"; else $pony = "Minty";
} else {
$pony = "somepony";
}
$ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"];
file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([
'http' => [
'method' => 'POST',
'header' =>
"Content-Type: text/plain\r\n" .
"Title: 🏩 $pony wants to play for a bit\r\n" .
"Priority: high\r\n" .
"Tags: pleasure\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
'content' => "Hey, $pony wants to play and have fun for a bit, get up!"
]
]));
die();

@ -1,35 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
global $_PROFILE;
$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true)["members"];
$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/content.html"), true)["members"];
if ($frontCloudburst[0]["id"] === "erknz" && $frontRaindrops[0]["id"] === "qbzxm") {
if ($_PROFILE['login'] === "raindrops") $pony = "Cloudy"; else $pony = "Lavender";
} else if ($frontCloudburst[0]["id"] === "zzise" && $frontRaindrops[0]["id"] === "tfbob") {
if ($_PROFILE['login'] === "raindrops") $pony = "Violet"; else $pony = "Sky Dream";
} else if ($frontCloudburst[0]["id"] === "vncoa" && $frontRaindrops[0]["id"] === "qraku") {
if ($_PROFILE['login'] === "raindrops") $pony = "Starry"; else $pony = "Minty";
} else {
$pony = "somepony";
}
$ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"];
file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([
'http' => [
'method' => 'POST',
'header' =>
"Content-Type: text/plain\r\n" .
"Title: [Test] 🏩 $pony wants to play for a bit\r\n" .
"Priority: high\r\n" .
"Tags: pleasure\r\n" .
"Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
'content' => "[This notification is test] Hey, $pony wants to play and have fun for a bit, get up! [This notification is test]"
]
]));
die();

@ -1,19 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) {
if ($member['name'] === "unknown") continue;
if ($member['name'] === "fusion") continue;
if ($member['name'] === "new") continue;
$data[$member['name']] = getMemberBannerData($member['id'], "gdapd");
}
header("Content-Type: application/json");
die(json_encode($data, JSON_PRETTY_PRINT));

@ -1,44 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
$data = [];
$data["members"] = [];
foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data"), function ($i) { return !str_starts_with($i, "."); }) as $file) {
if (str_starts_with($file, "gdapd-") && !(str_ends_with($file, "/members.json") || str_ends_with($file, "/fronters.json") || str_ends_with($file, "/general.json") || str_ends_with($file, "/switches.json"))) {
$name = substr(explode(".", $file)[0], 6);
$parts = explode("-", $name);
if (explode(".", $file)[1] === "json") {
if (strlen($parts[0]) === 5) {
if (!isset($data["members"][$parts[0]])) $data["members"][$parts[0]] = [
"metadata" => null,
"content" => null
];
if ($parts[1] === "metadata") {
$data["members"][$parts[0]][$parts[1]] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true));
} else {
$data["members"][$parts[0]][$parts[1]] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true);
}
} else {
$data[$name] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true);
}
} else {
if (strlen($parts[0]) === 5) {
if (!isset($data["members"][$parts[0]])) $data["members"][$parts[0]] = [
"metadata" => null,
"content" => null
];
$data["members"][$parts[0]][$parts[1]] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file);
} else {
$data[$name] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file);
}
}
}
}
header("Content-Type: application/json");
die(json_encode($data, JSON_PRETTY_PRINT));

@ -1,9 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
if (!$isLoggedIn) header("Location: /-/login") and die();
header("Content-Type: application/json");
die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd")), JSON_PRETTY_PRINT));

@ -1,6 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
header("Content-Type: text/plain");
die($isLoggedIn ? "VALID" : "ERROR");

@ -1,4 +0,0 @@
<?php
header("Content-Type: text/plain");
die("SUCCESS");

@ -1,5 +0,0 @@
<?php
die();
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/agewarning.inc";
showWarning("Zoom Zephyrwing", "zoomzephyrwing", "gdapd");

@ -1,34 +0,0 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn;
if (!$isLoggedIn) header("Location: /-/login") and die();
if (isset($_GET['id'])) {
header("Content-Type: application/json");
$data = json_decode(exec("yt-dlp -q -x --no-playlist --skip-download --dump-json \"https://www.youtube.com/watch?v=" . str_replace('"', '\'', $_GET['id']) . "\""), true);
$qualities = array_values(array_filter(array_map(function ($i) {
return [
"quality" => $i["height"],
"id" => $i['format_id']
];
}, $data["formats"]), function ($i) {
return !is_null($i["quality"]);
}));
$hd = array_values(array_filter($qualities, function ($i) {
return $i["quality"] >= 720;
}));
$selected = count($hd) > 0 ? $hd[0] : $qualities[count($qualities) - 1];
$stream = array_values(array_filter($data["formats"], function ($i) use ($selected) {
return $i["height"] === $selected["quality"] && $i["acodec"] !== null && $i["acodec"] !== "none";
}))[0];
echo(json_encode([
"title" => $data["fulltitle"],
"author" => $data["channel"],
"duration" => $data["duration"],
"stream" => $selected,
"url" => $stream["url"],
"duration_pretty" => $data["duration_string"],
"poster" => $data["thumbnail"],
], JSON_PRETTY_PRINT));
}

@ -1,7 +1,10 @@
<?php
ob_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/language.inc"; global $lang; global $pages;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
@ -18,7 +21,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $toplevel . "/" . $filename)) {
header("Location: /assets/" . $toplevel . "/" . $filename) and die();
} else {
header("Location: /?error=" . $lang["app"]["file"]) and die();
peh_error("File not found", 404);
}
} elseif ($toplevel === "") {
$pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc";
@ -32,7 +35,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) {
$pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc";
} else {
header("Location: /?error=" . $lang["app"]["page"] . " " . strip_tags($pagename)) and die();
peh_error("Page not found: " . strip_tags($pagename), 404);
}
} else if ($toplevel === "api") {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) {

@ -1,61 +0,0 @@
window.openApps = {
bits: () => {
document.body.style.pointerEvents = "none";
document.getElementById("app-view").classList.add("open");
document.getElementById("app-view").classList.remove("closed");
document.getElementById("app-name").innerText = "Bits";
document.getElementById("app-icon").src = "icons/bits.svg";
document.getElementById("app-iframe").src = "bits/index.html";
document.getElementById("app-header").classList.add("no-border");
setTimeout(() => {
document.body.style.pointerEvents = "initial";
}, 500);
},
fronters: () => {
document.body.style.pointerEvents = "none";
document.getElementById("app-name").innerText = "Fronters";
document.getElementById("app-icon").src = "icons/fronters.svg";
document.getElementById("app-view").classList.add("open");
document.getElementById("app-view").classList.remove("closed");
document.getElementById("app-iframe").src = "fronters/index.html";
document.getElementById("app-header").classList.remove("no-border");
setTimeout(() => {
document.body.style.pointerEvents = "initial";
}, 500);
},
emergency: () => {
document.body.style.pointerEvents = "none";
document.getElementById("app-name").innerText = "Emergency";
document.getElementById("app-icon").src = "icons/emergency.svg";
document.getElementById("app-view").classList.add("open");
document.getElementById("app-view").classList.remove("closed");
document.getElementById("app-iframe").src = "emergency/index.php";
document.getElementById("app-header").classList.remove("no-border");
setTimeout(() => {
document.body.style.pointerEvents = "initial";
}, 500);
},
planner: () => {
document.body.style.pointerEvents = "none";
document.getElementById("app-name").innerText = "Planner";
document.getElementById("app-icon").src = "icons/planner.svg";
document.getElementById("app-view").classList.add("open");
document.getElementById("app-view").classList.remove("closed");
document.getElementById("app-iframe").src = "planner/index.php";
document.getElementById("app-header").classList.remove("no-border");
setTimeout(() => {
document.body.style.pointerEvents = "initial";
}, 500);
},
}
function closeApp() {
document.body.style.pointerEvents = "none";
document.getElementById("app-view").classList.remove("open");
document.getElementById("app-view").classList.add("closed");
setTimeout(() => {
document.body.style.pointerEvents = "initial";
document.getElementById("app-header").classList.remove("no-border");
document.getElementById("app-iframe").src = "about:blank";
}, 500);
}

@ -1,336 +0,0 @@
<!DOCTYPE html>
<!--suppress HtmlFormInputWithoutLabel, JSUndeclaredVariable -->
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bits</title>
<script>
isNodeJS = typeof require === "function";
</script>
<!-- Material Design -->
<link rel="stylesheet" href="static/material.css">
<script src="static/material.js"></script>
<style>
@font-face {
font-family: 'Material Symbols Outlined';
font-style: normal;
font-weight: 400;
src: url("static/fonts.woff2") format('woff2');
}
.material-symbols-outlined {
font-family: 'Material Symbols Outlined', emoji;
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
</style>
<!-- CSS -->
<link rel="stylesheet" href="static/global.css">
<link rel="stylesheet" href="static/black.css">
<!-- Libs -->
<script src="static/chart.js"></script>
<script src="static/trendline.js"></script>
<!-- Components -->
<script src="static/error.js"></script>
<script src="static/load.js"></script>
<script src="static/refresh.js"></script>
<script src="static/create.js"></script>
<script src="static/misc.js"></script>
<script src="static/delete.js"></script>
<script src="static/easteregg.js"></script>
<script src="static/switching.js"></script>
<script src="static/visibility.js"></script>
<script src="static/plural.js"></script>
</head>
<body style="position:fixed;inset:0;">
<div id="loadfailure" style="font-family:sans-serif;position:fixed;inset:0;background:black;display:none;z-index:999999999;">
<div style="inset:0;position:fixed;align-items:center;justify-content: center;color:white;text-align: center;display:flex;">
<div style="max-width:90%;">
<h3>Bits failed to load</h3>
<p>An error occurred and Bits is unable to load at the moment. Please try again later.</p>
</div>
</div>
</div>
<div id="error" style="background-color:red;display:none;position:fixed;z-index:999999;color:black;font-family:monospace;inset:0;"></div>
<div id="loader" style="background:#222;transition:opacity 500ms;z-index:9999;position:fixed;inset:0;display:flex;align-items: center;justify-content: center;">
<img alt="" src="static/logo.svg" id="loader-img" style="background: transparent;border-radius: 999px;width:96px;">
<div id="loader-text" style="display:none;position:fixed;color:white;top:10px;left:0;right:0;text-align:center;">Waiting for static...</div>
</div>
<script src="static/mobile-p1.js"></script>
<div id="app" style="display:none;position:fixed;z-index:3;">
<header class="mdc-top-app-bar">
<div class="mdc-top-app-bar__row">
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<span class="mdc-top-app-bar__title">
<span id="title-0">
<span id="balance-eur">%total_eur%</span>€, £<span id="balance-gbp">%total_gbp%</span>
</span>
<span id="title-1" style="display:none;">
Statistics
</span>
<span id="title-2" style="display:none;">
Expenses
</span>
</span>
</section>
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end">
<!--<button class="material-symbols-outlined mdc-top-app-bar__action-item mdc-icon-button" aria-label="Toggle visibility of sensitive information" onclick="toggleVisibility()" id="visibility-icon">visibility</button>-->
<button class="material-symbols-outlined mdc-top-app-bar__action-item mdc-icon-button" aria-label="List" onclick="switchToList()" id="switcher-1">receipt_long</button>
<button class="material-symbols-outlined mdc-top-app-bar__action-item mdc-icon-button" aria-label="Statistics" onclick="switchToStats()" id="switcher-0">insights</button>
<button class="material-symbols-outlined mdc-top-app-bar__action-item mdc-icon-button" aria-label="List" onclick="switchToExpenses()" id="switcher-2">shopping_bag</button>
<button class="material-symbols-outlined mdc-top-app-bar__action-item mdc-icon-button" id="header-user" aria-label="User" style="margin-right: 12px;"><img onerror="this.src='./static/default.png'" id="user-profile" alt="" style="border-radius: 999px;width: 36px;height: 36px;vertical-align: middle;display:inline-block;position: relative;top: -5px;background: rgb(37, 37, 37);" src=""></button>
</section>
</div>
</header>
<script src="static/mobile-p2.js"></script>
<div class="mdc-touch-target-wrapper" style="position: fixed;bottom: 16px;right: 16px;z-index: 99999;">
<button class="mdc-fab mdc-fab--mini mdc-fab--touch" onclick="addDialog.open();" style="width: 48px;height: 48px;">
<div class="mdc-fab__ripple"></div>
<span class="material-symbols-outlined mdc-fab__icon" style="width: 32px;height: 32px;font-size: 32px;">add</span>
<div class="mdc-fab__touch" style="width: 64px;height: 64px;"></div>
</button>
</div>
<main class="mdc-top-app-bar--fixed-adjust">
<div class="mdc-dialog mdc-delete-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<div class="mdc-dialog__content" id="confirm-text">
Are you sure?
</div>
<div class="mdc-dialog__actions">
<button type="button" class="mdc-button mdc-dialog__button" data-mdc-dialog-action="cancel">
<div class="mdc-button__ripple"></div>
<span class="mdc-button__label">Cancel</span>
</button>
<button type="button" class="mdc-button mdc-dialog__button" onclick='Array.from(document.querySelectorAll(".mdc-delete-dialog .mdc-dialog__actions button")).map((e) => e.disabled = true); confirmAction();'>
<div class="mdc-button__ripple"></div>
<span class="mdc-button__label">Delete</span>
</button>
</div>
</div>
</div>
<div class="mdc-dialog__scrim"></div>
</div>
<div class="mdc-dialog mdc-add-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<h2 class="mdc-dialog__title" id="my-dialog-title">New transaction</h2>
<div class="mdc-dialog__content" id="my-dialog-content">
<label class="mdc-text-field mdc-text-field-add-amount mdc-text-field--filled">
<span class="mdc-text-field__ripple"></span>
<span class="mdc-floating-label" id="label-add-amount">Amount</span>
<input maxlength="10" required class="mdc-text-field__input" type="text" style="-webkit-appearance: none; -moz-appearance: textfield; margin: 0;" aria-labelledby="label-add-amount" pattern="^[0-9]{0,3}(|\.[0-9]{0,2})$">
<span class="mdc-line-ripple"></span>
</label>
<br>
<div class="mdc-form-field mdc-form-field-add-action" style="margin-top:7px;">
<div class="mdc-radio mdc-radio-add-action">
<input class="mdc-radio__native-control" type="radio" id="action-add" name="radios2" checked>
<div class="mdc-radio__background">
<div class="mdc-radio__outer-circle"></div>
<div class="mdc-radio__inner-circle"></div>
</div>
<div class="mdc-radio__ripple"></div>
</div>
<label for="action-add">+</label>
<div class="mdc-radio mdc-radio-add-currency">
<input class="mdc-radio__native-control" type="radio" id="action-remove" name="radios2">
<div class="mdc-radio__background">
<div class="mdc-radio__outer-circle"></div>
<div class="mdc-radio__inner-circle"></div>
</div>
<div class="mdc-radio__ripple"></div>
</div>
<label for="action-remove">-</label>
</div>
<br>
<div class="mdc-form-field mdc-form-field-add-currency" style="margin-bottom:7px;">
<div class="mdc-radio mdc-radio-add-currency">
<input class="mdc-radio__native-control" type="radio" id="currency-gbp" name="radios" checked>
<div class="mdc-radio__background">
<div class="mdc-radio__outer-circle"></div>
<div class="mdc-radio__inner-circle"></div>
</div>
<div class="mdc-radio__ripple"></div>
</div>
<label for="currency-gbp">£</label>
<div class="mdc-radio mdc-radio-add-currency">
<input class="mdc-radio__native-control" type="radio" id="currency-eur" name="radios">
<div class="mdc-radio__background">
<div class="mdc-radio__outer-circle"></div>
<div class="mdc-radio__inner-circle"></div>
</div>
<div class="mdc-radio__ripple"></div>
</div>
<label for="currency-eur"></label>
</div>
<br>
<label class="mdc-text-field mdc-text-field-add-description mdc-text-field--filled">
<span class="mdc-text-field__ripple"></span>
<span class="mdc-floating-label" id="label-add-description">Description</span>
<input class="mdc-text-field__input" type="text" maxlength="100" aria-labelledby="label-add-description">
<span class="mdc-line-ripple"></span>
</label>
<div class="mdc-text-field-helper-line">
<div class="mdc-text-field-character-counter">0 / 100</div>
</div>
</div>
<div class="mdc-dialog__actions">
<button type="button" class="mdc-button mdc-dialog__button" data-mdc-dialog-action="cancel">
<div class="mdc-button__ripple"></div>
<span class="mdc-button__label">Cancel</span>
</button>
<button type="button" class="mdc-button mdc-dialog__button" onclick="newCreate();">
<div class="mdc-button__ripple"></div>
<span class="mdc-button__label">Create</span>
</button>
</div>
</div>
</div>
<div class="mdc-dialog__scrim"></div>
</div>
<div id="list" style="position: fixed;top: 64px;left: 0;bottom: 0;right:0;">
<ul class="mdc-list mdc-list--two-line" id="transactions"></ul>
<ul id="demo-zone" style="display:none;">
<div class="transaction" data-transaction-id="%transactionId%" style="padding:10px;border-bottom: 1px solid rgba(0, 0, 0, .25);display:grid;grid-template-columns: 48px 1fr;grid-column-gap: 15px;">
<div class="transaction-user" style="display:flex;align-items: center;justify-content: center;">
<img onerror="this.src='./static/default.png'" alt="%picture%" style="border-radius: 999px;width: 48px;height: 48px;">
</div>
<div class="transaction-details">
<b>%user%</b> %type% <span style="color:var(--perc-color);"><b>%amount_bc%</b> <i>(%amount_cc%)</i></span><br>
%time%<br>
<div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100%;">%description%</div>
</div>
</div>
<li class="transaction mdc-list-item" data-transaction-id="%transactionId%" id="demo-transaction">
<span class="mdc-list-item__ripple"></span>
<span class="mdc-list-item__text">
<div class="mdc-list-item__groups">
<img class="mdc-list-item__picture" onerror="this.src='./static/default.png'" alt="%picture%" style="border-radius: 999px;width: 36px;height: 36px;">
<div class="mdc-list-item__contents">
<span class="mdc-list-item__primary-text">%user% %type% <span style="color:var(--perc-color);filter:invert(1);"><b>%amount_bc%</b> <i>(%amount_cc%)</i></span></span>
<span class="mdc-list-item__secondary-text">%time% · %description%</span>
</div>
</div>
</span>
</li>
</ul>
</div>
<div id="stats" style="display:none;position:fixed;top:64px;left:0;bottom:0;right:0;overflow-x:auto;">
<p style="
font-size: 14px;
margin: 14px;
display:grid;
grid-template-columns: 12px 1fr;
grid-column-gap: 10px;
">
<span id="graph-insights-color" style="display: inline-block;width: 12px;height: 12px;border-radius: 999px;opacity: .75;background: black;vertical-align: middle;margin-right: 5px;margin-top:3px;"></span>
<span id="graph-insights-text" style="
display: inline-block;
vertical-align: middle;
">No insights available. Please try again later.</span>
</p>
<canvas id="graph-display" style="width:100%;height:100%;"></canvas>
<table style="margin-left:auto;margin-right:auto;margin-top:10px;width:max-content;">
<tr>
<td style="padding-right:10px; text-align:right;"><span id="stats-goal-item">Goal</span> Date:</td>
<td id="stats-goal-date">-</td>
</tr>
<tr>
<td style="padding-right:10px; text-align:right;">Exchange Rate:</td>
<td id="stats-exchange">-</td>
</tr>
<tr>
<td style="padding-right:10px; text-align:right;">Slope:</td>
<td id="stats-slope">-</td>
</tr>
<tr>
<td style="padding-right:10px; text-align:right;">Chances of Holidays:</td>
<td id="stats-chances-holidays">-</td>
</tr>
<tr>
<td style="padding-right:10px; text-align:right;">Life Savings w/o Holidays:</td>
<td id="stats-chances-living">-</td>
</tr>
<tr>
<td style="padding-right:10px; text-align:right;">Life Savings w/ Holidays:</td>
<td id="stats-chances-living2">-</td>
</tr>
</table>
<br>
</div>
<div id="expenses" style="display:none;position:fixed;top:64px;left:0;bottom:0;right:0;overflow-x:auto;">
<table id="expenses-table">
<thead>
<tr>
<th>Item name</th>
<th>Cost</th>
<th>Completeness</th>
</tr>
</thead>
<tbody id="expenses-items"></tbody>
</table>
<br>
</div>
<div id="goal" style="display:none;
position: fixed;
background: rgb(64, 64, 64);
bottom: 0;
left: 0;
right: 0;
padding: 10px;
z-index: 2;
"><b id="goal-name">%goal%</b> <span style="
float: right;
"><span id="goal-amount-eur">%goal_eur%</span>€, £<span id="goal-amount-gbp">%goal_gbp%</span> · <span id="goal-amount-percentage">%goal_percentage%</span>% completed</span><span id="goal-bar" style="
display: block;
height: 16px;
margin-top: 10px;
border-radius: 999px;
background: rgba(0, 0, 0, .25);
"><span id="goal-bar-fill" style="
height: 16px;
background: linear-gradient(90deg, rgba(183,153,201,1) 0%, rgba(87,58,152,1) 25%, rgba(204,129,148,1) 50%, rgba(235,186,115,1) 75%, rgba(169,83,144,1) 100%);
width: 0;
display: block;
border-radius: 999px;
"></span></span></div>
</main>
</div>
<script src="static/mobile-p3.js"></script>
<script src="static/page.js"></script>
<script src="static/graph.js"></script>
</body>
</html>

@ -1,44 +0,0 @@
#header {
border-bottom: 1px solid rgba(255, 255, 255, .25) !important;
height: 31px !important;
}
#view {
background: black !important;
color: white !important;
}
.transaction {
border-bottom: 1px solid rgba(255, 255, 255, .1) !important;
}
.transaction:hover, .transaction:active, .transaction:focus {
background: rgba(255, 255, 255, .1) !important;
}
#goal {
background: black !important;
border-top: 1px solid rgba(255, 255, 255, .25) !important;
}
#goal-bar {
background: rgba(255, 255, 255, .1) !important;
}
#confirm-modal-inner > h3, #create-modal-inner > h3, #about-modal-inner > h3 {
background: rgba(255, 255, 255, .1);
}
#confirm-modal-inner, #create-modal-inner, #about-modal-inner {
color: white;
background: rgb(60, 60, 60) !important;
}
.mdc-fab, .mdc-fab *, #header-user, #header-user *, .mdc-radio, .mdc-radio * {
overflow: hidden !important;
}
.mdc-top-app-bar {
background: #111;
border-bottom: 1px solid #252525;
}

File diff suppressed because one or more lines are too long

@ -1,58 +0,0 @@
async function createTransaction() {
document.getElementById('create-action').disabled = true;
document.getElementById('create-currency').disabled = true;
document.getElementById('create-description').disabled = true;
document.getElementById('create-amount').disabled = true;
document.getElementById('create-button-create').disabled = true;
document.getElementById('create-button-cancel').disabled = true;
if (isNodeJS) {
await (await window.fetch("https://ponies.equestria.horse/bits/Application/AddTransaction/index.php?Currency=" + document.getElementById('create-currency').value + "&Amount=" + document.getElementById('create-amount').value + "&Operation=" + document.getElementById('create-action').value + "&Description=" + Buffer.from(document.getElementById('create-description').value).toString("base64url"))).text();
} else {
await (await window.fetch("https://ponies.equestria.horse/bits/Application/AddTransaction/index.php?Currency=" + document.getElementById('create-currency').value + "&Amount=" + document.getElementById('create-amount').value + "&Operation=" + document.getElementById('create-action').value + "&Description=" + btoa(document.getElementById('create-description').value).replaceAll("+", "-").replaceAll("/", "_"))).text();
}
await refresh();
document.getElementById('create-action').disabled = false;
document.getElementById('create-currency').disabled = false;
document.getElementById('create-description').disabled = false;
document.getElementById('create-amount').disabled = false;
document.getElementById('create-button-create').disabled = false;
document.getElementById('create-button-cancel').disabled = false;
document.getElementById('create-modal').style.display = 'none';
document.getElementById('create-action').value = '+';
document.getElementById('create-currency').value = '£';
document.getElementById('create-description').value = '';
document.getElementById('create-amount').value = '';
}
async function newCreate() {
if (!addAmount.valid || !addDescription.valid || document.querySelector(".mdc-add-dialog .mdc-text-field-add-amount > input").value.trim() === "" || document.querySelector(".mdc-add-dialog .mdc-text-field-add-description > input").value.length > 100) return;
document.getElementById("action-remove").disabled = true;
document.getElementById("action-add").disabled = true;
document.getElementById("currency-eur").disabled = true;
document.getElementById("currency-gbp").disabled = true;
document.querySelector(".mdc-add-dialog .mdc-text-field-add-amount > input").disabled = true;
document.querySelector(".mdc-add-dialog .mdc-text-field-add-description > input").disabled = true;
Array.from(document.querySelectorAll(".mdc-add-dialog .mdc-dialog__actions button")).map((e) => e.disabled = true);
await (await window.fetch("https://ponies.equestria.horse/bits/Application/AddTransaction/index.php?Currency=" + (document.getElementById("currency-eur").checked ? "€" : "£") + "&Amount=" + document.querySelector(".mdc-add-dialog .mdc-text-field-add-amount > input").value + "&Operation=" + (document.getElementById("action-add").checked ? "+" : "-") + "&Description=" + btoa(document.querySelector(".mdc-add-dialog .mdc-text-field-add-description > input").value).replaceAll("+", "-").replaceAll("/", "_"))).text();
await refresh();
document.getElementById("action-remove").disabled = false;
document.getElementById("action-add").disabled = false;
document.getElementById("currency-eur").disabled = false;
document.getElementById("currency-gbp").disabled = false;
document.querySelector(".mdc-add-dialog .mdc-text-field-add-amount > input").disabled = false;
document.querySelector(".mdc-add-dialog .mdc-text-field-add-description > input").disabled = false;
Array.from(document.querySelectorAll(".mdc-add-dialog .mdc-dialog__actions button")).map((e) => e.disabled = false);
addDialog.close();
document.getElementById("action-add").checked = true;
document.getElementById("currency-gbp").checked = true;
document.querySelector(".mdc-add-dialog .mdc-text-field-add-amount > input").value = "";
document.querySelector(".mdc-add-dialog .mdc-text-field-add-description > input").value = "";
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

@ -1,14 +0,0 @@
async function deleteTransaction(id) {
let transaction = transactions.filter(i => i.date.absolute === id)[0];
console.log(transaction);
showConfirm("This will remove the transaction made by " + transaction.author.name + " " + transaction.date.relative + ".\nIt will be removed from the list and the global balance will be recalculated without this transaction.");
confirmAction = async () => {
if (isNodeJS) {
await (await window.fetch("https://ponies.equestria.horse/bits/Application/RemoveTransaction/index.php?Transaction=" + Buffer.from(id).toString("base64url"))).text();
} else {
await (await window.fetch("https://ponies.equestria.horse/bits/Application/RemoveTransaction/index.php?Transaction=" + btoa(id).replaceAll("+", "-").replaceAll("/", "_"))).text();
}
await refresh();
deleteDialog.close();
}
}

@ -1,60 +0,0 @@
f13presses = 0;
document.onkeydown = (event) => {
if (event.keyCode === 124) {
if (require('os').platform() === "win32") {
alert("haha you're using an inferior OS! Doing F13 on here is too easy so you might have expected " +
"something but you're not going to get it.")
} else {
f13presses++;
switch (f13presses) {
case 1:
Array.from(document.querySelectorAll("*")).forEach((item) => {
item.style.fontFamily = "'Noto Sans Symbols', 'Wingdings', 'Webdings', monospace";
});
break;
case 2:
Array.from(document.querySelectorAll("*")).forEach((item) => {
item.style.background = "red";
});
break;
case 3:
Array.from(document.querySelectorAll("*")).forEach((item) => {
item.style.color = "blue";
});
break;
case 4:
Array.from(document.querySelectorAll("img")).forEach((item) => {
item.src = "";
item.style.color = "yellow";
});
break;
case 5:
Array.from(document.querySelectorAll("*")).forEach((item) => {
item.style.transition = "transform 200ms";
item.style.animationName = "shake";
item.style.animationDuration = "200ms";
item.style.animationIterationCount = "infinite";
item.style.animationDirection = "alternate-reverse";
});
break;
case 6:
Array.from(document.querySelectorAll("*")).forEach((item) => {
item.style.display = "none";
});
break;
default:
Array.from(document.querySelectorAll("*")).forEach((item) => {
window.close();
});
break;
}
}
}
}

@ -1,9 +0,0 @@
window.onerror = (event, source, lineno, colno, error) => {
if (error.message === "FocusTrap: Element must have at least one focusable child.") return;
if (appLoading) {
document.getElementById("loadfailure").style.display = "";
} else {
document.getElementById("error").style.display = "block";
document.getElementById("error").innerText = error.stack;
}
}

Binary file not shown.

@ -1,156 +0,0 @@
:root {
--perc-color: black;
}
* {
user-select: none;
overflow-x: hidden !important;
}
html, body {
margin: 0;
background-color: var(--mdc-theme-background);
}
body {
color: white;
font-family: sans-serif;
}
.ln:hover {
text-decoration: underline;
}
.ln:active {
opacity: .75;
}
.transaction {
transition: background-color 100ms;
}
.transaction:hover {
background-color: rgba(0, 0, 0, .1);
}
@keyframes shake {
0% {
transform: scale(1);
}
100% {
transform: scale(1.5);
}
}
:root {
--mdc-theme-surface: #222;
--mdc-theme-primary: #F2BE82;
--mdc-theme-secondary: var(--mdc-theme-primary);
--mdc-theme-background: #000;
--mdc-theme-on-surface: #fff;
--mdc-theme-on-primary: #000;
--mdc-theme-on-secondary: #000;
--mdc-dialog-z-index: 99999999;
}
.mdc-top-app-bar, .mdc-top-app-bar * {
color: white !important;
}
.mdc-top-app-bar {
background-color: #39271b;
}
.mdc-dialog .mdc-dialog__content {
color: rgba(255, 255, 255, .6);
}
.mdc-dialog .mdc-dialog__title {
color: rgba(255, 255, 255, .87);
}
.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label {
color: rgba(242, 190, 130, 0.87);
}
.mdc-text-field, .mdc-text-field *, .mdc-list-item, .mdc-list-item * {
overflow: hidden !important;
}
.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input {
color: rgba(255, 255, 255, 0.87) !important;
}
.mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label {
color: rgba(255, 255, 255, 0.6) !important;
}
.mdc-text-field--filled:not(.mdc-text-field--disabled) {
background-color: rgba(255, 255, 255, .1);
color: white;
}
.mdc-form-field {
color: white;
}
.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle {
border-color: rgba(255, 255, 255, 0.54);
}
.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field-character-counter, .mdc-text-field:not(.mdc-text-field--disabled)+.mdc-text-field-helper-line .mdc-text-field-character-counter {
color: rgba(255, 255, 255, 0.6);
}
.mdc-button:disabled {
color: rgba(255, 255, 255, 0.38);
}
.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle, .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle {
border-color: rgba(255, 255, 255, 0.38);
}
.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle, .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle {
border-color: rgba(255, 255, 255, 0.38);
}
.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle, .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle {
border-color: rgba(255, 255, 255, 0.38);
}
.mdc-list-item {
filter: invert(1);
}
.mdc-list-item__text {
padding: 7px 0;
}
.mdc-list-item__groups {
display: grid;
grid-template-columns: 36px 1fr;
grid-column-gap: 15px;
}
.mdc-list-item__picture {
background: rgb(37, 37, 37);
filter: invert(1);
margin-top: 8px;
}
#expenses-table {
margin-left: auto;
margin-right: auto;
margin-top: 20px;
max-width: 95vw;
border-collapse: collapse;
}
#expenses-table th, #expenses-table td {
border: 1px solid rgba(255, 255, 255, .25);
padding: 10px 20px;
}
#expenses-table thead {
border-bottom: 2px solid rgba(255, 255, 255, .25);
}

@ -1,34 +0,0 @@
const ctx = document.getElementById('graph-display').getContext('2d');
const graph = new Chart(ctx, {