Skip to content

Commit

Permalink
Add release
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirasawaSama committed Mar 19, 2020
1 parent 2b91a6c commit 87d99bd
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 75 deletions.
File renamed without changes
File renamed without changes
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3 data-t="headText"></h3>
<section id="second">
<section bp="grid vertical-center">
<div bp="10 offset-2 6@md offset-2@md" class="img">
<img class="screenshot" src="assets/screenshots/resources-cn.png" id="screenshot-resources">
<img class="screenshot" src="assets/screenshots/versions-cn.png" id="screenshot-resources">
</div>
<div class="container right" bp="4@md 12 offset-2">
<h1 data-t="resourcesSystem"></h1>
Expand Down Expand Up @@ -139,6 +139,7 @@ <h1 data-t="serverProvider"></h1>
<a href="javascript:void (setLanguague('en-us'), changeText())">English</a>
</span>
</div>
<div><a href="http://www.beian.miit.gov.cn" target="_blank">辽ICP备16002088号-2</a></div>
<span class="copy">Copyright &copy; 2020 Apisium All rights reserved.</span>
</footer>
</main>
Expand Down
39 changes: 0 additions & 39 deletions install-local.html

This file was deleted.

11 changes: 6 additions & 5 deletions plugins.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@
<img src="assets/screenshots/multi-instances.png">
<p data-t="multiInstances"></p>
<p class="description" data-t="multiInstancesDesc"></p>
<a role="button" class="btn btn-primary btn-sm" data-t="install"></a>
<a href="i.html?https://dl.pl.apisium.cn/resources/plugins/multi-instances/package.json" target="_blank" role="button" class="btn btn-primary btn-sm" data-t="install"></a>
</section>
<section>
<img style="width:65%" src="assets/screenshots/villager.png">
<p>AuthlibInjector</p>
<p class="description" data-t="authlibInjectorDesc"></p>
<a role="button" class="btn btn-primary btn-sm" data-t="install"></a>
<a href="i.html?https://dl.pl.apisium.cn/resources/plugins/authlib-injector/package.json" target="_blank" role="button" class="btn btn-primary btn-sm" data-t="install"></a>
</section>
<section>
<img src="assets/screenshots/mcbot.jpg">
<p>MCBot</p>
<p class="description" data-t="mcBotDesc"></p>
<a role="button" class="btn btn-primary btn-sm" data-t="install"></a>
<a href="i.html?https://dl.pl.apisium.cn/resources/plugins/mcbot/package.json" target="_blank" role="button" class="btn btn-primary btn-sm" data-t="install"></a>
</section>
<section>
<img style="width:65%" src="assets/screenshots/curseforge.png">
<p>CurseForge</p>
<p class="description" data-t="curseForgeDesc"></p>
<a role="button" class="btn btn-primary btn-sm" data-t="install"></a>
<a href="i.html?https://dl.pl.apisium.cn/resources/plugins/curseforge/package.json" target="_blank" role="button" class="btn btn-primary btn-sm" data-t="install"></a>
</section>
<section>
<img src="assets/screenshots/skins.png" class="screenshot-plugin">
<p data-t="skins"></p>
<p class="description" data-t="skinsDesc"></p>
<a role="button" class="btn btn-primary btn-sm" data-t="install"></a>
<a href="i.html?https://dl.pl.apisium.cn/resources/plugins/skins/package.json" target="_blank" role="button" class="btn btn-primary btn-sm" data-t="install"></a>
</section>
</div>
<div id="book-footer"></div>
Expand All @@ -72,6 +72,7 @@
<a href="javascript:void setLanguague('en-us')">English</a>
</span>
</div>
<div><a href="http://www.beian.miit.gov.cn" target="_blank">辽ICP备16002088号-2</a></div>
<span class="copy">Copyright &copy; 2020 Apisium All rights reserved.</span>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/npo.src.min.js"></script>
Expand Down
8 changes: 5 additions & 3 deletions release.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
<section>
<img src="assets/windows.png">
<p>WINDOWS</p>
<p class="links"><a data-t="32">32位</a></p>
<p class="links"><a data-t="32" data-ext="exe" target="_blank"></a></p>
</section>
<section>
<img src="assets/mac.png">
<p>MACOS</p>
<p class="links"><span data-t="64"></span>: <a>dmg</a></p>
<p class="links"><span data-t="64"></span>: <a data-ext="dmg" target="_blank">dmg</a></p>
</section>
<section>
<img src="assets/linux.png">
<p>LINUX</p>
<p class="links"><span data-t="64"></span>: <a>rpm</a> <a>deb</a> <a>tar.gz</a></p>
<p class="links"><span data-t="64"></span>: <a target="_blank" data-ext="rpm">rpm</a> <a target="_blank" data-ext="deb">deb</a> <a target="_blank" data-ext="tar.gz">tar.gz</a></p>
</section>
</div>
<div id="book-footer"></div>
Expand All @@ -57,11 +57,13 @@
<a href="javascript:void setLanguague('en-us')">English</a>
</span>
</div>
<div><a href="http://www.beian.miit.gov.cn" target="_blank">辽ICP备16002088号-2</a></div>
<span class="copy">Copyright &copy; 2020 Apisium All rights reserved.</span>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/npo.src.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/fetch.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="src/i18n.ts"></script>
<script src="src/release.ts"></script>
</body>
</html>
38 changes: 30 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,49 @@ const os = (data.os.name || '').toLowerCase()

