1
0
mirror of https://github.com/zumbiepig/MineXLauncher.git synced 2025-06-08 09:24:48 +00:00

update to 1.6.0-beta.1

This commit is contained in:
zumbiepig 2024-09-01 07:35:22 -07:00
parent 524b27926d
commit cb44483ff0
No known key found for this signature in database
GPG Key ID: 17C891BE28B953DE
20 changed files with 137 additions and 91 deletions

View File

@ -16,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -16,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -16,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -16,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -13,7 +13,7 @@
<body>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" id="theme" />
<script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script>
<script src="/resources/scripts/mods/mods.js"></script>
</head>
<body>
<div class="ads-container">
@ -17,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -9,7 +9,6 @@
<link rel="stylesheet" id="theme" />
<script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script>
<script src="/resources/scripts/mods/resourcepacks.js"></script>
</head>
<body>
<div class="ads-container">
@ -17,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -17,7 +17,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="main-panel">

View File

@ -0,0 +1,59 @@
[
{
"version": "1.6.0",
"changelog": [
"You can now install mods directly from the mods list"
]
},
{
"version": "1.5.0",
"changelog": [
"You can now install the launcher as a PWA web app"
]
},
{
"version": "1.4.0",
"changelog": [
"Added Starlike Client",
"Added welcome and setup screen",
"Show changelog when the launcher 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"
]
},
{
"version": "1.3.0",
"changelog": [
"Redesigned archive page",
"Added offline page"
]
},
{
"version": "1.2.0",
"changelog": [
"Added Eaglercraft 1.2.5",
"Added more mods and resource packs",
"Fix and optimize mobile site"
]
},
{
"version": "1.1.0",
"changelog": [
"Added a mods and resource packs list",
"Temporary workaround for keyboard not working in the game",
"Moved most images and assets to this websites in case they are blocked",
"Added a 404 page",
"Added Discord link to bottom bar",
"Added Peyton's Infdev and Classic versions",
"Updated client versions"
]
},
{
"version": "1.0.0",
"changelog": [
"Major rewrite, check it out yourself!"
]
}
]

View File

