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

fix the bug where the theme flickers

This commit is contained in:
zumbiepig 2024-09-03 20:35:52 -07:00
parent 1f5223c96f
commit 2597e40ba1
No known key found for this signature in database
GPG Key ID: 17C891BE28B953DE
14 changed files with 27 additions and 34 deletions

View File

@ -6,12 +6,12 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<meta name="theme-color" content="#333" /> <meta name="theme-color" content="#333" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="launcher"> <div class="launcher">
<div class="title-bar"> <div class="title-bar">
<span id="title-bar-text">MineXLauncher</span> <span id="title-bar-text">MineXLauncher</span>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,12 +6,12 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<meta name="theme-color" content="#333" /> <meta name="theme-color" content="#333" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,11 +6,11 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="ads-container"> <div class="ads-container">
<ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins> <ins class="adsbygoogle" style="display: block" data-ad-client="ca-pub-1132419379737567" data-ad-slot="3280170072" data-ad-format="auto" data-full-width-responsive="true"></ins>
</div> </div>

View File

@ -6,12 +6,12 @@
<title>MineXLauncher</title> <title>MineXLauncher</title>
<link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" /> <link rel="icon" type="image/webp" href="/resources/images/icons/favicon.webp" />
<link rel="stylesheet" href="/resources/styles/themes/default.css" /> <link rel="stylesheet" href="/resources/styles/themes/default.css" />
<link rel="stylesheet" id="theme" /> <link rel="stylesheet" id="theme" onload="document.body.style.display = ''" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<script src="/resources/scripts/google-tag.js"></script> <script src="/resources/scripts/google-tag.js"></script>
<script src="/resources/scripts/main.js"></script> <script src="/resources/scripts/main.js"></script>
</head> </head>
<body> <body style="display: none">
<div class="launcher"> <div class="launcher">
<div class="title-bar"> <div class="title-bar">
<span id="title-bar-text">MineXLauncher</span> <span id="title-bar-text">MineXLauncher</span>

View File

@ -369,14 +369,7 @@ if (window.location.pathname === '/') {
if (iframe.contentWindow) iframe.contentWindow.installPwaEvent = event; if (iframe.contentWindow) iframe.contentWindow.installPwaEvent = event;
}); });
} else { } else {
document.addEventListener('DOMContentLoaded', () => { theme.load();
const themeElement = document.getElementById('theme') as HTMLLinkElement;
if (themeElement) {
document.documentElement.style.display = 'none';
themeElement.onload = () => (document.documentElement.style.display = '');
themeElement.href = `/resources/styles/themes/${storage.local.get('theme') ?? 'default'}.css`;
}
});
document.addEventListener('DOMContentLoaded', async () => { document.addEventListener('DOMContentLoaded', async () => {
const profileName = document.getElementById('profile-name'); const profileName = document.getElementById('profile-name');