IIOAOAOOODDJDBHCDCHCJDZHCSFDUYEH

This commit is contained in:
quartinal 2025-01-19 06:59:52 -08:00
parent 521f7f9abb
commit 5f96c40cee
18 changed files with 881 additions and 697 deletions

View File

@ -1,30 +1,31 @@
const { readFileSync, writeFileSync } = require('node:fs');
const fg = require('fast-glob');
let brotliWasm;
(() => {
brotliWasm = require('brotli-wasm');
})();
const { compress } = brotliWasm;
((
/** @type {string} */
globPattern
) => {
console.warn('Warning: If you provide more than two files as arguments');
console.warn('it will only compress the first file due to performance');
console.warn('reasons. You can change this behavior by modifying the');
console.warn('function calling at the end of the script.');
for (const file of fg.globSync(globPattern)) {
const compressedFile = compress(readFileSync(file), {
quality: 11,
});
console.log(`Compressed ${file} from ${readFileSync(file).length} to ${compressedFile.length} bytes`);
writeFileSync(file, compressedFile);
}
const { readFileSync, writeFileSync } = require('node:fs');
const fg = require('fast-glob');
const prettyBytes = require('./prettyBytes.cjs');
let brotliWasm;
(() => {
brotliWasm = require('brotli-wasm');
})();
const { compress } = brotliWasm;
((
/** @type {string} */
globPattern
) => {
console.warn('Warning: If you provide more than two glob patterns as arguments');
console.warn('it will only compress the first glob pattern due to performance');
console.warn('reasons. You can change this behavior by modifying the');
console.warn('function calling at the end of the script.');
for (const file of fg.globSync(globPattern)) {
const compressedFile = compress(readFileSync(file), {
quality: 11,
});
console.log(`Compressed ${file} from ${prettyBytes(readFileSync(file).length)} to ${prettyBytes(compressedFile.length)}`);
writeFileSync(file, compressedFile);
}
})(process.argv[2]);

View File

@ -1,12 +1,12 @@
(function(){'use strict';function g(a){console.log("LoaderBootstrap: [INFO] "+a)}function n(a){console.error("LoaderBootstrap: [ERROR] "+a)}var q=null;
function r(){const a=[];for(var c=0;64>c;++c)a["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(c)]=c;a[45]=62;a[95]=63;return function(b,d){var e=b.length-d;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var f=b.indexOf("=",d);f=-1===f?e:f-d;e=[f,f===e?0:4-f%4];var l=e[0];e=e[1];f=new Uint8Array(3*(l+e)/4-e);var h=0;l=(0<e?l-4:l)+d;var k;for(k=d;k<l;k+=4)d=a[b.charCodeAt(k)]<<18|a[b.charCodeAt(k+1)]<<12|a[b.charCodeAt(k+2)]<<6|a[b.charCodeAt(k+
3)],f[h++]=d>>16&255,f[h++]=d>>8&255,f[h++]=d&255;2===e?(d=a[b.charCodeAt(k)]<<2|a[b.charCodeAt(k+1)]>>4,f[h++]=d&255):1===e&&(d=a[b.charCodeAt(k)]<<10|a[b.charCodeAt(k+1)]<<4|a[b.charCodeAt(k+2)]>>2,f[h++]=d>>8&255,f[h++]=d&255);return f.buffer}}function u(){return new Promise(function(a){setTimeout(a,20)})}function v(a){return new Promise(function(c){fetch(a,{cache:"force-cache"}).then(function(b){return b.arrayBuffer()}).then(c).catch(function(b){n("Failed to fetch URL! "+b);c(null)})})}
function w(a){return a.startsWith("data:application/octet-stream;base64,")?new Promise(function(c){v(a).then(function(b){if(b)c(b);else{console.log("LoaderBootstrap: [WARN] Failed to decode base64 via fetch, doing it the slow way instead...");try{q||=r();var d=q(a,37);c(d)}catch(e){n("Failed to decode base64! "+e),c(null)}}})}):v(a)}
function x(a,c){const b=document.createElement("h2");b.style.color="#AA0000";b.style.padding="25px";b.style.fontFamily="sans-serif";b.style.marginBlock="0px";b.appendChild(document.createTextNode(c));a.appendChild(b);c=document.createElement("h4");c.style.color="#AA0000";c.style.padding="25px";c.style.fontFamily="sans-serif";c.style.marginBlock="0px";c.appendChild(document.createTextNode("Try again later"));a.style.backgroundColor="white";a.appendChild(c)}
window.main=async function(){if("undefined"===typeof window.eaglercraftXOpts)n("window.eaglercraftXOpts is not defined!"),alert("window.eaglercraftXOpts is not defined!");else{var a=window.eaglercraftXOpts.container;if("string"!==typeof a)n("window.eaglercraftXOpts.container is not a string!"),alert("window.eaglercraftXOpts.container is not a string!");else{var c=window.eaglercraftXOpts.assetsURI;if("string"!==typeof c)if("object"===typeof c&&"object"===typeof c[0]&&"string"===typeof c[0].url)c=c[0].url;
else{n("window.eaglercraftXOpts.assetsURI is not a string!");alert("window.eaglercraftXOpts.assetsURI is not a string!");return}var b=document.getElementById(a);if(b){for(;a=b.lastChild;)b.removeChild(a);a=document.createElement("div");a.style.width="100%";a.style.height="100%";a.style.setProperty("image-rendering","pixelated");a.style.background='center / contain no-repeat url("data:image/png;base64,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") white';
b.appendChild(a);c.startsWith("data:")?(g('Downloading EPW file "<data: '+c.length+' chars>"...'),c=await w(c)):(g('Downloading EPW file "'+c+'"...'),c=await v(c));var d=!1;c?384>c.byteLength&&(n("The EPW file is too short"),d=!0):d=!0;if(d)b.removeChild(a),x(b,"Failed to download EPW file!"),n("Failed to download EPW file!");else{var e=new DataView(c);if(608649541!==e.getUint32(0,!0)||1297301847!==e.getUint32(4,!0))n("The file is not an EPW file"),d=!0;var f=c.byteLength;e.getUint32(8,!0)!==f&&(n("The EPW file is the wrong length"),
d=!0);if(d)b.removeChild(a),x(b,"EPW file is invalid!"),n("EPW file is invalid!");else{var l=new TextDecoder("utf-8"),h=e.getUint32(100,!0),k=e.getUint32(104,!0),m=e.getUint32(108,!0),p=e.getUint32(112,!0);if(0>h||h+k>f||0>m||m+p>f)n("The EPW file contains an invalid offset (component: splash)"),d=!0;if(d)b.removeChild(a),x(b,"EPW file is invalid!"),n("EPW file is invalid!");else{h=new Uint8Array(c,h,k);m=new Uint8Array(c,m,p);l=URL.createObjectURL(new Blob([h],{type:l.decode(m)}));g("Loaded splash img: "+
l);a.style.background='center / contain no-repeat url("'+l+'"), 0px 0px / 1000000% 1000000% no-repeat url("'+l+'") white';await u();p=e.getUint32(164,!0);h=e.getUint32(168,!0);m=e.getUint32(180,!0);e=e.getUint32(184,!0);if(0>p||p+h>f||0>m||m+e>f)n("The EPW file contains an invalid offset (component: loader)"),d=!0;if(d)b.removeChild(a),x(b,"EPW file is invalid!"),n("EPW file is invalid!");else{a=new Uint8Array(c,p,h);a=URL.createObjectURL(new Blob([a],{type:"text/javascript;charset=utf-8"}));g("Loaded loader.js: "+
l);d=new Uint8Array(c,m,e);d=URL.createObjectURL(new Blob([d],{type:"application/wasm"}));g("Loaded loader.wasm: "+d);f={};for(const [t,y]of Object.entries(window.eaglercraftXOpts))"container"!==t&&"assetsURI"!==t&&(f[t]=y);window.__eaglercraftXLoaderContextPre={rootElement:b,eaglercraftXOpts:f,theEPWFileBuffer:c,loaderWASMURL:d,splashURL:l};g("Appending loader.js to document...");b=document.createElement("script");b.type="text/javascript";b.src=a;document.head.appendChild(b)}}}}}else b='window.eaglercraftXOpts.container "'+
a+'" is not a known element id!',n(b),alert(b)}}};}).call(this);
(function(){'use strict';function g(a){console.log("LoaderBootstrap: [INFO] "+a)}function n(a){console.error("LoaderBootstrap: [ERROR] "+a)}var q=null;
function r(){const a=[];for(var c=0;64>c;++c)a["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(c)]=c;a[45]=62;a[95]=63;return function(b,d){var e=b.length-d;if(0<e%4)throw Error("Invalid string. Length must be a multiple of 4");var f=b.indexOf("=",d);f=-1===f?e:f-d;e=[f,f===e?0:4-f%4];var l=e[0];e=e[1];f=new Uint8Array(3*(l+e)/4-e);var h=0;l=(0<e?l-4:l)+d;var k;for(k=d;k<l;k+=4)d=a[b.charCodeAt(k)]<<18|a[b.charCodeAt(k+1)]<<12|a[b.charCodeAt(k+2)]<<6|a[b.charCodeAt(k+
3)],f[h++]=d>>16&255,f[h++]=d>>8&255,f[h++]=d&255;2===e?(d=a[b.charCodeAt(k)]<<2|a[b.charCodeAt(k+1)]>>4,f[h++]=d&255):1===e&&(d=a[b.charCodeAt(k)]<<10|a[b.charCodeAt(k+1)]<<4|a[b.charCodeAt(k+2)]>>2,f[h++]=d>>8&255,f[h++]=d&255);return f.buffer}}function u(){return new Promise(function(a){setTimeout(a,20)})}function v(a){return new Promise(function(c){fetch(a,{cache:"force-cache"}).then(function(b){return b.arrayBuffer()}).then(c).catch(function(b){n("Failed to fetch URL! "+b);c(null)})})}
function w(a){return a.startsWith("data:application/octet-stream;base64,")?new Promise(function(c){v(a).then(function(b){if(b)c(b);else{console.log("LoaderBootstrap: [WARN] Failed to decode base64 via fetch, doing it the slow way instead...");try{q||=r();var d=q(a,37);c(d)}catch(e){n("Failed to decode base64! "+e),c(null)}}})}):v(a)}
function x(a,c){const b=document.createElement("h2");b.style.color="#AA0000";b.style.padding="25px";b.style.fontFamily="sans-serif";b.style.marginBlock="0px";b.appendChild(document.createTextNode(c));a.appendChild(b);c=document.createElement("h4");c.style.color="#AA0000";c.style.padding="25px";c.style.fontFamily="sans-serif";c.style.marginBlock="0px";c.appendChild(document.createTextNode("Try again later"));a.style.backgroundColor="white";a.appendChild(c)}
window.main=async function(){if("undefined"===typeof window.eaglercraftXOpts)n("window.eaglercraftXOpts is not defined!"),alert("window.eaglercraftXOpts is not defined!");else{var a=window.eaglercraftXOpts.container;if("string"!==typeof a)n("window.eaglercraftXOpts.container is not a string!"),alert("window.eaglercraftXOpts.container is not a string!");else{var c=window.eaglercraftXOpts.assetsURI;if("string"!==typeof c)if("object"===typeof c&&"object"===typeof c[0]&&"string"===typeof c[0].url)c=c[0].url;
else{n("window.eaglercraftXOpts.assetsURI is not a string!");alert("window.eaglercraftXOpts.assetsURI is not a string!");return}var b=document.getElementById(a);if(b){for(;a=b.lastChild;)b.removeChild(a);a=document.createElement("div");a.style.width="100%";a.style.height="100%";a.style.setProperty("image-rendering","pixelated");a.style.background='center / contain no-repeat url("data:image/png;base64,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") white';
b.appendChild(a);c.startsWith("data:")?(g('Downloading EPW file "<data: '+c.length+' chars>"...'),c=await w(c)):(g('Downloading EPW file "'+c+'"...'),c=await v(c));var d=!1;c?384>c.byteLength&&(n("The EPW file is too short"),d=!0):d=!0;if(d)b.removeChild(a),x(b,"Failed to download EPW file!"),n("Failed to download EPW file!");else{var e=new DataView(c);if(608649541!==e.getUint32(0,!0)||1297301847!==e.getUint32(4,!0))n("The file is not an EPW file"),d=!0;var f=c.byteLength;e.getUint32(8,!0)!==f&&(n("The EPW file is the wrong length"),
d=!0);if(d)b.removeChild(a),x(b,"EPW file is invalid!"),n("EPW file is invalid!");else{var l=new TextDecoder("utf-8"),h=e.getUint32(100,!0),k=e.getUint32(104,!0),m=e.getUint32(108,!0),p=e.getUint32(112,!0);if(0>h||h+k>f||0>m||m+p>f)n("The EPW file contains an invalid offset (component: splash)"),d=!0;if(d)b.removeChild(a),x(b,"EPW file is invalid!"),n("EPW file is invalid!");else{h=new Uint8Array(c,h,k);m=new Uint8Array(c,m,p);l=URL.createObjectURL(new Blob([h],{type:l.decode(m)}));g("Loaded splash img: "+
l);a.style.background='center / contain no-repeat url("'+l+'"), 0px 0px / 1000000% 1000000% no-repeat url("'+l+'") white';await u();p=e.getUint32(164,!0);h=e.getUint32(168,!0);m=e.getUint32(180,!0);e=e.getUint32(184,!0);if(0>p||p+h>f||0>m||m+e>f)n("The EPW file contains an invalid offset (component: loader)"),d=!0;if(d)b.removeChild(a),x(b,"EPW file is invalid!"),n("EPW file is invalid!");else{a=new Uint8Array(c,p,h);a=URL.createObjectURL(new Blob([a],{type:"text/javascript;charset=utf-8"}));g("Loaded loader.js: "+
l);d=new Uint8Array(c,m,e);d=URL.createObjectURL(new Blob([d],{type:"application/wasm"}));g("Loaded loader.wasm: "+d);f={};for(const [t,y]of Object.entries(window.eaglercraftXOpts))"container"!==t&&"assetsURI"!==t&&(f[t]=y);window.__eaglercraftXLoaderContextPre={rootElement:b,eaglercraftXOpts:f,theEPWFileBuffer:c,loaderWASMURL:d,splashURL:l};g("Appending loader.js to document...");b=document.createElement("script");b.type="text/javascript";b.src=a;document.head.appendChild(b)}}}}}else b='window.eaglercraftXOpts.container "'+
a+'" is not a known element id!',n(b),alert(b)}}};}).call(this);

