1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-08 09:24:48 +00:00
This commit is contained in:
zumbiepig 2024-08-17 10:43:32 -07:00
parent 33d2f59287
commit b0a03d94c8
49 changed files with 234 additions and 305 deletions

View File

@ -6,6 +6,7 @@
<title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/index.css" />
<link rel="manifest" href="/manifest.json" />
<link rel="canonical" href="https://launcher.orionzleon.me/" />
<meta name="theme-color" content="#333" />
<meta name="description" content="Custom launcher for Eaglercraft, which contains many versions and clients." />

19
public/manifest.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "MineXLauncher",
"icons": [
{
"src": "/resources/images/icons/minexlauncher-192x192.webp",
"sizes": "192x192",
"type": "image/webp"
},
{
"src": "/resources/images/icons/minexlauncher-512x512.webp",
"sizes": "512x512",
"type": "image/webp"
}
],
"start_url": "/",
"display": "standalone",
"background_color": "#333",
"theme_color": "#333"
}

View File

@ -47,7 +47,7 @@
<div class="top-menu">
<ul>
<li class="menu-item selected" onclick="navigate.mods.client()">Client</li>
<li class="menu-item" onclick="navigate.mods.client()">Mods</li>
<li class="menu-item" onclick="navigate.mods.mods()">Mods</li>
<li class="menu-item" onclick="navigate.mods.resourcepacks()">Resource Packs</li>
</ul>
</div>

View File

@ -48,7 +48,7 @@
<div class="top-menu">
<ul>
<li class="menu-item" onclick="navigate.mods.client()">Client</li>
<li class="menu-item selected" onclick="navigate.mods.client()">Mods</li>
<li class="menu-item selected" onclick="navigate.mods.mods()">Mods</li>
<li class="menu-item" onclick="navigate.mods.resourcepacks()">Resource Packs</li>
</ul>
</div>

View File

@ -48,7 +48,7 @@
<div class="top-menu">
<ul>
<li class="menu-item" onclick="navigate.mods.client()">Client</li>
<li class="menu-item" onclick="navigate.mods.client()">Mods</li>
<li class="menu-item" onclick="navigate.mods.mods()">Mods</li>
<li class="menu-item selected" onclick="navigate.mods.resourcepacks()">Resource Packs</li>
</ul>
</div>

View File

