Skip to content

Commit 5f4a1a9

Browse files
authored
Merge pull request #7 from SpacEagle17/main
On windows show also an exe button download for the installer
2 parents 5e62a40 + 15ec42d commit 5f4a1a9

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

shaders/index.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h2>Downloads</h2>
115115
<br>Simply run the installer, choose your <a href="#style-section"><u>style</u></a>, and click install.</p>
116116
<p style="margin-top: -6px; color: var(--CompRed); font-weight: 900;">Java is required to run the installer (Minecraft's Java won't work).
117117
<a id="down-section" href="https://www.java.com/download/" target="_blank"><u>www.java.com/download</u></a></p>
118-
<a href="https://github.com/ComplementaryDevelopment/Complementary-Installer/releases/download/latest/Complementary-Installer-1.3.0.jar" class="btn btn-installer" style="width: 350px;">Download Complementary Installer</a>
118+
<div id="installer-buttons"></div>
119119

120120
<p class="download-title" style="--ThemeColor: var(--VeryLightGray);">Manual Download</p>
121121
<p>If you don't want an installer, you can download the shaderpack file from Modrinth.
@@ -182,5 +182,34 @@ <h2>Screenshots</h2>
182182
<script src="/assets/js/jquery.countTo.min.js"></script>
183183
<script src="/assets/js/jquery.shuffle.min.js"></script>
184184
<script src="/assets/js/script.js"></script>
185+
<script>
186+
function isWindowsOS() {
187+
if (navigator.platform && navigator.platform.startsWith("Win")) {
188+
return true;
189+
}
190+
191+
if (navigator.userAgent && /Windows/i.test(navigator.userAgent)) {
192+
return true;
193+
}
194+
195+
return false;
196+
}
197+
198+
const installerVersion = "1.3.0";
199+
const exeInstallerUrl = `https://github.com/ComplementaryDevelopment/Complementary-Installer/releases/download/latest/Complementary-Installer-${installerVersion}.exe`;
200+
const jarInstallerUrl = `https://github.com/ComplementaryDevelopment/Complementary-Installer/releases/download/latest/Complementary-Installer-${installerVersion}.jar`;
201+
202+
if (isWindowsOS()) {
203+
// Show both .exe and .jar buttons for Windows users
204+
document.getElementById('installer-buttons').innerHTML = `
205+
<p>Download the Complementary Installer as an .exe for Windows or universal .jar</p>
206+
<a href="${exeInstallerUrl}" class="btn btn-installer" style="width: 250px; margin-right: 10px; border: 2px solid var(--CompBlue);">Download Windows Installer</a>
207+
<a href="${jarInstallerUrl}" class="btn btn-installer" style="width: 250px; border: 2px solid var(--CompOrange);">Download Installer (.jar)</a>
208+
`;
209+
} else {
210+
document.getElementById('installer-buttons').innerHTML = `<a href="${jarInstallerUrl}" class="btn btn-installer" style="width: 350px; border: 2px solid var(--CompOrange);">Download Complementary Installer</a>`;
211+
}
212+
</script>
213+
</body>
185214
</body>
186215
</html>

0 commit comments

Comments
 (0)