View File

@ -1,62 +1,62 @@
<!DOCTYPE html>
<html style="width:100%;height:100%;background-color:black;">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="description" content="Play minecraft 1.8 in your browser" />
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
<title>EaglercraftX 1.8 WASM-GC</title>
<meta property="og:locale" content="en-US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="EaglercraftX 1.8 WASM-GC" />
<meta property="og:description" content="Play minecraft 1.8 in your browser" />
<meta property="og:image" content="favicon.png" />
<link type="image/png" rel="shortcut icon" href="favicon.png" />
<script src="/js/ga4.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
<!-- JSPI TRIALS-->
<!-- MICROSOFT --> <meta http-equiv="origin-trial" content="AxCaB9CUa1NjEYsfi2KHTwRihrriOki+jrtyvPpyAqwVFdaev2mnVGEKACPd6SORzZktTjpeKgN4oMYun9cStXoAAAB7eyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0Lndpbjo0NDMiLCJmZWF0dXJlIjoiV2ViQXNzZW1ibHlKU1Byb21pc2VJbnRlZ3JhdGlvbiIsImV4cGlyeSI6MTczNzg1OTk4NiwiaXNTdWJkb21haW4iOnRydWV9">
<!-- GOOGLE --> <meta http-equiv="origin-trial" content="Ag8eVN4Le/HOr01lUzCQrXfPl1SNRatDeFbeAEWlDFHK7/zNLf/TOWITAK56cZuSsMHoANnPK9H1JrmTRzmY4ggAAAB7eyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0Lndpbjo0NDMiLCJmZWF0dXJlIjoiV2ViQXNzZW1ibHlKU1Byb21pc2VJbnRlZ3JhdGlvbiIsImV4cGlyeSI6MTc0NDY3NTIwMCwiaXNTdWJkb21haW4iOnRydWV9">
<!-- JSPI TRIALS-->
<script type="text/javascript">
"use strict";
window.addEventListener("load", function() {
if(window.location.href.indexOf("file:") === 0) {
alert("HTTP please, do not open this file locally, run a local HTTP server and load it via HTTP");
}else {
// %%%%%%%%% launch options %%%%%%%%%%%%
var relayId = Math.floor(Math.random() * 3);
window.eaglercraftXOpts = {
demoMode: false,
container: "game_frame",
assetsURI: "assets.epw",
worldsDB: "worlds",
servers: [
/* example: { addr: "ws://localhost:8081/", name: "Local test server" } */
],
relays: [
{ addr: "wss://relay.deev.is/", comment: "lax1dude relay #1", primary: relayId == 0 },
{ addr: "wss://relay.lax1dude.net/", comment: "lax1dude relay #2", primary: relayId == 1 },
{ addr: "wss://relay.shhnowisnottheti.me/", comment: "ayunami relay #1", primary: relayId == 2 }
]
};
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var q = window.location.search;
if((typeof q === "string") && q[0] === "?" && (typeof window.URLSearchParams !== "undefined")) {
q = new window.URLSearchParams(q);
var s = q.get("server");
if(s) window.eaglercraftXOpts.joinServer = s;
}
main();
}
});
</script>
</head>
<body style="margin:0px;width:100%;height:100%;overflow:hidden;background-color:black;" id="game_frame"></body>
<!DOCTYPE html>
<html style="width:100%;height:100%;background-color:black;">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="description" content="Play minecraft 1.8 in your browser" />
<meta name="keywords" content="eaglercraft, eaglercraftx, minecraft, 1.8, 1.8.8" />
<title>EaglercraftX 1.8 WASM-GC</title>
<meta property="og:locale" content="en-US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="EaglercraftX 1.8 WASM-GC" />
<meta property="og:description" content="Play minecraft 1.8 in your browser" />
<meta property="og:image" content="favicon.png" />
<link type="image/png" rel="shortcut icon" href="favicon.png" />
<script src="/js/ga4.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
<!-- JSPI TRIALS-->
<!-- MICROSOFT --> <meta http-equiv="origin-trial" content="AxCaB9CUa1NjEYsfi2KHTwRihrriOki+jrtyvPpyAqwVFdaev2mnVGEKACPd6SORzZktTjpeKgN4oMYun9cStXoAAAB7eyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0Lndpbjo0NDMiLCJmZWF0dXJlIjoiV2ViQXNzZW1ibHlKU1Byb21pc2VJbnRlZ3JhdGlvbiIsImV4cGlyeSI6MTczNzg1OTk4NiwiaXNTdWJkb21haW4iOnRydWV9">
<!-- GOOGLE --> <meta http-equiv="origin-trial" content="Ag8eVN4Le/HOr01lUzCQrXfPl1SNRatDeFbeAEWlDFHK7/zNLf/TOWITAK56cZuSsMHoANnPK9H1JrmTRzmY4ggAAAB7eyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0Lndpbjo0NDMiLCJmZWF0dXJlIjoiV2ViQXNzZW1ibHlKU1Byb21pc2VJbnRlZ3JhdGlvbiIsImV4cGlyeSI6MTc0NDY3NTIwMCwiaXNTdWJkb21haW4iOnRydWV9">
<!-- JSPI TRIALS-->
<script type="text/javascript">
"use strict";
window.addEventListener("load", function() {
if(window.location.href.indexOf("file:") === 0) {
alert("HTTP please, do not open this file locally, run a local HTTP server and load it via HTTP");
}else {
// %%%%%%%%% launch options %%%%%%%%%%%%
var relayId = Math.floor(Math.random() * 3);
window.eaglercraftXOpts = {
demoMode: false,
container: "game_frame",
assetsURI: "assets.epw",
worldsDB: "worlds",
servers: [
/* example: { addr: "ws://localhost:8081/", name: "Local test server" } */
],
relays: [
{ addr: "wss://relay.deev.is/", comment: "lax1dude relay #1", primary: relayId == 0 },
{ addr: "wss://relay.lax1dude.net/", comment: "lax1dude relay #2", primary: relayId == 1 },
{ addr: "wss://relay.shhnowisnottheti.me/", comment: "ayunami relay #1", primary: relayId == 2 }
]
};
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var q = window.location.search;
if((typeof q === "string") && q[0] === "?" && (typeof window.URLSearchParams !== "undefined")) {
q = new window.URLSearchParams(q);
var s = q.get("server");
if(s) window.eaglercraftXOpts.joinServer = s;
}
main();
}
});
</script>
</head>
<body style="margin:0px;width:100%;height:100%;overflow:hidden;background-color:black;" id="game_frame"></body>
</html>

