Skip to content

Commit e8b3eef

Browse files
committed
Update download pages
1 parent 3b18efe commit e8b3eef

File tree

2 files changed

+150
-14
lines changed

2 files changed

+150
-14
lines changed

docs/portable/index.html

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,90 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>Downloading Portable...</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>AudioShelf Download</title>
7+
<style>
8+
body {
9+
background-color: #1e1e1e;
10+
color: #ffffff;
11+
font-family: sans-serif;
12+
display: flex;
13+
flex-direction: column;
14+
align-items: center;
15+
justify-content: center;
16+
height: 100vh;
17+
margin: 0;
18+
text-align: center;
19+
}
20+
.container {
21+
padding: 20px;
22+
border: 1px solid #333;
23+
border-radius: 10px;
24+
background-color: #252526;
25+
max-width: 400px;
26+
}
27+
h1 { font-size: 20px; margin-bottom: 10px; }
28+
p { color: #cccccc; margin-bottom: 20px; }
29+
.btn {
30+
display: none; /* اول مخفی است */
31+
background-color: #007acc;
32+
color: white;
33+
padding: 10px 20px;
34+
text-decoration: none;
35+
border-radius: 5px;
36+
font-weight: bold;
37+
}
38+
.btn:hover { background-color: #005f9e; }
39+
.loader {
40+
border: 4px solid #f3f3f3;
41+
border-top: 4px solid #007acc;
42+
border-radius: 50%;
43+
width: 30px;
44+
height: 30px;
45+
animation: spin 1s linear infinite;
46+
margin: 0 auto 15px auto;
47+
}
48+
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
49+
</style>
650
<script>
751
const user = 'M-Rajabi-dev';
852
const repo = 'AudioShelf';
9-
const filePattern = '-Portable.zip';
53+
const filePattern = '-Portable.zip';
1054

1155
fetch(`https://api.github.com/repos/${user}/${repo}/releases/latest`)
1256
.then(response => response.json())
1357
.then(data => {
1458
const asset = data.assets.find(a => a.name.endsWith(filePattern));
15-
if (asset) window.location.href = asset.browser_download_url;
16-
else document.body.innerHTML = "Portable file not found.";
59+
const status = document.getElementById('status');
60+
const manualBtn = document.getElementById('manual-link');
61+
const loader = document.getElementById('loader');
62+
63+
if (asset) {
64+
status.innerHTML = `Downloading <b>${asset.name}</b>...`;
65+
window.location.href = asset.browser_download_url;
66+
67+
manualBtn.href = asset.browser_download_url;
68+
manualBtn.style.display = 'inline-block';
69+
manualBtn.innerText = "Click here if download doesn't start";
70+
loader.style.display = 'none';
71+
} else {
72+
loader.style.display = 'none';
73+
status.innerHTML = "Error: File not found in the latest release.";
74+
}
1775
})
18-
.catch(err => { document.body.innerHTML = "Error: " + err; });
76+
.catch(err => {
77+
document.getElementById('loader').style.display = 'none';
78+
document.getElementById('status').innerHTML = "Connection Error.";
79+
});
1980
</script>
2081
</head>
21-
<body><p>Starting Portable Download...</p></body>
82+
<body>
83+
<div class="container">
84+
<h1>🎧 AudioShelf</h1>
85+
<div id="loader" class="loader"></div>
86+
<p id="status">Finding latest version...</p>
87+
<a id="manual-link" class="btn" href="#">Download Manually</a>
88+
</div>
89+
</body>
2290
</html>

docs/setup/index.html

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,90 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>Downloading Setup...</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>AudioShelf Download</title>
7+
<style>
8+
body {
9+
background-color: #1e1e1e;
10+
color: #ffffff;
11+
font-family: sans-serif;
12+
display: flex;
13+
flex-direction: column;
14+
align-items: center;
15+
justify-content: center;
16+
height: 100vh;
17+
margin: 0;
18+
text-align: center;
19+
}
20+
.container {
21+
padding: 20px;
22+
border: 1px solid #333;
23+
border-radius: 10px;
24+
background-color: #252526;
25+
max-width: 400px;
26+
}
27+
h1 { font-size: 20px; margin-bottom: 10px; }
28+
p { color: #cccccc; margin-bottom: 20px; }
29+
.btn {
30+
display: none; /* اول مخفی است */
31+
background-color: #007acc;
32+
color: white;
33+
padding: 10px 20px;
34+
text-decoration: none;
35+
border-radius: 5px;
36+
font-weight: bold;
37+
}
38+
.btn:hover { background-color: #005f9e; }
39+
.loader {
40+
border: 4px solid #f3f3f3;
41+
border-top: 4px solid #007acc;
42+
border-radius: 50%;
43+
width: 30px;
44+
height: 30px;
45+
animation: spin 1s linear infinite;
46+
margin: 0 auto 15px auto;
47+
}
48+
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
49+
</style>
650
<script>
751
const user = 'M-Rajabi-dev';
852
const repo = 'AudioShelf';
9-
const filePattern = '-Setup.exe';
53+
const filePattern = '-Setup.exe';
1054

1155
fetch(`https://api.github.com/repos/${user}/${repo}/releases/latest`)
1256
.then(response => response.json())
1357
.then(data => {
1458
const asset = data.assets.find(a => a.name.endsWith(filePattern));
15-
if (asset) window.location.href = asset.browser_download_url;
16-
else document.body.innerHTML = "Setup file not found.";
59+
const status = document.getElementById('status');
60+
const manualBtn = document.getElementById('manual-link');
61+
const loader = document.getElementById('loader');
62+
63+
if (asset) {
64+
status.innerHTML = `Downloading <b>${asset.name}</b>...`;
65+
window.location.href = asset.browser_download_url;
66+
67+
manualBtn.href = asset.browser_download_url;
68+
manualBtn.style.display = 'inline-block';
69+
manualBtn.innerText = "Click here if download doesn't start";
70+
loader.style.display = 'none';
71+
} else {
72+
loader.style.display = 'none';
73+
status.innerHTML = "Error: File not found in the latest release.";
74+
}
1775
})
18-
.catch(err => { document.body.innerHTML = "Error: " + err; });
76+
.catch(err => {
77+
document.getElementById('loader').style.display = 'none';
78+
document.getElementById('status').innerHTML = "Connection Error.";
79+
});
1980
</script>
2081
</head>
21-
<body><p>Starting Setup Download...</p></body>
82+
<body>
83+
<div class="container">
84+
<h1>🎧 AudioShelf</h1>
85+
<div id="loader" class="loader"></div>
86+
<p id="status">Finding latest version...</p>
87+
<a id="manual-link" class="btn" href="#">Download Manually</a>
88+
</div>
89+
</body>
2290
</html>

0 commit comments

Comments
 (0)