";
const bootEl = root.querySelector("#t-boot");
const mainEl = root.querySelector("#t-main");
const input = root.querySelector("#t-input");
const output = root.querySelector("#t-output");
function esc(s) {
return String(s == null ? "" : s)
.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """);
}
function stamp() {
return new Date().toLocaleTimeString("en-GB", { hour12: false });
}
// ---- command handlers ---------------------------------------------------
const COMMANDS = {
help() {
const rows = [
["help", "show this list"],
["code", "Shows the website source code"],
["socials", "list all socials"],
["", "show a social & ask to open it (append -open to do directly)"],
["system", "open my system website (append a person's name to open their page)"],
["about", "a little about me"],
["hyfetch", "system info, with flair"]
];
let out = "Available commands:\n";
out += rows.map((r) => " " + r[0].padEnd(12) + r[1]).join("\n");
out += "\n\nTip: type a social's name (try 'socials') to open it.";
return { text: out };
},
ls() {
const rows = [
["help", "show this list"],
["code", "Shows the website source code"],
["socials", "list all socials"],
["", "show a social & ask to open it (append -open to do directly)"],
["system", "open my system website (append a person's name to open their page)"],
["about", "a little about me"],
["hyfetch", "system info, with flair"]
];
let out = "Available commands:\n";
out += rows.map((r) => " " + r[0].padEnd(12) + r[1]).join("\n");
out += "\n\nTip: type a social's name (try 'socials') to open it.";
return { text: out };
},
code() {
window.open("https://git.gay/doughmination/clove-is-a-dev", "_blank");
return { text: "Opening site source code..." }
},
async system(args) {
const who = (args[0] || "").toLowerCase();
if (!who) {
window.open("https://system.doughmination.co.uk/", "_blank");
return { text: "Opening system site..." };
}
try {
const response = await fetch(
`https://system.doughmination.co.uk/api/member/${encodeURIComponent(who)}`
);
if (response.status === 200) {
window.open(`https://system.doughmination.co.uk/${encodeURIComponent(who)}`, "_blank");
return { text: `Opening ${who}'s profile...` };
}
if (response.status === 404) {
return { text: "That person doesn't exist." };
}
if (response.status === 502) {
return { text: "The server is currently having issues." };
}
return { text: `Unexpected response (${response.status}).` };
} catch (error) {
return { text: "Failed to contact the server." };
}
},
socials() {
const items = Object.keys(SOCIALS)
.map((k) => '' + esc(k) + "").join("");
return {
html: '
' + items + "
" +
'
type one to view it, or <name> -open to open
'
};
},
about() {
return {
text:
"Clove Twilight — fae/faer\n" +
"Transfem developer from Southampton, UK. I make Discord bots,\n" +
"personal-site nonsense, and run a small corner of the internet\n" +
"under the trade mark 'doughmination system'. Big on Linux, Catppuccin, and cats.\n\n" +
"This site is the beta playground for clove.is-a.dev — expect things\n" +
"to break in funny ways. Type 'socials' to find me elsewhere."
};
},
hyfetch() {
const info = [
'arch@arch',
"-----------------------",
"OS........ Arch Linux x86_64",
"GPU....... AMD ATI SPEEDSTER MERC 310 RX 7900 XTX",
"CPU....... AMD Ryzen 9 9950X3D (8) @ 5.7GHz",
"Host...... B850M AORUS ELITE WIFI6E ICE -CF-WCP-ADO",
"Kernel.... 7.0.11-arch1-1",
"Shell..... bash 5.3.12",
"Theme..... Breeze-Dark [GTK2/3]",
"Pronouns.. fae/faer",
"Uptime.... " + uptime(),
].join("\n");
if (!archLines || !archLines.length) {
return { html: '