View File

@ -1,173 +1,181 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>EaglerCraftX</title>
<meta name="description" content="Eaglercraft Web Clients Site">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="Eaglercraft, EaglercraftX, Eaglercraft X, EaglercraftX 1.8, Eaglercraft X 1.8, EaglercraftX 1-8, Eaglercraft X 1-8, Eagler, Minecraft, MC, MC Web, MC Online, Minecraft Online, Minecraft Web, Eaglercraft 1.9, Eaglercraft 1-9, Eaglercraft 1.9, Eaglercraft 1-9, Eaglercraft 1.5.2, Eaglercraft 1-5-2, Eaglercraft Clients, Games, Games, 1.8, 1.8.8, 1-8, 1-8-8, 1.9, 1-9, 1.5, 1.5.2, 1-5, 1-5-2">
<link rel="icon" type="image/x-icon" href="images/eaglercommunity.png">
<link rel="stylesheet" href="css/styles.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2593894696548093" crossorigin="anonymous"></script>
<script type="module" src="js/darkmode.js"></script>
<script type="module" src="js/ga4.js"></script>
<script type="module" src="js/main.js"></script>
<script type="module" src="js/popup.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bowser"></script>
<meta property="og:title" content="Eaglercraft Client Collections" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.eaglercraft.win" />
<meta property="og:image" content="https://www.eaglercraft.win/images/eaglercommunity.png" />
<meta property="og:description"
content="Eaglercraft Client Collection Site. We have many clients to choose from!" />
<meta property="og:site_name" content="Eaglercraft Client Collection Site" />
</head>
<body>
<header>
<h1>Welcome to EaglerCraftX</h1>
</header>
<main>
<section class="darkmode">
<div calss="darkmodediv">
<label for="darkModeCheckbox">Dark Mode</label>
<input type="checkbox" id="darkModeCheckbox">
</div>
</section>
<section class="counter">
<p>Site views counter:</p>
<div align="center">
<img src="https://www.free-website-hit-counter.com/c.php?d=9&amp;id=177632&amp;s=16" border="0" alt="View Counter">
</div>
</section>
<section class="info">
<p>These clients might be outdated.</p>
<p>Please give our <a href="https://git.eaglercraft.win/EaglercraftX-Client-Collections/EaglercraftX-Site" target="_blank">Gitea repository</a> a star if you like this site.</p>
<p>Server List and Mod List also at the bottom if you need it.</p>
<p>Have any questions, bug reports, or suggestions? Join our Discord server by pressing the button below!</p>
<a href="https://discord.gg/czV7M8JXXM" class="dsc-btn" target="_blank">Discord Server</a>
<p>Scroll down to the bottom for buttons/links.</p>
<p>WASM usually has better performance but may not work on some browsers</p>
</section>
<div class="clientbutton">
<section class="clients">
<h2 class="pick-client">Pick a Client:</h2>
<label for="showModded">Show Modded Clients</label>
<input type="checkbox" id="showModded">
<div class="search-container">
<input type="text" id="search-bar" placeholder="Search Clients...">
</div>
<!-- Version 1.8 Section -->
<div id="desktopVersion18">
<p class="version-text">Version 1.8</p>
<div class="Container18">
<a class="version-link filter-button" href="./eagler-files/1.8/Main/index.html">
<button>Main 1.8 Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/wasm/1.8/Main/index.html">
<button>Main 1.8 Client [WASM]</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.8/resent4.0/index.html">
<button>Resent Client 4.0</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.8/Shadow_Client_en_US.html">
<button>Shadow Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.8/AstraClient/index.html">
<button>Astra Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/wasm/1.8/AstraClient/index.html">
<button>Astra Client [WASM]</button>
</a>
</div>
</div>
<div id="moddedButtons">
<p class="version-text">Version 1.8 Modded Clients</p>
<div class="Container18">
<a class="version-link filter-button" href="./eagler-files/1.8/EaglerForge/index.html">
<button>EaglerForge</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/1.8/Starlike/index.html">
<button>Starlike Client</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/1.8/prism-client.html">
<button>Prism Client</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/1.8/EaglyMC/index.html">
<button>EaglyMC Client</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/wasm/1.8/EaglyMC/index.html">
<button>EaglyMC Client [WASM]</button>
</a>
</div>
</div>
<!-- Version 1.5.2 Section -->
<div id="desktopVersion152">
<p class="version-text">Version 1.5.2</p>
<div class="Container15">
<a class="version-link filter-button" href="./eagler-files/1.5.2/main/index.html">
<button>Main 1.5.2 Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.5.2/PrecisionBeta.html">
<button>Precision Beta Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.5.2/precisionbeta2/index.html">
<button>Precision Beta 2 Client</button>
</a>
</div>
</div>
<!-- Other Section -->
<div id="desktopVersionOther">
<p class="version-text">Other Versions</p>
<div class="ContainerOther">
<a class="version-link filter-button" href="./eagler-files/1.7.3/Beta_1.7.3_Offline_Download.html">
<button>1.7.3 Beta Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/infdev/Infdev-20100630-1.html">
<button>Infdev Client</button>
</a>
</div>
</div>
</section>
</div>
<section class="danger-zone">
<h3>DANGER ZONE</h3>
<a onclick="openClrModal();" class="clr-btn">Reset All Local Data</a>
<a onclick="eruda.init();">
<button>Devtools</button>
</a>
<div id="clr-data-model" class="modal">
<div class="modal-content">
<h2>DANGER ZONE</h2>
<p>Are you sure you want to clear all your local storage data?</p>
<button>Yes</button>
<button class="cancel-btn">Cancel</button>
</div>
</div>
</section>
</main>
<footer class="footer">
<p>We are not affiliated with EaglerCraft, Eagtek, Microsoft, or Mojang. We solely host these clients for you to play on.</p>
<p>By using this site you agree to Google Analytics being used on this site.</p>
<a href="https://git.eaglercraft.win/EaglercraftX-Client-Collections/EaglercraftX-Site" class="source-btn" target="_blank">Gitea Repository</a>
<a href="https://discord.gg/czV7M8JXXM" class="dsc-btn" target="_blank">Discord Server</a>
<a href="https://servers.eaglercraft.com/" target="_blank">
<button class="server-list">Server List</button>
</a>
<a href="https://eaglerrinth.github.io/" target="_blank">
<button class="eaglerrinth-mod-list">EaglerRinth Mod List</button>
</a>
</footer>
<div id="copyModal" class="modal">
<div class="modal-content">
<h2>Copy Discord Link</h2>
<p class="copy-link" id="discordLink">https://discord.gg/czV7M8JXXM</p>
<button class="copy-btn">Copy Link</button>
<button class="cancel-btn">Close</button>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<script type="importmap">
{
"imports": {
"jscrewit": "https://cdn.jsdelivr.net/npm/jscrewit/+esm"
}
}
</script>
<script type="module" src="js/obfuscateScripts.js"></script>
<meta charset="UTF-8">
<title>EaglerCraftX</title>
<meta name="description" content="Eaglercraft Web Clients Site">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="Eaglercraft, EaglercraftX, Eaglercraft X, EaglercraftX 1.8, Eaglercraft X 1.8, EaglercraftX 1-8, Eaglercraft X 1-8, Eagler, Minecraft, MC, MC Web, MC Online, Minecraft Online, Minecraft Web, Eaglercraft 1.9, Eaglercraft 1-9, Eaglercraft 1.9, Eaglercraft 1-9, Eaglercraft 1.5.2, Eaglercraft 1-5-2, Eaglercraft Clients, Games, Games, 1.8, 1.8.8, 1-8, 1-8-8, 1.9, 1-9, 1.5, 1.5.2, 1-5, 1-5-2">
<link rel="icon" type="image/x-icon" href="images/eaglercommunity.png">
<link rel="stylesheet" href="css/styles.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2593894696548093" crossorigin="anonymous"></script>
<script type="module" src="js/darkmode.js"></script>
<script type="module" src="js/ga4.js"></script>
<script type="module" src="js/main.js"></script>
<script type="module" src="js/popupPrompt.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bowser"></script>
<meta property="og:title" content="Eaglercraft Client Collections" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.eaglercraft.win" />
<meta property="og:image" content="https://www.eaglercraft.win/images/eaglercommunity.png" />
<meta property="og:description"
content="Eaglercraft Client Collection Site. We have many clients to choose from!" />
<meta property="og:site_name" content="Eaglercraft Client Collection Site" />
</head>
<body>
<header>
<h1>Welcome to EaglerCraftX</h1>
</header>
<main>
<section class="darkmode">
<div calss="darkmodediv">
<label for="darkModeCheckbox">Dark Mode</label>
<input type="checkbox" id="darkModeCheckbox">
</div>
</section>
<section class="counter">
<p>Site views counter:</p>
<div align="center">
<img src="https://www.free-website-hit-counter.com/c.php?d=9&amp;id=177632&amp;s=16" border="0" alt="View Counter">
</div>
</section>
<section class="info">
<p>These clients might be outdated.</p>
<p>Please give our <a href="https://git.eaglercraft.win/EaglercraftX-Client-Collections/EaglercraftX-Site" target="_blank">Gitea repository</a> a star if you like this site.</p>
<p>Server List and Mod List also at the bottom if you need it.</p>
<p>Have any questions, bug reports, or suggestions? Join our Discord server by pressing the button below!</p>
<a href="https://discord.gg/czV7M8JXXM" class="dsc-btn" target="_blank">Discord Server</a>
<p>Scroll down to the bottom for buttons/links.</p>
<p>WASM usually has better performance but may not work on some browsers</p>
</section>
<div class="clientbutton">
<section class="clients">
<h2 class="pick-client">Pick a Client:</h2>
<label for="showModded">Show Modded Clients</label>
<input type="checkbox" id="showModded">
<div class="search-container">
<input type="text" id="search-bar" placeholder="Search Clients...">
</div>
<!-- Version 1.8 Section -->
<div id="desktopVersion18">
<p class="version-text">Version 1.8</p>
<div class="Container18">
<a class="version-link filter-button" href="./eagler-files/1.8/Main/index.html">
<button>Main 1.8 Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/wasm/1.8/Main/index.html">
<button>Main 1.8 Client [WASM]</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.8/resent4.0/index.html">
<button>Resent Client 4.0</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.8/Shadow_Client_en_US.html">
<button>Shadow Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.8/AstraClient/index.html">
<button>Astra Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/wasm/1.8/AstraClient/index.html">
<button>Astra Client [WASM]</button>
</a>
</div>
</div>
<div id="moddedButtons">
<p class="version-text">Version 1.8 Modded Clients</p>
<div class="Container18">
<a class="version-link filter-button" href="./eagler-files/1.8/EaglerForge/index.html">
<button>EaglerForge</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/1.8/Starlike/index.html">
<button>Starlike Client</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/1.8/prism-client.html">
<button>Prism Client</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/1.8/EaglyMC/index.html">
<button>EaglyMC Client</button>
</a>
<a class="modded-buttons filter-button" href="./eagler-files/modded/wasm/1.8/EaglyMC/index.html">
<button>EaglyMC Client [WASM]</button>
</a>
</div>
</div>
<!-- Version 1.5.2 Section -->
<div id="desktopVersion152">
<p class="version-text">Version 1.5.2</p>
<div class="Container15">
<a class="version-link filter-button" href="./eagler-files/1.5.2/main/index.html">
<button>Main 1.5.2 Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.5.2/PrecisionBeta.html">
<button>Precision Beta Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/1.5.2/precisionbeta2/index.html">
<button>Precision Beta 2 Client</button>
</a>
</div>
</div>
<!-- Other Section -->
<div id="desktopVersionOther">
<p class="version-text">Other Versions</p>
<div class="ContainerOther">
<a class="version-link filter-button" href="./eagler-files/1.7.3/Beta_1.7.3_Offline_Download.html">
<button>1.7.3 Beta Client</button>
</a>
<a class="version-link filter-button" href="./eagler-files/infdev/Infdev-20100630-1.html">
<button>Infdev Client</button>
</a>
</div>
</div>
</section>
</div>
<section class="danger-zone">
<h3>DANGER ZONE</h3>
<a onclick="openClrModal();" class="clr-btn">Reset All Local Data</a>
<a onclick="eruda.init();">
<button>Devtools</button>
</a>
<div id="clr-data-model" class="modal">
<div class="modal-content">
<h2>DANGER ZONE</h2>
<p>Are you sure you want to clear all your local storage data?</p>
<button>Yes</button>
<button class="cancel-btn">Cancel</button>
</div>
</div>
</section>
</main>
<footer class="footer">
<p>We are not affiliated with EaglerCraft, Eagtek, Microsoft, or Mojang. We solely host these clients for you to play on.</p>
<p>By using this site you agree to Google Analytics being used on this site.</p>
<a href="https://git.eaglercraft.win/EaglercraftX-Client-Collections/EaglercraftX-Site" class="source-btn" target="_blank">Gitea Repository</a>
<a href="https://discord.gg/czV7M8JXXM" class="dsc-btn" target="_blank">Discord Server</a>
<a href="https://servers.eaglercraft.com/" target="_blank">
<button class="server-list">Server List</button>
</a>
<a href="https://eaglerrinth.github.io/" target="_blank">
<button class="eaglerrinth-mod-list">EaglerRinth Mod List</button>
</a>
</footer>
<div id="copyModal" class="modal">
<div class="modal-content">
<h2>Copy Discord Link</h2>
<p class="copy-link" id="discordLink">https://discord.gg/czV7M8JXXM</p>
<button class="copy-btn">Copy Link</button>
<button class="cancel-btn">Close</button>
</div>
</div>
</body>
</html>