const cn = {
home: require('../assets/screenshots/home-cn.png'),
resources: require('../assets/screenshots/resources-cn.png'),
resources: require('../assets/screenshots/versions-cn.png'),
accounts: require('../assets/screenshots/accounts-cn.png')
}

const en = {
home: require('../assets/screenshots/home.png'),
resources: require('../assets/screenshots/resources.png'),
resources: require('../assets/screenshots/versions.png'),
accounts: require('../assets/screenshots/accounts.png')
}

const changeText = () => {
let text: string
let ext: string
if (os.startsWith('android') || os.startsWith('blackberry') || os.startsWith('ios') || os.startsWith('windows phone')) {
text = $i('notSupport')
$('#download-now').prop('disabled', true)
} else if (os.startsWith('windows')) text = `Windows ${$i('32')} (.exe)`
else if (os.startsWith('mac os')) text = `MACOS ${$i('64')} (.dmg)`
else if (os.startsWith('debian') || os.startsWith('ubuntu') || os.startsWith('deepin')) text = `Debian Linux ${$i('64')} (.deb)`
else if (os.startsWith('redhat') || os.startsWith('suse') || os.startsWith('centos')) text = `RedHat Linux ${$i('64')} (.rpm)`
else text = `Linux ${$i('64')} (.tar.gz)`
$('#release-type').text(text)
} else if (os.startsWith('windows')) {
text = `Windows ${$i('32')}`
ext = 'exe'
} else if (os.startsWith('mac os')) {
text = `MACOS ${$i('64')}`
ext = 'dmg'
} else if (os.startsWith('debian') || os.startsWith('ubuntu') || os.startsWith('deepin')) {
text = `Debian Linux ${$i('64')}`
ext = 'deb'
} else if (os.startsWith('redhat') || os.startsWith('suse') || os.startsWith('centos')) {
text = `RedHat Linux ${$i('64')}`
ext = 'rpm'
} else {
text = `Linux ${$i('64')}`
ext = 'tar.gz'
}
const btn = document.getElementById('download-now')
if (ext) {
$('#release-type').text(text + ` (${ext})`)
btn.onclick = () => void window.open(
`https://xmcl.azurewebsites.net/api/pl-get-release?ext=${ext}&gfw=${(window as any).currentLang === 'zh-cn'}`,
'_blank'
)
} else {
$('#release-type').text(text)
btn.onclick = () => {}
}
}
const fn = (window as any).setLanguague
const f = (window as any).setLanguague = (str: string, exec: boolean) => {
Expand Down
17 changes: 0 additions & 17 deletions src/install-local.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ footer > div {
}
footer a {
text-decoration: none;
color: rgba(255, 255, 255, 0.86);
/* color: rgba(255, 255, 255, 0.86); */
}
13 changes: 13 additions & 0 deletions src/release.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const fn1 = (window as any).setLanguague
const f1 = (window as any).setLanguague = (str: string, exec: boolean) => {
const isCN = str === 'zh-cn'
$('[data-ext]').each((_, it) => {
const e = $(it)
e.prop(
'href',
`https://xmcl.azurewebsites.net/api/pl-get-release?ext=${e.data('ext')}&gfw=${isCN}`
)
})
if (!exec) fn1(str)
}
f1((window as any).currentLang, true)
2 changes: 1 addition & 1 deletion src/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const genList = () => {

(window as any).install = (e: MouseEvent, id: number, type: 0 | 1 | 2 | 3) => {
const v = data.versions[id]
let json: any = { type: 'Version', mcVersion: v.id, useIdAsName: true }
let json: any = { type: 'Version', mcVersion: v.id }
switch (type) {
case 1:
json.id = v.fabric + '-Fabric'
Expand Down
1 change: 1 addition & 0 deletions versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<a href="javascript:void setLanguague('en-us')">English</a>
</span>
</div>
<div><a href="http://www.beian.miit.gov.cn" target="_blank">辽ICP备16002088号-2</a></div>
<span class="copy">Copyright &copy; 2020 Apisium All rights reserved.</span>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/npo.src.min.js"></script>
Expand Down

0 comments on commit 87d99bd

Please sign in to comment.