-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.html
236 lines (203 loc) · 10.5 KB
/
player.html
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="referrer" content="no-referrer">
<!-- SEO Meta Tags -->
<meta name="description" content="Aria is a business focused HTML landing page template built with Bootstrap to help you create lead generation websites for companies and their services.">
<meta name="author" content="Inovatik">
<!-- OG Meta Tags to improve the way the post looks when you share the page on LinkedIn, Facebook, Google+ -->
<meta property="og:site_name" content=""> <!-- website name -->
<meta property="og:site" content=""> <!-- website link -->
<meta property="og:title" content=""> <!-- title shown in the actual shared post -->
<meta property="og:description" content=""> <!-- description shown in the actual shared post -->
<meta property="og:image" content=""> <!-- image link, make sure it's jpg -->
<meta property="og:url" content=""> <!-- where do you want your post to link to -->
<meta property="og:type" content="article">
<!-- Website Title -->
<title>游戏公告-KukeMC-我的世界服务器(Minecraft)</title>
<!-- Styles -->
<link href="static/css/bootstrap.css" rel="stylesheet">
<link href="static/css/styles.css" rel="stylesheet">
<!-- Favicon -->
<link rel="icon" href="https://m.ccw.site/gandi_application/user_assets/2a6bb37880317d2bb5525ab560618e04.png">
<style>
body {
background-image: url('https://m.ccw.site/gandi_application/user_assets/2ed217bfa1522ba181980e9ffb331ad6.jpg'); /* lobby图片 */
background-position: 0 370px; /* 水平位置不变,垂直向下偏移 */
}
.text-container-2 {
background: rgba(255, 255, 255, 0.322);
padding: 30px;
margin: 15px;
border-radius: 15px;
backdrop-filter: blur(5px);
min-height: 300px;
max-height: 300px;
overflow: hidden; /* 隐藏溢出的内容 */
transition: max-height 0.5s ease; /* 使用max-height的动画 */
}
/* 玩家列表布局 */
.player-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
max-width: 1200px;
}
/* 玩家卡片样式 */
.player {
background: rgba(54, 185, 202, 0.363); /* 半透明白色背景 */
backdrop-filter: blur(10px);
padding: 20px;
margin: 15px;
text-align: center;
border-radius: 15px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
transition: transform 0.3s, box-shadow 0.3s;
}
/* 鼠标悬停效果 */
.player:hover {
transform: translateY(-10px);
box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
}
/* 玩家头像样式 */
.player img {
width: 100px;
height: 100px;
border-radius: 50%;
border: 3px solid #fff;
padding: 5px; /* 增加padding以扩大border的视觉效果 */
background-color: transparent; /* 确保padding区域透明 */
transition: border-color 0.3s;
}
/* 鼠标悬停头像效果 */
.player:hover img {
border-color: #39ad66;
}
/* 玩家名称样式 */
.player-name {
margin-top: 15px;
font-size: 1.2em;
font-weight: bold;
color: #333;
}
</style>
</head>
<body data-spy="scroll" data-target=".fixed-top"">
<!-- Preloader -->
<div class="spinner-wrapper">
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
</div>
<!-- end of preloader -->
<!-- Navbar -->
<div id="navbar"></div>
<!-- Header -->
<header id="header" class="ex-header">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1>当前服务器在线玩家</h1>
</div> <!-- end of col -->
</div> <!-- end of row -->
</div> <!-- end of container -->
</header> <!-- end of ex-header -->
<!-- end of header -->
<!-- Breadcrumbs -->
<div class="ex-basic-1" style="background-color: #ffffff81; backdrop-filter: blur(5px);">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumbs">
<a href="index.html">首页</a><span> > 当前服务器在线玩家</span>
</div> <!-- end of breadcrumbs -->
</div> <!-- end of col -->
</div> <!-- end of row -->
</div> <!-- end of container -->
</div> <!-- end of ex-basic-1 -->
<!-- end of breadcrumbs -->
<!-- Terms Content -->
<div class="ex-basic-2">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-container-2" id="textContainer">
<h1 style="font-size: 3em;
margin-bottom: 20px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
text-align: center; /* 标题居中 */">在线玩家</h1>
<h4 style="color:white;margin-bottom:3rem;text-shadow:
0 0 10px #fff,
0 0 20px rgba(81, 203, 238, 1),
0 0 30px rgba(81, 203, 238, 1),
0 0 40px rgba(81, 203, 238, 1),
0 0 50px rgba(81, 203, 238, 1),
0 0 60px rgba(81, 203, 238, 1),
0 0 70px rgba(81, 203, 238, 1),
0 0 80px rgba(81, 203, 238, 1),
0 0 90px rgba(81, 203, 238, 1),
0 0 100px rgba(81, 203, 238, 1);
text-align: center;" id="playerCount">正在加载...</h4>
<div class="player-list" id="playerList"></div>
<script>
async function fetchPlayerList() {
try {
const response = await fetch('https://api.kuke.ink/api/playerlist');
const data = await response.json();
const playerCountDiv = document.getElementById('playerCount');
const playerListDiv = document.getElementById('playerList');
const textContainer = document.getElementById('textContainer');
if (data.players && data.players.length > 0) {
playerCountDiv.textContent = `在线玩家数量:${data.players.length}`;
playerListDiv.innerHTML = '';
data.players.forEach(player => {
const playerDiv = document.createElement('div');
playerDiv.className = 'player';
const playerAvatar = document.createElement('div');
playerAvatar.className = 'player-avatar';
const playerImage = document.createElement('img');
playerImage.src = `https://crafthead.net/cube/${player.name}`;
playerImage.alt = `${player.name}'s avatar`;
const playerName = document.createElement('div');
playerName.className = 'player-name';
playerName.textContent = player.name;
playerAvatar.appendChild(playerImage);
playerDiv.appendChild(playerAvatar);
playerDiv.appendChild(playerName);
playerListDiv.appendChild(playerDiv);
});
textContainer.style.maxHeight = textContainer.scrollHeight + 'px';
} else {
playerCountDiv.textContent = '在线玩家数量:0';
playerListDiv.textContent = '服务器里暂时没有人 >﹏<';
}
} catch (error) {
console.error('Error fetching player list:', error);
document.getElementById('playerList').textContent = 'Failed to load player list.';
}
}
// Fetch player list when the page loads
window.onload = fetchPlayerList;
</script>
</div> <!-- end of text-container -->
</div>
</div> <!-- end of row -->
</div> <!-- end of container -->
</div> <!-- end of ex-basic -->
<!-- end of terms content -->
<div id="footer"></div>
<!-- end of copyright -->
<!-- Scripts -->
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <!-- jQuery for Bootstrap's JavaScript plugins -->
<script src="http://apps.bdimg.com/libs/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-easing/1.4.1/jquery.easing.min.js"></script> <!-- jQuery Easing for smooth scrolling between anchors -->
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/Swiper/8.0.6/swiper-bundle.min.js"></script> <!-- Swiper for image and text sliders -->
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script> <!-- Magnific Popup for lightboxes -->
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/Morphext/2.4.4/morphext.min.js"></script> <!-- Morphtext rotating text in the header -->
<script src="static/js/scripts.js"></script> <!-- Custom scripts -->
</body>
</html>