View File

@ -1,66 +1,66 @@
import {
hexToRGB,
pushStyles,
selectClass,
selectId,
selectTag,
} from "./helperFunctions.js";
global.querySelectorAll = document.querySelectorAll;
$(function() {
function applyStyles(elements, styles) {
elements.forEach(element => pushStyles(element, styles));
}
function updateDarkMode(isChecked = true) {
const body = document.body.id ? selectId(document.body.id) : selectTag('body');
const commonStyles = isChecked ? {
backgroundColor: hexToRGB('#141414'),
color: hexToRGB('#f1f1f1')
} : {
backgroundColor: '#f1f1f1',
color: 'black',
backgroundImage: "url('/images/grass-background.jpg')"
};
pushStyles(body, commonStyles);
applyStyles(document.querySelectorAll('p'), { color: commonStyles.color });
applyStyles([selectTag('h2'), selectTag('h1')], { color: commonStyles.color });
if (isChecked) {
pushStyles(selectTag('h1'), {
textShadow: '-0px 0 white, 0 0px white, 0px 0 white, 0 -0px white'
});
pushStyles(selectClass('footer'), { backgroundColor: hexToRGB('#6C8592') });
pushStyles(selectClass('source-btn'), { backgroundColor: hexToRGB('#ff6847') });
applyStyles(document.querySelectorAll('button'), { backgroundColor: hexToRGB('#30d3d2') });
applyStyles(document.querySelectorAll('.version-text'), { color: hexToRGB('#f1f1f1') });
pushStyles(document.querySelector('.danger-zone'), { color: '#ff6847' });
pushStyles(document.querySelector('.modal'), { color: '#ff3c00' });
localStorage.setItem('darkModeOn', true);
} else {
pushStyles(selectTag('h1'), {
textShadow: '-0px 0 white, 0 0px white, 0px 0 white, 0 -0px white'
});
pushStyles(selectClass('footer'), { backgroundColor: '#000000', color: '#ffffff' });
pushStyles(selectClass('source-btn'), { backgroundColor: '#0095ff' });
applyStyles(document.querySelectorAll('button'), { backgroundColor: '#4caf50' });
applyStyles(document.querySelectorAll('.version-text'), { color: 'black' });
pushStyles(document.querySelector('.danger-zone'), { color: '#010101' });
pushStyles(document.querySelector('.modal'), { color: '#010101' });
localStorage.removeItem("darkModeOn");
}
}
const darkModeCheckbox = document.getElementById('darkModeCheckbox');
if (localStorage.getItem('darkModeOn') === 'true') {
darkModeCheckbox.checked = true;
}
updateDarkMode(darkModeCheckbox.checked);
$("#darkModeCheckbox").on("change", function() {
updateDarkMode(darkModeCheckbox.checked);
});
});
import {
hexToRGB,
pushStyles,
selectClass,
selectId,
selectTag,
} from "./helperFunctions.js";
global.querySelectorAll = document.querySelectorAll;
$(function() {
function applyStyles(elements, styles) {
elements.forEach(element => pushStyles(element, styles));
}
function updateDarkMode(isChecked = true) {
const body = document.body.id ? selectId(document.body.id) : selectTag('body');
const commonStyles = isChecked ? {
backgroundColor: hexToRGB('#141414'),
color: hexToRGB('#f1f1f1')
} : {
backgroundColor: '#f1f1f1',
color: 'black',
backgroundImage: "url('/images/grass-background.jpg')"
};
pushStyles(body, commonStyles);
applyStyles(document.querySelectorAll('p'), { color: commonStyles.color });
applyStyles([selectTag('h2'), selectTag('h1')], { color: commonStyles.color });
if (isChecked) {
pushStyles(selectTag('h1'), {
textShadow: '-0px 0 white, 0 0px white, 0px 0 white, 0 -0px white'
});
pushStyles(selectClass('footer'), { backgroundColor: hexToRGB('#6C8592') });
pushStyles(selectClass('source-btn'), { backgroundColor: hexToRGB('#ff6847') });
applyStyles(document.querySelectorAll('button'), { backgroundColor: hexToRGB('#30d3d2') });
applyStyles(document.querySelectorAll('.version-text'), { color: hexToRGB('#f1f1f1') });
pushStyles(document.querySelector('.danger-zone'), { color: '#ff6847' });
pushStyles(document.querySelector('.modal'), { color: '#ff3c00' });
localStorage.setItem('darkModeOn', true);
} else {
pushStyles(selectTag('h1'), {
textShadow: '-0px 0 white, 0 0px white, 0px 0 white, 0 -0px white'
});
pushStyles(selectClass('footer'), { backgroundColor: '#000000', color: '#ffffff' });
pushStyles(selectClass('source-btn'), { backgroundColor: '#0095ff' });
applyStyles(document.querySelectorAll('button'), { backgroundColor: '#4caf50' });
applyStyles(document.querySelectorAll('.version-text'), { color: 'black' });
pushStyles(document.querySelector('.danger-zone'), { color: '#010101' });
pushStyles(document.querySelector('.modal'), { color: '#010101' });
localStorage.removeItem("darkModeOn");
}
}
const darkModeCheckbox = document.getElementById('darkModeCheckbox');
if (localStorage.getItem('darkModeOn') === 'true') {
darkModeCheckbox.checked = true;
}
updateDarkMode(darkModeCheckbox.checked);
$("#darkModeCheckbox").on("change", function() {
updateDarkMode(darkModeCheckbox.checked);
});
});