@ -359,14 +359,18 @@ nav {
color: #ddd;
}
.news-item {
flex: 1;
padding: 20px;
.updates-container {
margin: 20px;
text-align: left;
}
.news-item li {
padding-left: 20px;
.updates-container strong {
padding-top: 20px;
}
.updates-container ul {
margin: 0px;
padding: 5px 0 20px 30px;
}
.minecraft-button {

View File

@ -16,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -16,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">

View File

@ -16,7 +16,7 @@
</div>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="sidebar">
@ -51,40 +51,7 @@
<span class="game-title">Updates</span>
</div>
<div class="main-content">
<div class="news-item">
<!-- Don't forget to update launcherVersion and the changelog in main.js as well -->
<strong>MineXLauncher 1.5</strong>
<li>You can now install the launcher as a PWA web app</li>
<br />
<strong>MineXLauncher 1.4</strong>
<li>Added welcome and setup screen</li>
<li>Show changelog when the launcher is updated</li>
<li>Added themes and backgrounds</li>
<li>Settings now update automatically without saving them</li>
<li>You will now stay on the same page when reloading</li>
<li>Username rules have been updated to match Minecraft</li>
<li>Added Starlike Client</li>
<br />
<strong>MineXLauncher 1.3</strong>
<li>Redesigned Archive Page</li>
<li>Added offline page</li>
<br />
<strong>MineXLauncher 1.2</strong>
<li>Added Eaglercraft 1.2.5</li>
<li>Added more mods and resource packs</li>
<li>Fix and optimize mobile site</li>
<br />
<strong>MineXLauncher 1.1</strong>
<li>Temporary workaround for keyboard not working in the game</li>
<li>Moved most images and assets to this websites in case they are blocked</li>
<li>Added a 404 page</li>
<li>Added Discord link to bottom bar</li>
<li>Added Peyton's Infdev and Classic versions</li>
<li>Updated client versions</li>
<br />
<strong>MineXLauncher 1.0</strong>
<li>Major rewrite, check it out yourself!</li>
</div>
<div class="updates-container" id="updates-container"></div>
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@
<body>
<div class="launcher">
<div class="title-bar">
<span>MineXLauncher 1.5</span>
<span>MineXLauncher 1.6.0</span>
</div>
<div class="content">
<div class="main-panel">

View File

@ -1,7 +1,10 @@
import { gt, coerce } from 'semver';
import { SemVer, gt } from 'semver';
let selectedVersion: string | undefined;
const launcherVersion = '1.5';
// Update `cacheVersion` in sw.js too
const launcherVersion: SemVer = new SemVer('1.6.0-beta.1');
const releaseNotes = ['You can now install mods directly from the mods list'];
const theme = {
load: function (themeToLoad?: string) {
@ -298,7 +301,7 @@ const mods = {
mods.splice(modIndex, 1);
storage.local.set('mods', mods);
}
}
},
};
const serviceworker = {
@ -381,10 +384,8 @@ if (window.location.pathname === '/') {
document.addEventListener('DOMContentLoaded', () => {
const lastVersion = storage.local.get('lastVersion');
// @ts-expect-error
if (lastVersion !== null && gt(coerce(launcherVersion, { includePrerelease: true }), coerce(lastVersion, { includePrerelease: true }))) {
const releaseNotes = ['You can now install the launcher as a PWA web app'].map((item) => ` - ${item}`).join('\n');
alert(`MineXLauncher has been updated to v${launcherVersion}!\n\nChanges in v${launcherVersion}:\n${releaseNotes}`);
if (lastVersion !== null && gt(launcherVersion, lastVersion)) {
alert(`MineXLauncher has been updated to v${launcherVersion}!\n\nChanges in v${launcherVersion}:\n${releaseNotes.map((item) => ` - ${item}`).join('\n')}`);
storage.local.set('lastVersion', launcherVersion);
}
});
@ -446,9 +447,7 @@ if (window.location.pathname === '/settings/') {
window.location.reload();
});
});
}
if (window.location.pathname === '/welcome/') {
} else if (window.location.pathname === '/welcome/') {
document.addEventListener('DOMContentLoaded', () => {
const setupForm = document.getElementById('setup-form') as HTMLFormElement;
const usernameInput = document.getElementById('username-input') as HTMLInputElement;
@ -505,6 +504,51 @@ if (window.location.pathname === '/welcome/') {
}
});
});
} else if (window.location.pathname === '/mods/mods/' || window.location.pathname === '/mods/resourcepacks/') {
document.addEventListener('DOMContentLoaded', async () => {
let modType: 'mods' | 'resourcepacks' = 'mods';
let modExt: 'js' | 'zip' = 'js';
switch (window.location.pathname) {
case '/mods/mods/':
modType = 'mods';
modExt = 'js';
break;
case '/mods/resourcepacks/':
modType = 'resourcepacks';
modExt = 'zip';
break;
}
const mods = await (await fetch('/resources/data/mods.json')).json();
mods[modType].forEach((mod: { id: string; name: string; description: string; author: string; authorLink: string; source: string }) => {
const modItem = document.createElement('div');
modItem.classList.add('mod-item');
modItem.innerHTML = `<div class="mod-icon"><img loading="lazy" src="/resources/mods/icons/${mod.id}.webp" /></div><div class="mod-details"><h3 class="mod-name">${mod.name}</h3><p class="mod-author">By <a href="${mod.authorLink}" target="_blank">${mod.author}</a></p><p class="mod-description">${mod.description}</p><div class="mod-links"><a href="${mod.source}" class="mod-link" target="_blank">Source</a><a href="/resources/mods/downloads/${mod.id}.${modExt}" class="mod-link" download>Download</a></div></div>`;
const modList = document.querySelector('.mod-list');
modList?.appendChild(modItem);
});
});
} else if (window.location.pathname === '/updates/') {
document.addEventListener('DOMContentLoaded', async () => {
const updatesContainer = document.getElementById('updates-container');
const updates = await (await fetch('/resources/data/updates.json')).json();
updates.forEach((update: { version: string; changelog: string[] }) => {
const versionHeader = document.createElement('strong');
versionHeader.textContent = `MineXLauncher ${update.version}`;
updatesContainer?.appendChild(versionHeader);
const changelog = document.createElement('ul');
update.changelog.forEach((change) => {
const changelogItem = document.createElement('li');
changelogItem.textContent = change;
changelog.appendChild(changelogItem);
});
updatesContainer?.appendChild(changelog);
});
});
}
if (window.location.hostname === null) {

View File

@ -1,13 +0,0 @@
document.addEventListener('DOMContentLoaded', async () => {
const response = await fetch('/resources/mods/data.json');
const data = await response.json();
const modListElement = document.querySelector('.mod-list');
// @ts-expect-error
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);
});
});

View File

@ -1,13 +0,0 @@
document.addEventListener('DOMContentLoaded', async () => {
const response = await fetch('/resources/mods/data.json');
const data = await response.json();
const modListElement = document.querySelector('.mod-list');
// @ts-expect-error
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);
});
});

View File

@ -1,5 +1,5 @@
// @ts-nocheck
const cacheVersion = '1.5';
const cacheVersion = '1.6.0';
const cacheName = `minexlauncher-full-v${cacheVersion}`;
self.addEventListener('install', (event) => {

View File

@ -1,5 +1,5 @@
// @ts-nocheck
const cacheVersion = '1.5';
const cacheVersion = '1.6.0';
const cacheName = `minexlauncher-v${cacheVersion}`;
const offlineUrl = '/offline.html';
const cacheAssets = [