From 1f97a940ac42a6a1de2f6c6db97c2a96c8ff0a23 Mon Sep 17 00:00:00 2001
From: zumbiepig <121742281+zumbiepig@users.noreply.github.com>
Date: Fri, 26 Jul 2024 07:16:16 -0700
Subject: [PATCH] Dev (#28)
---
public/mobile/index.html | 2 +-
public/resources/styles/mobile.css | 10 ++++++++++
public/updates/index.html | 2 +-
src/resources/scripts/main.ts | 8 +++++++-
4 files changed, 19 insertions(+), 3 deletions(-)
create mode 100644 public/resources/styles/mobile.css
diff --git a/public/mobile/index.html b/public/mobile/index.html
index 1856fed..d919b5f 100644
--- a/public/mobile/index.html
+++ b/public/mobile/index.html
@@ -41,7 +41,7 @@
diff --git a/public/resources/styles/mobile.css b/public/resources/styles/mobile.css
new file mode 100644
index 0000000..1d2e96b
--- /dev/null
+++ b/public/resources/styles/mobile.css
@@ -0,0 +1,10 @@
+.launcher {
+ width: 95vw;
+ height: 95vh;
+ margin: 10px auto 0 auto;
+}
+
+.play-button {
+ text-decoration: none;
+ padding: 10px 10px;
+}
diff --git a/public/updates/index.html b/public/updates/index.html
index 20ca43f..d014b65 100644
--- a/public/updates/index.html
+++ b/public/updates/index.html
@@ -59,7 +59,7 @@
Added hacked clients
Added Eaglercraft 1.2.5
Added more mods and resource packs
- Fix mobile site not working
+ Fix and optimize mobile site
MineXLauncher 1.1
Temporary workaround for keyboard not working in the game
diff --git a/src/resources/scripts/main.ts b/src/resources/scripts/main.ts
index ffe2e0a..f397fb0 100644
--- a/src/resources/scripts/main.ts
+++ b/src/resources/scripts/main.ts
@@ -1,12 +1,18 @@
const theme = {
load() {
+ if (window.location.pathname === '/mobile/') {
+ const link = document.createElement('link');
+ link.rel = 'stylesheet';
+ link.href = '/resources/styles/mobile.css';
+ document.head.appendChild(link);
+ }
const setTheme = cookie.get('minexlauncher.theme');
if (setTheme === null) {
theme.set('default');
} else if (setTheme !== 'default') {
const link = document.createElement('link');
link.rel = 'stylesheet';
- link.href = '/resources/styles/' + setTheme + '.css';
+ link.href = `/resources/styles/${setTheme}.css`;
document.head.appendChild(link);
}
},