@ -1,226 +0,0 @@
{
"mods": [
{
"modId": "burmod",
"displayName": "Burmod WIP",
"description": "client for eaglerforge (v0.2)",
"icon": "/resources/images/icons/mods/all.webp",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"repoLink": "https://github.com/Murturtle/Burmod",
"downloadLink": "/resources/mods/burmod.js"
},
{
"modId": "statshud",
"displayName": "StatsHud",
"author": "Neverflagastralis",
"authorLink": "https://github.com/AstralisLLC",
"description": "An all-new StatsHud, soon to be updated with customization functionality!",
"icon": "/resources/images/icons/mods/statshud.webp",
"repoLink": "https://github.com/AstralisLLC/EaglerForge-Mods/blob/main/StatsHudV3.js",
"downloadLink": "/resources/mods/statshud.js"
},
{
"modId": "freshui",
"displayName": "FreshEaglerUI",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"description": "Makes the UIs slide in and re works the main screen!",
"icon": "/resources/images/icons/mods/all.webp",
"repoLink": "https://github.com/Murturtle/MursMods/blob/main/FreshEaglerUI.js",
"downloadLink": "/resources/mods/freshui.js"
},
{
"modId": "chatcmd",
"displayName": "Chat commands mod",
"author": "Neverflagastralis",
"authorLink": "https://github.com/AstralisLLC",
"description": "An open source mod with a built in customizable bug reports system!",
"icon": "/resources/images/icons/mods/all.webp",
"repoLink": "https://github.com/AstralisLLC/EaglerForge-Mods/blob/main/chat%20utils.js",
"downloadLink": "/resources/mods/chatcmd.js"
},
{
"modId": "autologin",
"displayName": "SemiAutoLogin",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"description": "Press L to login without typing!",
"icon": "/resources/images/icons/mods/all.webp",
"repoLink": "https://github.com/Murturtle/MursMods/blob/main/SemiAutoLogin.js",
"downloadLink": "/resources/mods/autologin.js"
},
{
"modId": "blur",
"displayName": "Blur",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"description": "Makes your fps 5 when unfocused!",
"icon": "/resources/images/icons/mods/blur.webp",
"repoLink": "https://github.com/Murturtle/MursMods/blob/main/Blur.js",
"downloadLink": "/resources/mods/blur.js"
},
{
"modId": "jetpack",
"displayName": "Jetpack",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "allows you to fly as if you had a jetpack. keybind(hold): h",
"icon": "/resources/images/icons/mods/jetpack.webp",
"repoLink": "https://github.com/radmanplays/eaglerreborn-plugins/blob/main/jetpack-ef.js",
"downloadLink": "/resources/mods/jetpack.js"
},
{
"modId": "barneysmusicmod",
"displayName": "Barney's Music Mod",
"author": "BarneyTheGod",
"authorLink": "https://github.com/BarneyCompiler",
"description": "Plays a users music through a direct mp3 link. Saves music through Local Browser storage.",
"icon": "/resources/images/icons/mods/barneysmusicmod.webp",
"repoLink": "https://github.com/BarneyCompiler/barneysmods/blob/main/Barneys%20Music%20Player",
"downloadLink": "/resources/mods/barneysmusicmod.js"
},
{
"modId": "blinkmod",
"displayName": "Blink",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "use by typing the .blinkon and .blinkoff commands and sending it",
"icon": "/resources/images/icons/mods/all.webp",
"repoLink": "https://github.com/radmanplays/eaglerreborn-plugins",
"downloadLink": "/resources/mods/blinkmod.js"
},
{
"modId": "graplehookmod",
"displayName": "GrappleHook",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "grappling hook mod. how to use: 1.grab a fishing rod 2.use the fishing rod 3.grappling hook! ",
"icon": "/resources/images/icons/mods/graplehookmod.webp",
"repoLink": "https://github.com/radmanplays/eaglerreborn-plugins",
"downloadLink": "/resources/mods/graplehookmod.js"
},
{
"modId": "xraymod",
"displayName": "Xray",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "simple xray mod. its recommended to use this with Fullbright. keybind: x",
"icon": "/resources/images/icons/mods/xraymod.webp",
"repoLink": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/Xray.js",
"downloadLink": "/resources/mods/xraymod.js"
},
{
"modId": "fullbright",
"displayName": "Fullbright",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "full bright mod for eaglerforge. keybind(enabled by default): f",
"icon": "/resources/images/icons/mods/fullbright.webp",
"repoLink": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/fullbright.js",
"downloadLink": "/resources/mods/fullbright.js"
},
{
"modId": "autoclicker",
"displayName": "Autoclicker",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "this mod clicks for you",
"icon": "/resources/images/icons/mods/autoclicker.webp",
"repoLink": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/autoclicker.js",
"downloadLink": "/resources/mods/autoclicker.js"
},
{
"modId": "speedmod",
"displayName": "Speed Mod",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "makes you faster",
"icon": "/resources/images/icons/mods/speedmod.webp",
"repoLink": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/Speed.js",
"downloadLink": "/resources/mods/speedmod.js"
},
{
"modId": "chatshortcutsmod",
"displayName": "Chat Shortcuts",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "shortcuts: {health}, {pos}, {name}, {me}, {x}, {y}, {z}, {level}, {walked}, {chunk}",
"icon": "/resources/images/icons/mods/all.webp",
"repoLink": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/ChatShortcuts.js",
"downloadLink": "/resources/mods/chatshortcutsmod.js"
},
{
"modId": "nofallmod",
"displayName": "NoFall",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "makes you not take fall damage",
"icon": "/resources/images/icons/mods/all.webp",
"repoLink": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/NoFall.js",
"downloadLink": "/resources/mods/nofallmod.js"
},
{
"modId": "autofishmod",
"displayName": "AutoFish",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"description": "fishes for you. just throw a fishing rod in water to use this mod",
"icon": "/resources/images/icons/mods/all.webp",
"repoLink": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/AutoFish.js",
"downloadLink": "/resources/mods/autofishmod.js"
}
],
"resourcepacks": [
{
"modId": "barebones-bossbars",
"displayName": "Barebones Bossbars",
"author": "vexcenot",
"authorLink": "https://modrinth.com/user/vexcenot",
"description": "simplistic per-mob icons and colors to decorate boss bars with",
"icon": "/resources/images/icons/resourcepacks/barebones-bossbars.webp",
"repoLink": "https://modrinth.com/resourcepack/barebones-bossbars",
"downloadLink": "/resources/resourcepacks/barebones-bossbars.zip"
},
{
"modId": "daggers",
"displayName": "Daggers",
"author": "devin",
"authorLink": "https://modrinth.com/user/devin",
"description": "Shorter swords for better visibility.",
"icon": "/resources/images/icons/resourcepacks/daggers.webp",
"repoLink": "https://modrinth.com/resourcepack/daggers",
"downloadLink": "/resources/resourcepacks/daggers.zip"
},
{
"modId": "faithful-32x",
"displayName": "Faithful (32x)",
"author": "Faithful-Resource-Pack",
"authorLink": "https://modrinth.com/user/Faithful-Resource-Pack",
"description": "The original Minecraft texture feel, with double the resolution and double the fun!",
"icon": "/resources/images/icons/resourcepacks/faithful-32x.webp",
"repoLink": "https://modrinth.com/resourcepack/faithful-32x",
"downloadLink": "/resources/resourcepacks/faithful-32x.zip"
},
{
"modId": "low-on-fire",
"displayName": "Low On Fire",
"author": "Haikis",
"authorLink": "https://modrinth.com/user/Haikis",
"description": "Low fire on your screen! Vanilla Friendly",
"icon": "/resources/images/icons/resourcepacks/low-on-fire.webp",
"repoLink": "https://modrinth.com/resourcepack/low-on-fire",
"downloadLink": "/resources/resourcepacks/low-on-fire.zip"
},
{
"modId": "serified-font",
"displayName": "Serified Font",
"author": "bebebea_loste",
"authorLink": "https://modrinth.com/user/bebebea_loste",
"description": "My take on a fancier Minecraft typeface",
"icon": "/resources/images/icons/resourcepacks/serified-font.webp",
"repoLink": "https://modrinth.com/resourcepack/serified-font",
"downloadLink": "/resources/resourcepacks/serified-font.zip"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,183 @@
{
"mods": [
{
"id": "burmod",
"name": "Burmod",
"description": "client for eaglerforge (v0.2)",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"source": "https://github.com/Murturtle/Burmod"
},
{
"id": "statshud",
"name": "StatsHud",
"description": "An all-new StatsHud, soon to be updated with customization functionality!",
"author": "Neverflagastralis",
"authorLink": "https://github.com/AstralisLLC",
"source": "https://github.com/AstralisLLC/EaglerForge-Mods/blob/main/StatsHudV3.js"
},
{
"id": "fresheaglerui",
"name": "FreshEaglerUI",
"description": "Makes the UIs slide in and re works the main screen!",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"source": "https://github.com/Murturtle/MursMods/blob/main/FreshEaglerUI.js"
},
{
"id": "chat-commands-mod",
"name": "Chat commands mod",
"description": "An open source mod with a built in customizable bug reports system!",
"author": "Neverflagastralis",
"authorLink": "https://github.com/AstralisLLC",
"source": "https://github.com/AstralisLLC/EaglerForge-Mods/blob/main/chat%20utils.js"
},
{
"id": "semiautologin",
"name": "SemiAutoLogin",
"description": "Press L to login without typing!",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"source": "https://github.com/Murturtle/MursMods/blob/main/SemiAutoLogin.js"
},
{
"id": "blur",
"name": "Blur",
"description": "Makes your fps 5 when unfocused!",
"author": "Murturtle",
"authorLink": "https://github.com/Murturtle",
"source": "https://github.com/Murturtle/MursMods/blob/main/Blur.js"
},
{
"id": "jetpack",
"name": "Jetpack",
"description": "allows you to fly as if you had a jetpack. keybind(hold): h",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/radmanplays/eaglerreborn-plugins/blob/main/jetpack-ef.js"
},
{
"id": "barneys-music-mod",
"name": "Barney's Music Mod",
"description": "Plays a users music through a direct mp3 link. Saves music through Local Browser storage.",
"author": "BarneyTheGod",
"authorLink": "https://github.com/BarneyCompiler",
"source": "https://github.com/BarneyCompiler/barneysmods/blob/main/Barneys%20Music%20Player"
},
{
"id": "blink",
"name": "Blink",
"description": "use by typing the .blinkon and .blinkoff commands and sending it",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/radmanplays/eaglerreborn-plugins"
},
{
"id": "grapplehook",
"name": "GrappleHook",
"description": "grappling hook mod. how to use: 1.grab a fishing rod 2.use the fishing rod 3.grappling hook!",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/radmanplays/eaglerreborn-plugins"
},
{
"id": "xray",
"name": "Xray",
"description": "simple xray mod. its recommended to use this with Fullbright. keybind: x",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/Xray.js"
},
{
"id": "fullbright",
"name": "Fullbright",
"description": "full bright mod for eaglerforge. keybind(enabled by default): f",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/fullbright.js"
},
{
"id": "autoclicker",
"name": "Autoclicker",
"description": "this mod clicks for you",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/autoclicker.js"
},
{
"id": "speed-mod",
"name": "Speed Mod",
"description": "makes you faster",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/Speed.js"
},
{
"id": "chat-shortcuts",
"name": "Chat Shortcuts",
"description": "shortcuts: {health}, {pos}, {name}, {me}, {x}, {y}, {z}, {level}, {walked}, {chunk}",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/ChatShortcuts.js"
},
{
"id": "nofall",
"name": "NoFall",
"description": "makes you not take fall damage",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/NoFall.js"
},
{
"id": "autofish",
"name": "AutoFish",
"description": "fishes for you. just throw a fishing rod in water to use this mod",
"author": "radmanplays",
"authorLink": "https://github.com/radmanplays",
"source": "https://github.com/EaglerRinth/eaglerrinth.github.io/blob/main/CommunityMods/AutoFish.js"
}
],
"resourcepacks": [
{
"id": "barebones-bossbars",
"name": "Barebones Bossbars",
"description": "simplistic per-mob icons and colors to decorate boss bars with",
"author": "vexcenot",
"authorLink": "https://modrinth.com/user/vexcenot",
"source": "https://modrinth.com/resourcepack/barebones-bossbars"
},
{
"id": "daggers",
"name": "Daggers",
"description": "Shorter swords for better visibility.",
"author": "devin",
"authorLink": "https://modrinth.com/user/devin",
"source": "https://modrinth.com/resourcepack/daggers"
},
{
"id": "faithful-32x",
"name": "Faithful (32x)",
"description": "The original Minecraft texture feel, with double the resolution and double the fun!",
"author": "Faithful-Resource-Pack",
"authorLink": "https://modrinth.com/user/Faithful-Resource-Pack",
"source": "https://modrinth.com/resourcepack/faithful-32x"
},
{
"id": "low-on-fire",
"name": "Low On Fire",
"description": "Low fire on your screen! Vanilla Friendly",
"author": "Haikis",
"authorLink": "https://modrinth.com/user/Haikis",
"source": "https://modrinth.com/resourcepack/low-on-fire"
},
{
"id": "serified-font",
"name": "Serified Font",
"description": "My take on a fancier Minecraft typeface",
"author": "bebebea_loste",
"authorLink": "https://modrinth.com/user/bebebea_loste",
"source": "https://modrinth.com/resourcepack/serified-font"
}
]
}

View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,7 +1,5 @@
const CACHE_NAME = 'minexlauncher';
const OFFLINE_URL = '/offline.html';
const ASSETS_TO_CACHE = [
OFFLINE_URL,
const cacheAssets = [
'/offline.html',
'/resources/images/icons/favicon.webp',
'/resources/scripts/google-tag.js',
'/resources/scripts/main.js',
@ -27,23 +25,9 @@ const ASSETS_TO_CACHE = [
self.addEventListener('install', (event) => {
event.waitUntil(
caches.delete(CACHE_NAME),
caches.open(CACHE_NAME).then(async (cache) => {
return await cache.addAll(ASSETS_TO_CACHE);
})
);
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((keyList) => {
return Promise.all(
keyList.map((key) => {
if (key !== CACHE_NAME) {
return caches.delete(key);
}
})
);
caches.delete('minexlauncher'),
caches.open('minexlauncher').then(async (cache) => {
return await cache.addAll(cacheAssets);
})
);
});
@ -52,7 +36,7 @@ self.addEventListener('fetch', (event) => {
if (event.request.mode === 'navigate') {
event.respondWith(
fetch(event.request).catch(() => {
return caches.match(OFFLINE_URL);
return caches.match('/offline.html');
})
);
} else {

View File

@ -1,29 +1,13 @@
document.addEventListener('DOMContentLoaded', async () => {
try {
const response = await fetch('/resources/data/mods.json');
const response = await fetch('/resources/mods/data.json');
const data = await response.json();
const modListElement = document.querySelector('.mod-list');
data.mods.forEach(({ icon, author, description, displayName, authorLink, repoLink, downloadLink }) => {
const modItem = document.createElement('div');
modItem.classList.add('mod-item');
modItem.innerHTML = `
<div class="mod-icon">
<img loading="lazy" src="${icon}" />
</div>
<div class="mod-details">
<h3 class="mod-name">${displayName}</h3>
<p class="mod-author">By <a href="${authorLink}" target="_blank">${author}</a></p>
<p class="mod-description">${description}</p>
<div class="mod-links">
<a href="${repoLink}" class="mod-link" target="_blank">Repository</a>
<a href="${downloadLink}" class="mod-link" download>Download</a>
</div>
</div>
`;
modListElement?.appendChild(modItem);
// @ts-expect-error 123
data.mods.forEach(({ id, name, description, author, authorLink, source }) => {
const div = document.createElement('div');
div.classList.add('mod-item');
div.innerHTML = `<div class="mod-icon"><img loading="lazy" src="/resources/mods/icons/${id}.webp" /></div><div class="mod-details"><h3 class="mod-name">${name}</h3><p class="mod-author">By <a href="${authorLink}" target="_blank">${author}</a></p><p class="mod-description">${description}</p><div class="mod-links"><a href="${source}" class="mod-link" target="_blank">Source</a><a href="/resources/mods/downloads/${id}.js" class="mod-link" download>Download</a></div></div>`;
modListElement?.appendChild(div);
});
} catch (error) {
console.error('Error fetching mods:', error);
}
});

View File

@ -1,29 +1,13 @@
document.addEventListener('DOMContentLoaded', function () {
fetch('/resources/data/mods.json')
.then((response) => response.json())
.then((data: { resourcepacks: { [x: string]: string; icon: string; author: string; description: string }[] }) => {
document.addEventListener('DOMContentLoaded', async () => {
const response = await fetch('/resources/mods/data.json');
const data = await response.json();
const modListElement = document.querySelector('.mod-list');
data.resourcepacks.forEach((mod: { [x: string]: string; icon: string; author: string; description: string }) => {
const modItem = document.createElement('div');
modItem.classList.add('mod-item');
modItem.innerHTML = `
<div class="mod-icon">
<img loading="lazy" src="${mod.icon}" />
</div>
<div class="mod-details">
<h3 class="mod-name">${mod['display-name'] ?? ''}</h3>
<p class="mod-author">By <a href="${mod['author-link'] ?? ''}" target="_blank">${mod.author}</a></p>
<p class="mod-description">${mod.description}</p>
<div class="mod-links">
<a href="${mod['repo-link'] ?? ''}" class="mod-link" target="_blank">Repository</a>
<a href="${mod['download-link'] ?? ''}" class="mod-link" download>Download</a>
</div>
</div>
`;
modListElement?.appendChild(modItem);
});
})
.catch((error: unknown) => {
console.error('Error fetching resource packs:', error);
// @ts-expect-error 123
data.resourcepacks.forEach(({ id, name, description, author, authorLink, source }) => {
const div = document.createElement('div');
div.classList.add('mod-item');
div.innerHTML = `<div class="mod-icon"><img loading="lazy" src="/resources/mods/icons/${id}.webp" /></div><div class="mod-details"><h3 class="mod-name">${name}</h3><p class="mod-author">By <a href="${authorLink}" target="_blank">${author}</a></p><p class="mod-description">${description}</p><div class="mod-links"><a href="${source}" class="mod-link" target="_blank">Source</a><a href="/resources/mods/downloads/${id}.zip" class="mod-link" download>Download</a></div></div>`;
modListElement?.appendChild(div);
});
});