Repository: DosX-dev/braux
Branch: main
Commit: 43f2d11c7618
Files: 14
Total size: 29.7 KB
Directory structure:
gitextract_k6pjxpc4/
├── .github/
│ └── FUNDING.yml
├── LICENSE
├── README.md
└── source/
├── index.htm
├── modules/
│ ├── app.js
│ ├── context.js
│ ├── fp-api.js
│ ├── io-fs.js
│ └── manifest.js
└── styles/
├── global.css
└── themes/
├── cherry.css
├── dark.css
├── hacker.css
└── light.css
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ['https://github.com/DosX-dev/DosX-dev/blob/main/donate.md'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2023 DosX
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# What is Braux?
Braux is a unique console system built on browser-based client tools.
It combines ease of use with powerful features, giving you a Unix-like
command line with a choice of different themes and color schemes.
# Installed?
### https://dosx.su/terminal
# To do
* make command control the current user



================================================
FILE: source/index.htm
================================================
<!DOCTYPE html>
<!--
Author: DosX
-->
<html>
<head>
<title>Braux: Terminal</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate">
<link rel="stylesheet" href="styles/global.css">
<link rel="stylesheet" href="styles/themes/dark.css" id="theme-link">
</head>
<body>
<div id="context-menu">
<div class="item" onclick="pushCommand('clear')">Clear</div>
<div class="item" onclick="pushCommand('about')">About</div>
<hr>
<div style="margin-bottom: 7px; margin-left: 7px; color: gray;" id="version-info"></div>
</div>
<div id="app" class="container">
<div id="console"></div>
<div class="prompt">
<span><span class="pointer">> </span></span><input type="text" autocapitalize="off" autocomplete="off"
autocorrect="off" id="commandInput" spellcheck="false" placeholder="help" maxlength=2048>
</div>
</div>
<!-- context menu -->
<script src="modules/context.js"></script>
<!-- fingerprint -->
<script src="modules/fp-api.js"></script>
<!-- file system [beta] -->
<script src="modules/io-fs.js"></script>
<script src="modules/manifest.js"></script>
<script src="modules/app.js"></script>
</body>
</html>
================================================
FILE: source/modules/app.js
================================================
// Github: https://github.com/DosX-dev/braux
const visual = {
themes: {
dark: 'styles/themes/dark.css',
light: 'styles/themes/light.css',
cherry: 'styles/themes/cherry.css',
hacker: 'styles/themes/hacker.css'
},
installTheme(theme) {
visual.setTheme(theme);
localStorage.setItem('console-theme', theme);
},
setTheme(theme) {
const linkId = 'theme-link',
link = document.getElementById(linkId);
if (link) {
link.href = theme;
} else {
const newLink = document.createElement('link');
newLink.id = linkId;
newLink.rel = 'stylesheet';
newLink.href = theme;
document.head.appendChild(newLink);
}
},
loadTheme() {
const theme = localStorage.getItem('console-theme');
if (theme) {
visual.setTheme(theme);
} else {
const preferredTheme = window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches ? visual.themes.dark : visual.themes.light;
visual.installTheme(preferredTheme);
}
}
}
visual.loadTheme();
document.getElementById('version-info').innerText = `version ${config.version}`;
Object.entries({
"app-default-config": "0",
"app-prompt": navigator.userAgent
}).forEach(([key, value]) => {
setDefaultPromptValue(key, value);
});
const commandInput = document.getElementById("commandInput");
const isWelcomeHiddenKey = 'isWelcomeHidden';
function isWelcomeHidden() {
return localStorage.getItem(isWelcomeHiddenKey);
}
var commandHistory = [],
currentCommandIndex = -1;
const userProfile = {
name: {
key: 'user',
defaultName: 'user',
get() {
const userNameValue = localStorage.getItem(userProfile.name.key);
if (userNameValue) {
return userNameValue;
} else {
this.set(this.defaultName);
return this.defaultName;
}
},
set(newUserName) {
if (newUserName.length < 1) {
console.error('Username cannot be empty.');
return;
} else if (!/^[a-zA-Z0-9]+$/.test(newUserName)) {
console.error('Invalid characters.');
return;
}
localStorage.setItem(userProfile.name.key, newUserName.toLowerCase());
}
}
};
function replaceTagsWithEntities(text) {
return replacedText = text.replace(/</g, '<').replace(/>/g, '>');
}
function setFocus() {
if (window.getSelection().toString() == '' && commandInput !== document.activeElement) {
commandInput.focus();
}
}
async function getIpInfo(ip = '') {
const response = await fetch('https://freeipapi.com/api/json/' + ip, {
method: 'GET'
});
const data = await response.json();
const processedData = Object.entries(data)
.map(([key, value]) => `<b>${key}</b>: ${value}`)
.join('\n');
return processedData + '\n<b>apiUsed</b>: freeipapi.com';
}
function wrapFirstWord(sentence) {
var words = sentence.split(' ');
if (words.length === 0) {
return '';
}
words[0] = `<span class="first">${words[0]}</span>`;
return words.join(' ');
}
window.onerror = function(message, source, lineno, colno, error) {
console.error(`[APP]: ${message}`);
};
function autoScroll() {
window.scrollTo(0, document.body.scrollHeight);
}
function pushCommand(command, displayCommand = true, sudo = false) {
var consoleDiv = document.getElementById('console'),
output = document.createElement('div');
if (displayCommand) {
commandInput.placeholder = '';
output.classList.add('out');
output.innerHTML = '<span class="pointer">> </span><span class="command">' + wrapFirstWord(replaceTagsWithEntities(command)) + '</span>';
consoleDiv.appendChild(output);
}
function executeAsRoot(callback) {
if (sudo) {
callback();
} else {
error('You do not have permission to execute this command.');
out(`Try '<u><span class="insert-cmd">sudo ${command}</span></u>' (click to insert)`);
}
}
function getAllCommandArguments(array) {
let out = '';
for (let i = 1; i < array.length; i++) {
out += array[i] + (i == array.length - 1 ? '' : ' ');
}
return out;
}
function out(text) {
let outStd = document.createElement('div');
['out', 'log'].forEach(outClass => {
outStd.classList.add(outClass);
});
outStd.innerHTML = text;
consoleDiv.appendChild(outStd);
autoScroll();
}
function error(text) {
out(`<span class="error">${text}</span>`);
let lastCommands = document.getElementsByClassName("command"),
lastCommand = lastCommands[lastCommands.length - 1];
lastCommand.style = 'color: rgba(255, 79, 79);';
lastCommand.innerHTML += '<span style="color: gray;"> (!)</span>';
autoScroll();
}
console.error = error;
console.log = console.info = console.warn = out;
console.clear = () => pushCommand("clear");
const commandArgs = command.trim().split(' ');
switch (commandArgs[0]) {
case 'help':
out(`<span class="insert-cmd">help</span> - show this message
<span class="insert-cmd">clear</span> - clear console
<span class="insert-cmd">theme</span> [name] - change theme
<span class="insert-cmd">echo</span> [html] - format and write text in console
<span class="insert-cmd">ipinfo</span> [ip] - get info about IP (no domains support)
<span class="insert-cmd">history</span> - get a log of commands entered
<span class="insert-cmd">fingerprint</span> - get client information
<span class="insert-cmd">clear</span> - clear console
<span class="insert-cmd">sudo [command]</span> - execute command as root
<span class="insert-cmd">about</span> - get info about application
<span class="insert-cmd">reboot</span> - restart the application
<span class="insert-cmd">exit</span> - exit from the application
* <span class="insert-cmd">js</span> [code] - execute JavaScript (unsafe)
* <span class="insert-cmd">factory-reset</span> - reset all application data settings
`);
break;
case 'clear':
consoleDiv.innerText = '';
out("<i>Console cleared.</i>");
break;
case 'exit':
out('Goodbye!');
setTimeout(function() {
window.location.href = 'about:blank';
}, 300);
break;
case 'echo':
out(getAllCommandArguments(commandArgs))
break;
case 'fingerprint':
out(fingerprint());
break;
case 'factory-reset':
executeAsRoot(() => {
localStorage.clear();
out(`All data of '${document.domain}' erased`);
setTimeout(() => {
pushCommand('reboot', false);
}, 750);
});
break;
case 'history':
switch (commandArgs[1]) {
case 'clear':
clearCommandHistory();
out('Command history cleared.');
break;
case 'list':
out(getCommandHistory());
break;
default:
out(`Arguments:
* list (get history as numbered list)
* clear (clear history)
Usage: <span class="insert-cmd">history list</span>`)
}
break;
case 'theme':
let isSeccuss = true;
switch (commandArgs[1]) {
case 'dark':
visual.installTheme(visual.themes.dark);
break;
case 'light':
visual.installTheme(visual.themes.light);
break;
case 'cherry':
visual.installTheme(visual.themes.cherry);
break;
case 'hacker':
visual.installTheme(visual.themes.hacker);
break;
default:
isSeccuss = false;
out(`Themes:
* dark
* light
* cherry
* hacker
Usage: <span class="insert-cmd">theme dark</span>`);
}
if (isSeccuss) {
out(`Theme installed: ${commandArgs[1]}`);
}
break;
case 'ipinfo':
out('Requesting...');
getIpInfo(commandArgs[1])
.then(dataString => {
out(dataString);
})
.catch(error => {
error('No API access');
});
break;
case 'js':
executeAsRoot(() => {
let codeToExec = getAllCommandArguments(commandArgs);
if (codeToExec.trim() == '') {
error('Empty source!');
} else {
try {
out(`<span style="color: gray;"><span class="pointer">< </span>${eval(codeToExec)}<span>`);
} catch (exc) {
error(`[VM]: ${exc}`);
}
}
});
break;
case 'about':
out(` OS: ${version.os}
Kernel: ${version.kernel}
Shell: ${version.shell}`);
break;
case 'reboot':
out('Rebooting...');
setTimeout(() => {
location.reload();
}, 300);
break;
case 'su':
error(`You can only use '<span class="insert-cmd">sudo</span>'`);
break;
case 'sudo':
let commandToExecute = getAllCommandArguments(commandArgs);
if (commandToExecute.trim() == '') {
out(`Usage: sudo [command]`)
}
pushCommand(commandToExecute, false, true);
break;
case 'remove-intro':
localStorage.setItem(isWelcomeHiddenKey, String(true))
break;
case 'python': // Yes, I hate python
error('Do not embarrass yourself.');
break;
case '': // Empty prompt
break;
case '#': // Comment
break;
default:
error(`Command or packet '<u>${commandArgs[0]}</u>' not found!`);
}
autoScroll();
}
function pushCommandScript(command, sudo = false) {
command.split('\n').forEach(element => {
pushCommand(element, false, sudo);
});
}
pushCommand(`echo Welcome, ${userProfile.name.get()}!`, false);
if (isWelcomeHidden() !== String(true)) {
pushCommand('echo ' +
`+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<b>Braux</b> is a unique console system built on browser-based client tools.
It combines ease of use with powerful features, giving you a Unix-like
command line with a choice of different themes and color schemes.
GitHub -> <a target="_blank" href="https://github.com/DosX-dev/braux">https://github.com/DosX-dev/braux</a>
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Use '<u><span class="insert-cmd">remove-intro</span></u>' to remove this message`, false);
}
function setDefaultPromptValue(name, defaultValue) {
const urlParams = new URLSearchParams(window.location.search);
if (!urlParams.has(name)) {
let locationBarSections = document.URL.split('/'),
locationBarLastSection = locationBarSections[locationBarSections.length - 1],
separator = locationBarLastSection.includes('?') ? '&' : '?',
newUrl = `${window.location.href + separator + name}=${defaultValue}`;
history.pushState({ path: newUrl }, '', newUrl);
}
}
// load history form localStorage
const storedHistory = localStorage.getItem("history");
if (storedHistory) {
commandHistory = JSON.parse(storedHistory);
currentCommandIndex = commandHistory.length;
}
commandInput.addEventListener("keydown", (event) => {
switch (event.keyCode) {
case 13: // Enter
let command = commandInput.value.trim();
if (command !== '') {
if (commandHistory.length === 0 || command !== commandHistory[commandHistory.length - 1]) {
commandHistory.push(command);
}
currentCommandIndex = commandHistory.length;
// save history in localStorage
localStorage.setItem("history", JSON.stringify(commandHistory));
}
break;
case 38: // Up
event.preventDefault();
if (currentCommandIndex > 0) {
currentCommandIndex--;
commandInput.value = commandHistory[currentCommandIndex];
}
break;
case 40: // Down
event.preventDefault();
if (currentCommandIndex < commandHistory.length - 1) {
currentCommandIndex++;
commandInput.value = commandHistory[currentCommandIndex];
} else {
currentCommandIndex = commandHistory.length;
commandInput.value = '';
}
break;
default:
break;
}
});
function getCommandHistory() {
return commandHistory.map((command, index) => `${index + 1}. <span class="insert-cmd">${command}</span>`).join("\n");
}
function clearCommandHistory() {
commandHistory = [];
currentCommandIndex = 0;
localStorage.removeItem("history");
}
document.addEventListener('DOMContentLoaded', () => {
commandInput.addEventListener('keypress', function(event) {
if (event.keyCode === 13) { // Enter
event.preventDefault();
pushCommand(commandInput.value.trim());
commandInput.value = '';
}
});
});
setInterval(() => {
setFocus()
}, 500);
document.addEventListener('click', (event) => {
if (event.target.classList.contains('insert-cmd')) {
commandInput.value = event.target.textContent;
}
});
================================================
FILE: source/modules/context.js
================================================
// Github: https://github.com/DosX-dev/braux
const contextMenu = document.getElementById("context-menu");
const scope = document.querySelector("body");
const normalizePozition = (mouseX, mouseY) => {
// ? compute what is the mouse position relative to the container element (scope)
let {
left: scopeOffsetX,
top: scopeOffsetY,
} = scope.getBoundingClientRect();
scopeOffsetX = scopeOffsetX < 0 ? 0 : scopeOffsetX;
scopeOffsetY = scopeOffsetY < 0 ? 0 : scopeOffsetY;
const scopeX = mouseX - scopeOffsetX,
scopeY = mouseY - scopeOffsetY;
// ? check if the element will go out of bounds
const outOfBoundsOnX =
scopeX + contextMenu.clientWidth > scope.clientWidth;
const outOfBoundsOnY =
scopeY + contextMenu.clientHeight > scope.clientHeight;
let normalizedX = mouseX,
normalizedY = mouseY;
// ? normalize on X
if (outOfBoundsOnX) {
normalizedX =
scopeOffsetX + scope.clientWidth - contextMenu.clientWidth;
}
// ? normalize on Y
if (outOfBoundsOnY) {
normalizedY =
scopeOffsetY + scope.clientHeight - contextMenu.clientHeight;
}
return {
normalizedX,
normalizedY
};
};
scope.addEventListener("contextmenu", (event) => {
event.preventDefault();
const {
clientX: mouseX,
clientY: mouseY
} = event, {
normalizedX,
normalizedY
} = normalizePozition(mouseX, mouseY);
contextMenu.classList.remove("visible");
contextMenu.style.top = `${normalizedY}px`;
contextMenu.style.left = `${normalizedX}px`;
setTimeout(() => {
contextMenu.classList.add("visible");
});
});
scope.addEventListener("click", (event) => {
// ? close the menu if the user clicks outside of it
if (event.target.offsetParent != contextMenu) {
contextMenu.classList.remove("visible");
}
});
const items = document.getElementsByClassName("item");
Array.from(items).forEach(item => {
item.addEventListener("click", (event) => {
contextMenu.classList.remove('visible');
});
});
================================================
FILE: source/modules/fp-api.js
================================================
// Github: https://github.com/DosX-dev/braux
function fingerprint() {
var fingerprintData = {
'User Agent': navigator.userAgent,
'Browser Language': navigator.language,
'Cookies Enabled': navigator.cookieEnabled,
'Screen Resolution': screen.width + 'x' + screen.height,
'Available Screen Resolution': screen.availWidth + 'x' + screen.availHeight,
'Color Depth': screen.colorDepth,
'Timezone': Intl.DateTimeFormat().resolvedOptions().timeZone,
'Local Storage Enabled': typeof Storage !== 'undefined',
'Session Storage Enabled': typeof sessionStorage !== 'undefined',
'Do Not Track': Boolean(navigator.doNotTrack),
'Plugins': Array.from(navigator.plugins).map(plugin => plugin.name).join(', '),
'WebGL Vendor': getWebGLVendor(),
'WebGL Renderer': getWebGLRenderer(),
'WebGL Version': getWebGLVersion(),
'Web Audio API': isWebAudioAPISupported(),
'MIDI API': isMIDIAPIAvailable(),
'WebSockets Supported': isWebSocketsSupported(),
'Battery API Supported': isBatteryAPISupported(),
'WebVR API Supported': isWebVRAPIAvailable(),
'AudioContext Max Channels': getMaxAudioContextChannels(),
'Is Chromium based': isChromium()
};
var fingerprintString = Object.entries(fingerprintData)
.map(entry => `<b>${entry[0]}</b>` + ': ' + entry[1])
.join('\n');
return fingerprintString;
}
function getWebGLVendor() {
var canvas = document.createElement('canvas'),
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (gl && gl.getExtension('WEBGL_debug_renderer_info')) { return gl.getParameter(gl.getExtension('WEBGL_debug_renderer_info').UNMASKED_VENDOR_WEBGL); }
return 'N/A';
}
function getWebGLRenderer() {
var canvas = document.createElement('canvas'),
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (gl && gl.getExtension('WEBGL_debug_renderer_info')) { return gl.getParameter(gl.getExtension('WEBGL_debug_renderer_info').UNMASKED_RENDERER_WEBGL); }
return 'N/A';
}
function getWebGLVersion() {
var canvas = document.createElement('canvas'),
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
if (gl) { return gl.getParameter(gl.VERSION); }
return 'N/A';
}
function isWebAudioAPISupported() { return typeof window.AudioContext !== 'undefined' || typeof window.webkitAudioContext !== 'undefined'; }
function isMIDIAPIAvailable() { return typeof navigator.requestMIDIAccess !== 'undefined'; }
function isWebSocketsSupported() { return 'WebSocket' in window ? 'Supported' : 'Not supported'; }
function isBatteryAPISupported() { return navigator.getBattery ? 'Supported' : 'Not supported'; }
function isWebVRAPIAvailable() { return 'getVRDisplays' in navigator ? 'Supported' : 'Not supported'; }
function isWebXRAPIAvailable() { return 'xr' in navigator ? 'Supported' : 'Not supported'; }
function getMaxAudioContextChannels() {
try {
var audioContext = new(window.AudioContext || window.webkitAudioContext)(),
maxChannels = audioContext.destination.maxChannelCount;
audioContext.close();
return maxChannels;
} catch (exc) {
return 'N/A'
}
}
function isChromium() { return typeof window.chrome == 'object'; }
function isOpera() { return typeof window.opera == 'object'; }
================================================
FILE: source/modules/io-fs.js
================================================
// Github: https://github.com/DosX-dev/braux
class FileSystem {
constructor() {
this.storage = window.localStorage;
this.files = JSON.parse(this.storage.getItem('files')) || {};
this.serializedFiles = JSON.stringify(this.files);
this.fileList = Object.keys(this.files).join('\n');
}
createFile(name, content = '') {
if (!this.isValidFileName(name)) {
throw new Error('Invalid file name');
}
if (this.fileExists(name)) {
throw new Error('File already exists');
}
this.files[name] = content;
this.serializedFiles = JSON.stringify(this.files);
this.saveFiles();
}
deleteFile(name) {
if (!this.isValidFileName(name)) {
throw new Error('Invalid file name');
}
if (!this.fileExists(name)) {
throw new Error('File not found');
}
delete this.files[name];
this.serializedFiles = JSON.stringify(this.files);
this.saveFiles();
}
readFile(name) {
if (!this.isValidFileName(name)) {
throw new Error('Invalid file name');
}
if (!this.fileExists(name)) {
throw new Error('File not found');
}
return this.files[name];
}
writeFile(name, content) {
if (!this.isValidFileName(name)) {
throw new Error('Invalid file name');
}
if (!this.fileExists(name)) {
throw new Error('File not found');
}
this.files[name] = content;
this.serializedFiles = JSON.stringify(this.files);
this.saveFiles();
}
saveFiles() {
this.storage.setItem('files', this.serializedFiles);
}
getFileList() {
return this.fileList;
}
isValidFileName(name) {
const forbiddenChars = /[^\w\d-_]/;
return !forbiddenChars.test(name);
}
fileExists(name) {
return name in this.files;
}
}
const IO = new FileSystem();
================================================
FILE: source/modules/manifest.js
================================================
// Github: https://github.com/DosX-dev/braux
const config = {
version: '3.20.25'
},
version = {
os: 'braux (client)',
kernel: 'VM-' + config.version,
shell: 'bash-js'
}
================================================
FILE: source/styles/global.css
================================================
html,
body {
transition: background-color 0.8s, color 0.8s;
cursor: default;
font-family: monospace;
margin: 0;
padding: 0;
zoom: 100%;
width: 100%;
height: 100%;
}
input .container {
margin-left: 10px;
}
input,
.prompt {
user-select: none;
}
.command {
white-space: pre-wrap;
}
.first {
font-style: italic;
}
.log {
margin: 10px;
margin-bottom: 10px;
white-space: pre-wrap;
}
hr {
height: 1px;
border: none;
}
#console {
overflow-y: auto;
word-wrap: break-word;
}
::-webkit-scrollbar {
width: 10px;
}
input[type="text"] {
cursor: default;
background-color: transparent;
border: none;
font-family: monospace;
font-size: inherit;
width: 94vw;
outline: none;
}
.error {
transition: background-color 0.9s, color 0.9s;
border-radius: 4px;
height: 100%;
}
a {
transition: background-color 0.3s, color 0.3s;
text-decoration-line: none;
border-bottom: 1px dotted;
}
.insert-cmd {
cursor: help;
}
#context-menu {
border: 1px solid;
position: fixed;
z-index: 10000;
width: 150px;
border-radius: 5px;
transform: scale(0);
transform-origin: top left;
user-select: none;
}
#context-menu.visible {
transform: scale(1);
transition: transform 200ms ease-in-out;
}
#context-menu .item {
transition: background-color 0.3s, color 0.3s;
padding: 8px 10px;
font-size: 15px;
cursor: pointer;
border-radius: inherit;
}
================================================
FILE: source/styles/themes/cherry.css
================================================
body {
background-color: rgb(41, 0, 35);
color: white;
}
hr {
background-color: rgb(108, 0, 158);
}
::-webkit-scrollbar-track {
background-color: black;
}
::-webkit-scrollbar-thumb {
background-color: white;
}
::selection {
background-color: rgb(255, 0, 43);
color: white;
}
input[type="text"] {
color: white;
caret-color: rgb(255, 210, 247);
}
.error {
background-color: rgb(190, 44, 44);
color: white;
}
a {
background-color: rgb(173, 0, 130);
color: white;
}
a:hover {
background-color: white;
color: rgb(255, 0, 191);
}
.pointer {
color: white;
}
#context-menu {
background: #1b1a1a;
border-color: rgb(108, 0, 158);
}
#context-menu .item {
color: #eee;
}
#context-menu .item:hover {
background: #4e004e;
}
================================================
FILE: source/styles/themes/dark.css
================================================
body {
background-color: black;
color: white;
}
hr {
background-color: rgb(66, 66, 66);
}
::-webkit-scrollbar-track {
background-color: black;
}
::-webkit-scrollbar-thumb {
background-color: white;
}
::selection {
background-color: white;
color: black;
}
input[type="text"] {
color: white;
caret-color: white;
}
.error {
background-color: rgb(116, 0, 0);
color: white;
}
a {
background-color: rgb(43, 100, 255);
color: white;
}
a:hover {
background-color: white;
color: rgb(57, 43, 255);
}
.pointer {
color: white;
}
#context-menu {
background: #1b1a1a;
border-color: rgb(66, 66, 66);
}
#context-menu .item {
color: #eee;
}
#context-menu .item:hover {
background: #343434;
}
================================================
FILE: source/styles/themes/hacker.css
================================================
body {
background-color: rgb(0, 18, 19);
color: white;
}
hr {
background-color: rgb(0, 138, 0);
}
::-webkit-scrollbar-track {
background-color: black;
}
::-webkit-scrollbar-thumb {
background-color: lime;
}
::selection {
background-color: rgb(0, 138, 0);
color: white;
}
input[type="text"] {
color: white;
caret-color: lime;
}
.error {
background-color: rgb(255, 155, 155);
color: black;
}
a {
background-color: rgb(23, 80, 0);
color: white;
}
a:hover {
background-color: white;
color: rgb(57, 43, 255);
}
.pointer {
color: lime;
}
#context-menu {
background: #1b1a1a;
border-color: rgb(23, 80, 0);
}
#context-menu .item {
color: #eee;
}
#context-menu .item:hover {
background: #003612;
}
================================================
FILE: source/styles/themes/light.css
================================================
body {
background-color: white;
color: black;
}
hr {
background-color: rgb(151, 151, 151);
}
::-webkit-scrollbar-track {
background-color: white;
}
::-webkit-scrollbar-thumb {
background-color: black;
}
::selection {
background-color: black;
color: white;
}
input[type="text"] {
color: black;
caret-color: black;
}
.error {
background-color: rgb(116, 0, 0);
color: white;
}
a {
background-color: rgb(0, 63, 238);
color: white;
}
a:hover {
background-color: rgb(0, 0, 0);
}
.pointer {
color: black;
}
#context-menu {
background: #eee;
border-color: rgb(151, 151, 151);
}
#context-menu .item {
color: #000000;
}
#context-menu .item:hover {
background: #dbdbdb;
}
gitextract_k6pjxpc4/
├── .github/
│ └── FUNDING.yml
├── LICENSE
├── README.md
└── source/
├── index.htm
├── modules/
│ ├── app.js
│ ├── context.js
│ ├── fp-api.js
│ ├── io-fs.js
│ └── manifest.js
└── styles/
├── global.css
└── themes/
├── cherry.css
├── dark.css
├── hacker.css
└── light.css
SYMBOL INDEX (39 symbols across 3 files)
FILE: source/modules/app.js
method installTheme (line 10) | installTheme(theme) {
method setTheme (line 14) | setTheme(theme) {
method loadTheme (line 28) | loadTheme() {
function isWelcomeHidden (line 53) | function isWelcomeHidden() {
method get (line 66) | get() {
method set (line 76) | set(newUserName) {
function replaceTagsWithEntities (line 91) | function replaceTagsWithEntities(text) {
function setFocus (line 95) | function setFocus() {
function getIpInfo (line 101) | async function getIpInfo(ip = '') {
function wrapFirstWord (line 115) | function wrapFirstWord(sentence) {
function autoScroll (line 131) | function autoScroll() {
function pushCommand (line 135) | function pushCommand(command, displayCommand = true, sudo = false) {
function pushCommandScript (line 389) | function pushCommandScript(command, sudo = false) {
function setDefaultPromptValue (line 409) | function setDefaultPromptValue(name, defaultValue) {
function getCommandHistory (line 464) | function getCommandHistory() {
function clearCommandHistory (line 468) | function clearCommandHistory() {
FILE: source/modules/fp-api.js
function fingerprint (line 3) | function fingerprint() {
function getWebGLVendor (line 35) | function getWebGLVendor() {
function getWebGLRenderer (line 42) | function getWebGLRenderer() {
function getWebGLVersion (line 49) | function getWebGLVersion() {
function isWebAudioAPISupported (line 56) | function isWebAudioAPISupported() { return typeof window.AudioContext !=...
function isMIDIAPIAvailable (line 58) | function isMIDIAPIAvailable() { return typeof navigator.requestMIDIAcces...
function isWebSocketsSupported (line 60) | function isWebSocketsSupported() { return 'WebSocket' in window ? 'Suppo...
function isBatteryAPISupported (line 62) | function isBatteryAPISupported() { return navigator.getBattery ? 'Suppor...
function isWebVRAPIAvailable (line 64) | function isWebVRAPIAvailable() { return 'getVRDisplays' in navigator ? '...
function isWebXRAPIAvailable (line 66) | function isWebXRAPIAvailable() { return 'xr' in navigator ? 'Supported' ...
function getMaxAudioContextChannels (line 68) | function getMaxAudioContextChannels() {
function isChromium (line 79) | function isChromium() { return typeof window.chrome == 'object'; }
function isOpera (line 81) | function isOpera() { return typeof window.opera == 'object'; }
FILE: source/modules/io-fs.js
class FileSystem (line 3) | class FileSystem {
method constructor (line 4) | constructor() {
method createFile (line 11) | createFile(name, content = '') {
method deleteFile (line 25) | deleteFile(name) {
method readFile (line 39) | readFile(name) {
method writeFile (line 51) | writeFile(name, content) {
method saveFiles (line 65) | saveFiles() {
method getFileList (line 69) | getFileList() {
method isValidFileName (line 73) | isValidFileName(name) {
method fileExists (line 78) | fileExists(name) {
Condensed preview — 14 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (33K chars).
[
{
"path": ".github/FUNDING.yml",
"chars": 864,
"preview": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [u"
},
{
"path": "LICENSE",
"chars": 1061,
"preview": "MIT License\n\nCopyright (c) 2023 DosX\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof th"
},
{
"path": "README.md",
"chars": 368,
"preview": "# What is Braux?\nBraux is a unique console system built on browser-based client tools.\nIt combines ease of use with powe"
},
{
"path": "source/index.htm",
"chars": 1341,
"preview": "<!DOCTYPE html>\n<!--\n Author: DosX\n-->\n\n<html>\n\n<head>\n <title>Braux: Terminal</title>\n <meta name=\"viewport\" c"
},
{
"path": "source/modules/app.js",
"chars": 14363,
"preview": "// Github: https://github.com/DosX-dev/braux\n\nconst visual = {\n themes: {\n dark: 'styles/themes/dark.css',\n "
},
{
"path": "source/modules/context.js",
"chars": 2136,
"preview": "// Github: https://github.com/DosX-dev/braux\n\nconst contextMenu = document.getElementById(\"context-menu\");\nconst scope ="
},
{
"path": "source/modules/fp-api.js",
"chars": 3469,
"preview": "// Github: https://github.com/DosX-dev/braux\n\nfunction fingerprint() {\n var fingerprintData = {\n 'User Agent':"
},
{
"path": "source/modules/io-fs.js",
"chars": 2022,
"preview": "// Github: https://github.com/DosX-dev/braux\n\nclass FileSystem {\n constructor() {\n this.storage = window.local"
},
{
"path": "source/modules/manifest.js",
"chars": 213,
"preview": "// Github: https://github.com/DosX-dev/braux\n\nconst config = {\n version: '3.20.25'\n },\n version = {\n "
},
{
"path": "source/styles/global.css",
"chars": 1507,
"preview": "html,\nbody {\n transition: background-color 0.8s, color 0.8s;\n cursor: default;\n font-family: monospace;\n mar"
},
{
"path": "source/styles/themes/cherry.css",
"chars": 801,
"preview": "body {\n background-color: rgb(41, 0, 35);\n color: white;\n}\n\nhr {\n background-color: rgb(108, 0, 158);\n}\n\n::-web"
},
{
"path": "source/styles/themes/dark.css",
"chars": 766,
"preview": "body {\n background-color: black;\n color: white;\n}\n\nhr {\n background-color: rgb(66, 66, 66);\n}\n\n::-webkit-scroll"
},
{
"path": "source/styles/themes/hacker.css",
"chars": 780,
"preview": "body {\n background-color: rgb(0, 18, 19);\n color: white;\n}\n\nhr {\n background-color: rgb(0, 138, 0);\n}\n\n::-webki"
},
{
"path": "source/styles/themes/light.css",
"chars": 748,
"preview": "body {\n background-color: white;\n color: black;\n}\n\nhr {\n background-color: rgb(151, 151, 151);\n}\n\n::-webkit-scr"
}
]
About this extraction
This page contains the full source code of the DosX-dev/braux GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 14 files (29.7 KB), approximately 7.5k tokens, and a symbol index with 39 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.