-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
143 lines (123 loc) · 5.96 KB
/
index.html
File metadata and controls
143 lines (123 loc) · 5.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="/The-MegaMod/img/assets/logos/modServer.png">
<link rel="stylesheet" href="/The-MegaMod/assets/css/style.css">
<title>The MegaMod</title>
<!-- Open Graph Meta Tags for Embeds -->
<meta property="og:title" content="The MegaMod" />
<meta property="og:description" content="The MegaMod is a collection of mods designed to enhance your Shell Shockers experience. From fun features to useful additions that elevate the game’s functionality, this culmination of all my mods (with new additions and features), is your one-stop solution!" />
<meta property="og:image" content="https://infinitesmasher.github.io/The-MegaMod/img/docs/megaMod/The%20MegaMod%20Banner.png" />
<meta property="og:type" content="website" />
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="The MegaMod" />
<meta name="twitter:description" content="The MegaMod is a collection of mods designed to enhance your Shell Shockers experience. From fun features to useful additions that elevate the game’s functionality, this culmination of all my mods (with new additions and features), is your one-stop solution!" />
<meta name="twitter:image" content="https://infinitesmasher.github.io/The-MegaMod/img/docs/megaMod/The%20MegaMod%20Banner.png" />
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
#changelog-content {
max-height: 300px;
overflow-y: auto;
padding-right: 10px;
}
</style>
</head>
<body>
<div id="content" class="container-lg px-3 my-5 markdown-body">
<!-- Content will be dynamically loaded here -->
</div>
<script>
// Fetch README.md and display it on the page
fetch('/The-MegaMod/README.md')
.then(response => response.text())
.then(text => {
// Convert Markdown to HTML (using marked.js)
const markedText = marked.parse(text);
document.getElementById('content').innerHTML = markedText;
const changelogContent = document.getElementById('changelog-content');
// Function to format a changelog entry into HTML
const createChangelogEntry = (versionData) => {
let entryHTML = `<h4>Version ${versionData.version} - ${versionData.date}</h4>`;
entryHTML += '<ul>';
versionData.content.forEach(item => entryHTML += `<li>${item}</li>`);
entryHTML += '</ul>';
entryHTML += '<hr>';
return entryHTML;
};
// Load changelog data from the new info.json and oldChangelog.json
Promise.all([
fetch('/The-MegaMod/data/info.json').then(response => response.json()),
fetch('/The-MegaMod/data/oldChangelog.json').then(response => response.json())
]).then(([infoData, oldChangelogData]) => {
let changelogHTML = '';
// Add current changelog section
if (infoData.currentChangelog) {
changelogHTML += '<h3>Current Version</h3>';
const current = infoData.currentChangelog;
const { version, date, content } = current;
document.getElementById("version").innerHTML = version;
changelogHTML += createChangelogEntry({ version, date, content });
}
// Add older changelog entries
if (oldChangelogData.length > 0) {
changelogHTML += '<h3>Older Versions</h3>';
oldChangelogData.forEach(version => changelogHTML += createChangelogEntry(version));
}
// Set the inner HTML of the changelog content
changelogContent.innerHTML = changelogHTML;
// Proxy List
const proxyContent = document.getElementById('proxy-content');
fetch('/The-MegaMod/js/script.meta.js')
.then(response => response.text())
.then(text => {
const regex = /@match\s+([\S]+)/g;
let match;
const urls = [];
while ((match = regex.exec(text)) !== null) urls.push(match[1]);
urls.sort();
if (urls.length) {
document.getElementById("proxy-title").innerHTML += ` (${urls.length})`;
const ul = document.createElement('ul');
urls.forEach(url => {
const li = document.createElement('li');
const a = document.createElement('a');
// Clean the URL
url = url.replace('*.', '').replace('/*', '');
// Clean the URL for the display text (domain only):
const domainOnly = url.replace('*://', '').replace('*', '');
// Clean the URL for the href (full path):
const fullUrl = url.replace('*://', 'https://').replace('*', '');
// Set the href to the full URL (including path)
a.href = fullUrl;
a.target = '_blank';
// Display the domain only
a.textContent = domainOnly;
li.appendChild(a);
ul.appendChild(li);
});
proxyContent.appendChild(ul);
} else {
proxyContent.innerHTML = 'No proxies found.';
}
}).catch(error => {
console.error('Error loading script.meta.js:', error);
proxyContent.innerHTML = 'Failed to load proxies.';
});
}).catch(error => {
console.error('Error loading changelog data:', error);
changelogContent.innerHTML = 'Failed to load changelog.'
});
}).catch(error => {
console.error('Error loading README.md:', error);
});
</script>
<!-- Include Marked.js for Markdown rendering -->
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</body>
</html>