102
js/ga4.js
View File

@ -1,51 +1,51 @@
function addGoogleAnalyticsTags() {
const currentOrigin = window.location.origin;
const allowedOrigins = [
"https://eaglercraftx1-8.github.io",
"https://eaglercraftx1-8.netlify.app",
"https://eaglercraftx1-8.onrender.com",
"https://fastest.eaglercraft.win",
"https://notproxiedclient.eaglercraft.win",
"https://client.eaglercraft.win",
"https://client2.eaglercraft.win",
"https://client3.eaglercraft.win"
];
const trackingIds = {
"https://eaglercraftx1-8.github.io": "G-C44R8LD9MC",
"https://eaglercraftx1-8.netlify.app": "G-0R2ZXFSYVT",
"https://eaglercraftx1-8.onrender.com": "G-MND1TVBSXV",
"https://fastest.eaglercraft.win": "G-0FMCWKD9KG",
"https://notproxiedclient.eaglercraft.win": "G-QWHQVSNLB6",
"https://client.eaglercraft.win": "G-SGELV1H17J",
"https://client2.eaglercraft.win": "G-995EPK8DXR",
"https://client3.eaglercraft.win": "G-3M7CR3HRJV"
};
let trackingId = "G-81F615LDEZ"; // Default fallback tracking ID
if (allowedOrigins.includes(currentOrigin)) {
trackingId = trackingIds[currentOrigin];
}
console.log("Current Origin:", currentOrigin); // Log the origin to debug
console.log("Using Tracking ID:", trackingId); // Log the tracking ID to debug
if (trackingId) {
const analyticsScript = document.createElement('script');
analyticsScript.async = true;
analyticsScript.src = `https://www.googletagmanager.com/gtag/js?id=${trackingId}`;
document.head.appendChild(analyticsScript);
const scriptContent = document.createElement('script');
scriptContent.innerHTML = `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${trackingId}');
`;
document.head.appendChild(scriptContent);
}
}
addGoogleAnalyticsTags();
function addGoogleAnalyticsTags() {
const currentOrigin = window.location.origin;
const allowedOrigins = [
"https://eaglercraftx1-8.github.io",
"https://eaglercraftx1-8.netlify.app",
"https://eaglercraftx1-8.onrender.com",
"https://fastest.eaglercraft.win",
"https://notproxiedclient.eaglercraft.win",
"https://client.eaglercraft.win",
"https://client2.eaglercraft.win",
"https://client3.eaglercraft.win"
];
const trackingIds = {
"https://eaglercraftx1-8.github.io": "G-C44R8LD9MC",
"https://eaglercraftx1-8.netlify.app": "G-0R2ZXFSYVT",
"https://eaglercraftx1-8.onrender.com": "G-MND1TVBSXV",
"https://fastest.eaglercraft.win": "G-0FMCWKD9KG",
"https://notproxiedclient.eaglercraft.win": "G-QWHQVSNLB6",
"https://client.eaglercraft.win": "G-SGELV1H17J",
"https://client2.eaglercraft.win": "G-995EPK8DXR",
"https://client3.eaglercraft.win": "G-3M7CR3HRJV"
};
let trackingId = "G-81F615LDEZ"; // Default fallback tracking ID
if (allowedOrigins.includes(currentOrigin)) {
trackingId = trackingIds[currentOrigin];
}
console.log("Current Origin:", currentOrigin); // Log the origin to debug
console.log("Using Tracking ID:", trackingId); // Log the tracking ID to debug
if (trackingId) {
const analyticsScript = document.createElement('script');
analyticsScript.async = true;
analyticsScript.src = `https://www.googletagmanager.com/gtag/js?id=${trackingId}`;
document.head.appendChild(analyticsScript);
const scriptContent = document.createElement('script');
scriptContent.innerHTML = `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${trackingId}');
`;
document.head.appendChild(scriptContent);
}
}
addGoogleAnalyticsTags();

