1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-26 10:05:10 +00:00
This commit is contained in:
zumbiepig
2024-08-17 10:43:30 -07:00
parent 58b11e9f66
commit 33d2f59287
47 changed files with 169 additions and 181 deletions

View File

@@ -1,5 +1,5 @@
let selectedVersion: string | undefined;
const launcherVersion = '1.4';
const launcherVersion = '1.5';
const theme = {
load: function (themeToLoad?: string) {
@@ -284,13 +284,7 @@ if (window.location.pathname !== '/') {
alert(`MineXLauncher has been updated to v${launcherVersion}!
Changes in v${launcherVersion}:
- Added welcome and setup screen
- Show changelog when MineXLauncher is updated
- Added themes and backgrounds
- Settings now update automatically without saving them
- You will now stay on the same page when reloading
- Username rules have been updated to match Minecraft
- Added Starlike Client`);
- hello there`);
storage.local.set('lastVersion', launcherVersion);
}
});

View File

@@ -1,29 +1,29 @@
document.addEventListener('DOMContentLoaded', function () {
fetch('/resources/data/mods.json')
.then((response) => response.json())
.then((data: { mods: { [x: string]: string; icon: string; author: string; description: string }[] }) => {
const modListElement = document.querySelector('.mod-list');
data.mods.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}" />
document.addEventListener('DOMContentLoaded', async () => {
try {
const response = await fetch('/resources/data/mods.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 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 mods:', error);
</div>
`;
modListElement?.appendChild(modItem);
});
} catch (error) {
console.error('Error fetching mods:', error);
}
});