-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
77 lines (68 loc) · 3.09 KB
/
index.html
File metadata and controls
77 lines (68 loc) · 3.09 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
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MSCPO资源站 - MC服主的全能资源站!</title>
<link type="text/css" href="rs/css/semantic.min.css" rel="stylesheet" />
<link type="text/css" href="rs/css/stylesheet.css" rel="stylesheet" />
<link type="text/css" href="rs/css/appearance-fix.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
</head>
<body>
<nav class="ui inverted cuberite-theme cuberite-navigation menu">
<div class="ui container" id="cuberite-navigation-container">
<a href="/" class="header item">
<img src="rs/img/logo.webp" style="margin-right: 1.5em" alt="Logo" class="logo" />
<p>MSCPO资源站</p>
</a>
<a class="right item" href="javascript:history.back()">
<span>返回上一页</span>
</a>
</div>
</nav>
<main class="ui container" id="cuberite-main-container">
<div class="ui hidden divider"></div>
<div class="ui horizontal-cards" id="index-json"></div>
</main>
<script>
fetch('rs/json/index.json')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok ' + response.statusText);
}
return response.json();
})
.then(data => {
const outputDiv = document.getElementById('index-json');
let htmlContent = '';
// Create a new element for each item and append it to the output div
data.forEach(item => {
htmlContent += `
<a class="ui card" href="${item.link}">
<div class="content">
<div class="header">${item.header}</div>
<div class="meta">${item.meta}</div>
<div class="description">${item.description}</div>
</div>
<div class="extra content">
<span class="left floated">${item.spanLeft}</span>
<span class="right floated">${item.spanRight}</span>
</div>
</a>
`;
});
outputDiv.innerHTML = htmlContent;
})
.catch(error => console.error('Error loading JSON:', error));
</script>
<footer class="ui inverted cuberite-theme cuberite-navigation footer segment">
<div class="ui center aligned container">
<div class="ui inverted horizontal link list">
<a class="item" href="http://www.mscpo.top/">MSCPO</a>
<a class="item" href="https://github.com/MSCPO/Minecraft-Resource-Site">GitHub</a>
</div>
</div>
</footer>
</body>
</html>