View File

@ -1,47 +1,47 @@
import isValidTag from "./isValidTag.js";
/**
* @param {HTMLElement} element
* @param {string[]} classlist
*/
export function addClasslist(element, ...classlist) {
element.classList.add(...classlist);
}
export function isArray(value) {
return value instanceof Array;
}
export function isObject(value) {
return value instanceof Object;
}
export function selectId(selector) {
return document.querySelector(selector.startsWith('#') ? selector : `#${selector}`);
}
export function selectClass(selector) {
return document.querySelector(selector.startsWith('.') ? selector : `.${selector}`);
}
export function selectTag(selector) {
return isValidTag(selector) ? document.querySelector(selector) : null;
}
export function pushStyles(element, styles) {
for (const [key, value] of Object.entries(styles)) {
element.style[key] = value;
}
}
export function elementHasIdOrClass(element) {
return isValidTag(selector) ? (element.id !== "" && element.className !== "") : false;
}
export function hexToRGB(hex) {
const hexValue = hex.replace('#', '');
const r = parseInt(hexValue.substring(0, 2), 16);
const g = parseInt(hexValue.substring(2, 4), 16);
const b = parseInt(hexValue.substring(4, 6), 16);
return `rgb(${r}, ${g}, ${b})`;
import isValidTag from "./isValidTag.js";
/**
* @param {HTMLElement} element
* @param {string[]} classlist
*/
export function addClasslist(element, ...classlist) {
element.classList.add(...classlist);
}
export function isArray(value) {
return value instanceof Array;
}
export function isObject(value) {
return value instanceof Object;
}
export function selectId(selector) {
return document.querySelector(selector.startsWith('#') ? selector : `#${selector}`);
}
export function selectClass(selector) {
return document.querySelector(selector.startsWith('.') ? selector : `.${selector}`);
}
export function selectTag(selector) {
return isValidTag(selector) ? document.querySelector(selector) : null;
}
export function pushStyles(element, styles) {
for (const [key, value] of Object.entries(styles)) {
element.style[key] = value;
}
}
export function elementHasIdOrClass(element) {
return isValidTag(selector) ? (element.id !== "" && element.className !== "") : false;
}
export function hexToRGB(hex) {
const hexValue = hex.replace('#', '');
const r = parseInt(hexValue.substring(0, 2), 16);
const g = parseInt(hexValue.substring(2, 4), 16);
const b = parseInt(hexValue.substring(4, 6), 16);
return `rgb(${r}, ${g}, ${b})`;
}

View File

@ -1,30 +1,30 @@
import htmlTags from '../json/html-tags.json' with { type: 'json' };
import htmlVoidTags from '../json/html-tags-void.json' with { type: 'json' };
const browser = bowser.getParser(window.navigator.userAgent).getBrowser();
export let unifiedTagCollection = [];
if (browser === "Chrome") {
unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
} else if (browser === "Firefox") {
const htmlTags = await fetchMultipleJsonUrls([
`${window.location.origin}/json/html-tags.json`,
`${window.location.origin}/json/html-tags-void.json`
]);
unifiedTagCollection = [...htmlTags];
} else {
unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
}
export default function isValidTag(tag) {
return unifiedTagCollection.includes(tag);
}
/** @returns {Promise<string[]>} */
async function fetchMultipleJsonUrls(urls) {
const responses = await Promise.all(urls.map(url => fetch(url)));
const jsonArrays = await Promise.all(responses.map(response => response.json()));
return jsonArrays.flat();
import htmlTags from '../json/html-tags.json' with { type: 'json' };
import htmlVoidTags from '../json/html-tags-void.json' with { type: 'json' };
const browser = bowser.getParser(window.navigator.userAgent).getBrowser();
export let unifiedTagCollection = [];
if (browser === "Chrome") {
unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
} else if (browser === "Firefox") {
const htmlTags = await fetchMultipleJsonUrls([
`${window.location.origin}/json/html-tags.json`,
`${window.location.origin}/json/html-tags-void.json`
]);
unifiedTagCollection = [...htmlTags];
} else {
unifiedTagCollection = [...htmlTags, ...htmlVoidTags];
}
export default function isValidTag(tag) {
return unifiedTagCollection.includes(tag);
}
/** @returns {Promise<string[]>} */
async function fetchMultipleJsonUrls(urls) {
const responses = await Promise.all(urls.map(url => fetch(url)));
const jsonArrays = await Promise.all(responses.map(response => response.json()));
return jsonArrays.flat();
}

View File

@ -1,56 +1,56 @@
import { selectId, pushStyles, selectTag, addClasslist } from './helperFunctions.js';
$(function() {
function toggleVisibility(selector, condition) {
$(selector).toggle(condition);
}
function updateDarkMode() {
const isChecked = $("#darkModeCheckbox").is(":checked");
const body = selectTag('body');
if (isChecked) {
addClasslist(body, 'dark-mode');
} else {
body.classList.remove('dark-mode');
}
}
function openClrModal() {
pushStyles(selectId('clr-data-model'), { display: 'flex' });
}
function closeClrModal() {
pushStyles(selectId('clr-data-model'), { display: 'none' });
}
function handleClrModalClick(event) {
const target = event.target;
if (target.classList.contains('cancel-btn')) {
closeClrModal();
} else if (target.tagName === 'BUTTON' && target.textContent === 'Yes') {
localStorage.clear();
location.reload();
}
}
function handleSearchBarKeyup() {
const query = $('#search-bar').val().toLowerCase();
$('.filter-button').each(function() {
toggleVisibility(this, $(this).text().toLowerCase().indexOf(query) > -1);
});
}
function updateShowModded() {
toggleVisibility("#moddedButtons", $("#showModded").is(":checked"));
}
$("#darkModeCheckbox").on("change", updateDarkMode);
updateDarkMode();
selectId('clr-data-model').addEventListener('click', handleClrModalClick);
$('#search-bar').on('keyup', handleSearchBarKeyup);
$("#showModded").on("change", updateShowModded);
updateShowModded();
});
import { selectId, pushStyles, selectTag, addClasslist } from './helperFunctions.js';
$(function() {
function toggleVisibility(selector, condition) {
$(selector).toggle(condition);
}
function updateDarkMode() {
const isChecked = $("#darkModeCheckbox").is(":checked");
const body = selectTag('body');
if (isChecked) {
addClasslist(body, 'dark-mode');
} else {
body.classList.remove('dark-mode');
}
}
function openClrModal() {
pushStyles(selectId('clr-data-model'), { display: 'flex' });
}
function closeClrModal() {
pushStyles(selectId('clr-data-model'), { display: 'none' });
}
function handleClrModalClick(event) {
const target = event.target;
if (target.classList.contains('cancel-btn')) {
closeClrModal();
} else if (target.tagName === 'BUTTON' && target.textContent === 'Yes') {
localStorage.clear();
location.reload();
}
}
function handleSearchBarKeyup() {
const query = $('#search-bar').val().toLowerCase();
$('.filter-button').each(function() {
toggleVisibility(this, $(this).text().toLowerCase().indexOf(query) > -1);
});
}
function updateShowModded() {
toggleVisibility("#moddedButtons", $("#showModded").is(":checked"));
}
$("#darkModeCheckbox").on("change", updateDarkMode);
updateDarkMode();
selectId('clr-data-model').addEventListener('click', handleClrModalClick);
$('#search-bar').on('keyup', handleSearchBarKeyup);
$("#showModded").on("change", updateShowModded);
updateShowModded();
});

22
js/obfuscateScripts.js Normal file
View File

@ -0,0 +1,22 @@
import jscrewit from 'jscrewit';
const { scripts } = window.document;
const { encode: obfuscate } = jscrewit;
(async function() {
for (const script of scripts) {
const { src } = script;
if (src) {
try {
const response = await fetch(src);
const textContent = await response.text();
const obfuscated = obfuscate(textContent);
const base64Obfuscated = btoa(obfuscated);
script.setAttribute('src', `data:text/javascript;base64,${base64Obfuscated}`);
console.log('Obfuscated script successfully.');
} catch (error) {
console.error('Failed to obfuscate script:', error);
}
}
}
})();

31
js/popupPrompt.js Normal file
View File

@ -0,0 +1,31 @@
window.onload = () => {
const dontShowDiscordPrompt = Boolean(localStorage.getItem('dontShowDiscordPrompt'));
if (dontShowDiscordPrompt) return;
const message = 'Do you want to join our popular Discord server (y/n/dsa/help)?';
const response = prompt(message);
if (!response) return;
switch (response.toLowerCase()) {
case 'y':
const discordLink = document.querySelector('a.dsc-btn');
if (discordLink) {
const opened = window.open(discordLink.href);
if (opened) opened.focus();
}
break;
case 'n':
alert('That\'s alright. Have a great day!');
break;
case 'dsa':
localStorage.setItem('dontShowDiscordPrompt', 'true');
break;
case 'help':
alert('y: Yes\nn: No\ndsa: Don\'t show again\nhelp: Show this message');
break;
default:
alert('Invalid response. Please try again.');
break;
}
};

View File

@ -1,17 +1,17 @@
[
"area",
"base",
"br",
"col",
"embed",
"hr",
"img",
"input",
"link",
"menuitem",
"meta",
"param",
"source",
"track",
"wbr"
[
"area",
"base",
"br",
"col",
"embed",
"hr",
"img",
"input",
"link",
"menuitem",
"meta",
"param",
"source",
"track",
"wbr"
]

View File

@ -1,120 +1,120 @@
[
"a",
"abbr",
"address",
"area",
"article",
"aside",
"audio",
"b",
"base",
"bdi",
"bdo",
"blockquote",
"body",
"br",
"button",
"canvas",
"caption",
"cite",
"code",
"col",
"colgroup",
"data",
"datalist",
"dd",
"del",
"details",
"dfn",
"dialog",
"div",
"dl",
"dt",
"em",
"embed",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"hr",
"html",
"i",
"iframe",
"img",
"input",
"ins",
"kbd",
"label",
"legend",
"li",
"link",
"main",
"map",
"mark",
"math",
"menu",
"menuitem",
"meta",
"meter",
"nav",
"noscript",
"object",
"ol",
"optgroup",
"option",
"output",
"p",
"param",
"picture",
"pre",
"progress",
"q",
"rb",
"rp",
"rt",
"rtc",
"ruby",
"s",
"samp",
"script",
"search",
"section",
"select",
"slot",
"small",
"source",
"span",
"strong",
"style",
"sub",
"summary",
"sup",
"svg",
"table",
"tbody",
"td",
"template",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"track",
"u",
"ul",
"var",
"video",
"wbr"
[
"a",
"abbr",
"address",
"area",
"article",
"aside",
"audio",
"b",
"base",
"bdi",
"bdo",
"blockquote",
"body",
"br",
"button",
"canvas",
"caption",
"cite",
"code",
"col",
"colgroup",
"data",
"datalist",
"dd",
"del",
"details",
"dfn",
"dialog",
"div",
"dl",
"dt",
"em",
"embed",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"hr",
"html",
"i",
"iframe",
"img",
"input",
"ins",
"kbd",
"label",
"legend",
"li",
"link",
"main",
"map",
"mark",
"math",
"menu",
"menuitem",
"meta",
"meter",
"nav",
"noscript",
"object",
"ol",
"optgroup",
"option",
"output",
"p",
"param",
"picture",
"pre",
"progress",
"q",
"rb",
"rp",
"rt",
"rtc",
"ruby",
"s",
"samp",
"script",
"search",
"section",
"select",
"slot",
"small",
"source",
"span",
"strong",
"style",
"sub",
"summary",
"sup",
"svg",
"table",
"tbody",
"td",
"template",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"track",
"u",
"ul",
"var",
"video",
"wbr"
]

View File

@ -1,14 +1,14 @@
[[headers]]
for = "/*"
[headers.values]
Origin-Trial = "AgqJBzNb/dYyS/+JovzFbM178SHW/01lYlxzk/Njmu1kQmVJ5j3CzIHhaPgBng6QiaZ/T6Q5qJtsWNX1ORQ4IAgAAAByeyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0LXhpLnZlcmNlbC5hcHA6NDQzIiwiZmVhdHVyZSI6IldlYkFzc2VtYmx5SlNQcm9taXNlSW50ZWdyYXRpb24iLCJleHBpcnkiOjE3NDQ2NzUyMDB9"
[[redirects]]
from = "/*"
to = "/"
status = 404
[[headers]]
for = "/*"
[headers.values]
[[headers]]
for = "/*"
[headers.values]
Origin-Trial = "AgqJBzNb/dYyS/+JovzFbM178SHW/01lYlxzk/Njmu1kQmVJ5j3CzIHhaPgBng6QiaZ/T6Q5qJtsWNX1ORQ4IAgAAAByeyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0LXhpLnZlcmNlbC5hcHA6NDQzIiwiZmVhdHVyZSI6IldlYkFzc2VtYmx5SlNQcm9taXNlSW50ZWdyYXRpb24iLCJleHBpcnkiOjE3NDQ2NzUyMDB9"
[[redirects]]
from = "/*"
to = "/"
status = 404
[[headers]]
for = "/*"
[headers.values]
Cache-Control = "no-store"

View File

@ -8,7 +8,7 @@
},
"devDependencies": {
"@types/jquery": "^3.5.32",
"@types/node": "^22.10.5",
"@types/node": "^22.10.7",
"typescript": "^5.7.3"
},
"scripts": {

122
prettyBytes.cjs Normal file
View File

@ -0,0 +1,122 @@
const BYTE_UNITS = [
'B',
'kB',
'MB',
'GB',
'TB',
'PB',
'EB',
'ZB',
'YB',
];
const BIBYTE_UNITS = [
'B',
'KiB',
'MiB',
'GiB',
'TiB',
'PiB',
'EiB',
'ZiB',
'YiB',
];
const BIT_UNITS = [
'b',
'kbit',
'Mbit',
'Gbit',
'Tbit',
'Pbit',
'Ebit',
'Zbit',
'Ybit',
];
const BIBIT_UNITS = [
'b',
'kibit',
'Mibit',
'Gibit',
'Tibit',
'Pibit',
'Eibit',
'Zibit',
'Yibit',
];
/*
Formats the given number using `Number#toLocaleString`.
- If locale is a string, the value is expected to be a locale-key (for example: `de`).
- If locale is true, the system default locale is used for translation.
- If no value for locale is specified, the number is returned unmodified.
*/
const toLocaleString = (number, locale, options) => {
let result = number;
if (typeof locale === 'string' || Array.isArray(locale)) {
result = number.toLocaleString(locale, options);
} else if (locale === true || options !== undefined) {
result = number.toLocaleString(undefined, options);
}
return result;
};
module.exports = function prettyBytes(number, options) {
if (!Number.isFinite(number)) {
throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
}
options = {
bits: false,
binary: false,
space: true,
...options,
};
const UNITS = options.bits
? (options.binary ? BIBIT_UNITS : BIT_UNITS)
: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);
const separator = options.space ? ' ' : '';
if (options.signed && number === 0) {
return ` 0${separator}${UNITS[0]}`;
}
const isNegative = number < 0;
const prefix = isNegative ? '-' : (options.signed ? '+' : '');
if (isNegative) {
number = -number;
}
let localeOptions;
if (options.minimumFractionDigits !== undefined) {
localeOptions = {minimumFractionDigits: options.minimumFractionDigits};
}
if (options.maximumFractionDigits !== undefined) {
localeOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};
}
if (number < 1) {
const numberString = toLocaleString(number, options.locale, localeOptions);
return prefix + numberString + separator + UNITS[0];
}
const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
number /= (options.binary ? 1024 : 1000) ** exponent;
if (!localeOptions) {
number = number.toPrecision(3);
}
const numberString = toLocaleString(Number(number), options.locale, localeOptions);
const unit = UNITS[exponent];
return prefix + numberString + separator + unit;
}

View File

@ -1,14 +1,14 @@
import { defineConfig } from 'tsup';
import fg from 'fast-glob';
export default defineConfig({
entry: fg.globSync('eagler-files/**/*.js'),
format: ['esm'],
target: ['chrome131'],
dts: false,
clean: true,
sourcemap: true,
minify: true,
watch: false,
outDir: 'dist',
import { defineConfig } from 'tsup';
import fg from 'fast-glob';
export default defineConfig({
entry: fg.globSync('eagler-files/**/*.js'),
format: ['esm'],
target: ['chrome131'],
dts: false,
clean: true,
sourcemap: true,
minify: true,
watch: false,
outDir: 'dist',
});

View File

@ -1,13 +1,13 @@
{
"$schema": "http://openapi.vercel.sh/vercel.json",
"routes": [
{
"src": "/(.html)?",
"status": 404,
"headers": {
"Cache-Control": "no-store",
"Origin-Trial": "AgqJBzNb/dYyS/+JovzFbM178SHW/01lYlxzk/Njmu1kQmVJ5j3CzIHhaPgBng6QiaZ/T6Q5qJtsWNX1ORQ4IAgAAAByeyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0LXhpLnZlcmNlbC5hcHA6NDQzIiwiZmVhdHVyZSI6IldlYkFzc2VtYmx5SlNQcm9taXNlSW50ZWdyYXRpb24iLCJleHBpcnkiOjE3NDQ2NzUyMDB9"
}
}
]
{
"$schema": "http://openapi.vercel.sh/vercel.json",
"routes": [
{
"src": "/(.html)?",
"status": 404,
"headers": {
"Cache-Control": "no-store",
"Origin-Trial": "AgqJBzNb/dYyS/+JovzFbM178SHW/01lYlxzk/Njmu1kQmVJ5j3CzIHhaPgBng6QiaZ/T6Q5qJtsWNX1ORQ4IAgAAAByeyJvcmlnaW4iOiJodHRwczovL2VhZ2xlcmNyYWZ0LXhpLnZlcmNlbC5hcHA6NDQzIiwiZmVhdHVyZSI6IldlYkFzc2VtYmx5SlNQcm9taXNlSW50ZWdyYXRpb24iLCJleHBpcnkiOjE3NDQ2NzUyMDB9"
}
}
]
}