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

View File

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

View File

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

102
js/ga4.js
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/jquery": "^3.5.32", "@types/jquery": "^3.5.32",
"@types/node": "^22.10.5", "@types/node": "^22.10.7",
"typescript": "^5.7.3" "typescript": "^5.7.3"
}, },
"scripts": { "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 { defineConfig } from 'tsup';
import fg from 'fast-glob'; import fg from 'fast-glob';
export default defineConfig({ export default defineConfig({
entry: fg.globSync('eagler-files/**/*.js'), entry: fg.globSync('eagler-files/**/*.js'),
format: ['esm'], format: ['esm'],
target: ['chrome131'], target: ['chrome131'],
dts: false, dts: false,
clean: true, clean: true,
sourcemap: true, sourcemap: true,
minify: true, minify: true,
watch: false, watch: false,
outDir: 'dist', outDir: 'dist',
}); });

View File

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