-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
479 lines (443 loc) · 20.5 KB
/
index.html
File metadata and controls
479 lines (443 loc) · 20.5 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
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>五子棋挑战 · 万层地狱</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<button class="support-btn" id="supportBtn">
<i class="fas fa-wine-bottle"></i> 打赏作者
</button>
<!-- 打赏协议弹窗 -->
<div class="agreement-overlay" id="agreementOverlay">
<div class="agreement-modal">
<div class="agreement-header">
<i class="fas fa-file-contract"></i>
<span>打赏用户协议</span>
</div>
<div class="agreement-body">
<p class="agreement-notice">请仔细阅读本协议。点击"同意"即表示您已完全理解并接受以下全部条款。</p>
<div class="agreement-section">
<h4>一、打赏资格</h4>
<p>您确认并保证:<strong>您已年满18周岁</strong>,或您虽未满18周岁但已获得法定监护人明确同意。若您不符合上述条件,请勿进行打赏。</p>
</div>
<div class="agreement-section">
<h4>二、打赏性质</h4>
<p>打赏是您对项目作者的自愿赠与,不代表购买任何商品或服务。作者不因打赏而承担任何法外义务。</p>
</div>
<div class="agreement-section">
<h4>三、退款处理</h4>
<p>如打赏行为违反相关法律法规或未经监护人同意,作者承诺<strong>在收到有效退款请求后30日内</strong>全额退还。退款需提供支付凭证及必要身份证明。</p>
</div>
<div class="agreement-section">
<h4>四、责任限制</h4>
<p>作者仅承担退还已收款项的责任。对任何间接损失(包括但不限于手续费、诉讼费等)不承担责任。</p>
</div>
<div class="agreement-section">
<h4>五、法律适用</h4>
<p>本协议适用中华人民共和国法律。</p>
</div>
<div class="agreement-footer-notice">
<i class="fas fa-exclamation-circle"></i>
点击"我同意"即代表您已阅读、理解并接受本协议。
</div>
</div>
<div class="agreement-buttons">
<button class="agreement-btn disagree" id="agreementDisagree">
<i class="fas fa-times"></i> 不同意
</button>
<button class="agreement-btn agree" id="agreementAgree">
<i class="fas fa-check"></i> 我同意
</button>
</div>
</div>
</div>
<!-- 关于作者弹窗 -->
<div class="author-overlay" id="authorOverlay">
<div class="author-modal">
<div class="author-header">
<i class="fas fa-user-astronaut"></i>
<span>关于作者</span>
<button class="close-author" id="closeAuthorBtn">×</button>
</div>
<div class="author-body">
<p>我叫谢子涵,今年10岁。</p>
<p>平时喜欢研究手机系统底层,比如 /system、/data、/dev 这些分区,也折腾过 SELinux。研究过很多安卓底层的东西,把整个手机几乎摸透了。</p>
<p>两年前开始自学编程,学过 Python、C++,后来学了 HTML,然后写了这个五子棋 AI。</p>
<p>做这个项目的时候,经常一个人对着屏幕改 bug,有时候手机刷死了再救回来,反反复复。最后能把一个完整的东西做出来,自己心里还是挺高兴的。</p>
<p>谢谢你看完。</p>
</div>
</div>
</div>
<div class="container">
<div class="bg-pattern"></div>
<div class="hell-fire"></div>
<!-- 右上角原有声音按钮旁边新增关于作者按钮 -->
<div class="sound-toggle" id="soundToggle">
<i class="fas fa-volume-up"></i>
</div>
<button class="author-btn" id="authorBtn">
<i class="fas fa-user-astronaut"></i> 关于作者
</button>
<header>
<h1><i class="fas fa-chess-board"></i> 五子棋挑战Ultra</h1>
<div class="subtitle">万层地狱 · 人类极限的考验</div>
<div style="margin-top: 10px; font-size: 0.9rem; color: #ffcc00;">
<div>
GitHub仓库:
<a href="https://github.com/kevin2014123/gomoku-ai" target="_blank" style="color: #ffcc00; text-decoration: underline;">
kevin2014123/gomoku-ai
</a>
⭐ 如果觉得AI厉害,点个去GitHub仓库Star支持一下,只要5秒!谢谢💗
</div>
<div>许可证: <a href="https://www.gnu.org/licenses/gpl-3.0.txt" target="_blank" style="color: #ffcc00; text-decoration: underline;">GNU General Public License v3.0</a></div>
</div>
</header>
<!-- ⭐ GitHub Star 横幅 + 点击提示 ⭐ -->
<div style="width:100%; display:flex; flex-direction:column; align-items:center; margin: 10px 0 20px 0;">
<a href="https://github.com/kevin2014123/gomoku-ai" target="_blank" title="点击给项目加个 Star 支持一下!">
<img src="https://dummyimage.com/728x90/2c3e50/ffffff&text=Star+on+GitHub"
alt="GitHub Star Banner"
style="width:100%; max-width:728px; border-radius:12px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); cursor: pointer;">
</a>
<p style="color:#ffcc00; font-size:1rem; margin-top:8px; text-shadow:0 0 5px #ff6600; animation: subtitleGlow 2s infinite alternate; font-weight: bold;">
👆 点击上方横幅,给项目点个 ⭐ Star 支持一下!谢谢 💗
</p>
</div>
<div class="game-wrapper">
<div class="board-container">
<div class="player-turn-indicator" id="turnIndicator">黑方回合</div>
<div class="undo-counter" id="undoCounterDisplay">
<i class="fas fa-undo-alt"></i> 悔棋次数: <span id="undoCountValue">0</span>
</div>
<div class="board" id="board"></div>
</div>
<div class="panel">
<div class="mode-selection">
<div class="section-title">
<i class="fas fa-robot"></i> 游戏模式
</div>
<div class="mode-buttons">
<button class="mode-btn active" id="aiMode">
<i class="fas fa-robot"></i>
<span>AI 对战</span>
</button>
<button class="mode-btn" id="pvpMode">
<i class="fas fa-users"></i>
<span>双人对战</span>
</button>
</div>
</div>
<!-- ⭐ 新增状态显示模块 ⭐ -->
<div class="game-status-display" id="gameStatusDisplay">
<i class="fas fa-info-circle"></i>
<span id="gameStatusText">未开始</span>
</div>
<div class="ai-difficulty" id="aiDifficultyPanel">
<div class="section-title">
<i class="fas fa-brain"></i> AI 难度
</div>
<div class="difficulty-buttons">
<button class="difficulty-btn" data-difficulty="easy" style="display: none;">简单</button>
<button class="difficulty-btn" data-difficulty="medium" style="display: none;">中等</button>
<button class="difficulty-btn hard" data-difficulty="hard" style="display: none;">困难</button>
<button class="difficulty-btn ultimatehell active" data-difficulty="ultimatehell">万层地狱</button>
</div>
<div class="ultimatehell-warning" id="ultimatehellWarning">
<i class="fas fa-radiation"></i> 万层地狱:人类无法触及的难度,挑战需谨慎!
</div>
<div class="difficulty-info">
<p><strong>难度说明:</strong></p>
<ul style="text-align: left; padding-left: 20px; margin-top: 5px;">
<li><b>万层地狱</b>:预判对手+深度思考,玩家胜率低于0.1%</li>
</ul>
</div>
<div class="model-selection" id="modelSelection">
<div class="section-title">
<i class="fas fa-cogs"></i> AI模型
</div>
<div class="model-buttons">
<button class="model-btn active" data-model="normal">正常版</button>
<button class="model-btn fullpower" data-model="fullpower">满血版</button>
</div>
<div class="difficulty-info">
<p><strong>满血版特点:</strong></p>
<ul style="text-align: left; padding-left: 20px; margin-top: 5px;">
<li>深度搜索增强至14层</li>
<li>威胁检测系统升级</li>
<li>胜率低于0.01%</li>
<li>预判玩家未来3步走法</li>
</ul>
</div>
</div>
</div>
<div class="game-info">
<div class="status" id="status">
<i class="fas fa-chess"></i>
<span>黑方回合</span>
</div>
<div class="player-info">
<div class="player">
<div class="player-icon black-icon active" id="playerBlack">●</div>
<div class="player-name">玩家</div>
<div class="player-score" id="playerScore">0</div>
</div>
<div class="player">
<div class="player-icon red-icon" id="playerRed">●</div>
<div class="player-name">AI</div>
<div class="player-score" id="aiScore">0</div>
</div>
</div>
<div class="controls">
<button class="control-btn" id="undoBtn">
<i class="fas fa-undo"></i>
<span>悔棋</span>
</button>
<button class="control-btn reset" id="restartBtn">
<i class="fas fa-redo"></i>
<span>重新开始</span>
</button>
</div>
<div class="stats">
<div class="stats-grid">
<div class="stat-item">
<div>游戏回合</div>
<div class="stat-value" id="moveCount">0</div>
</div>
<div class="stat-item">
<div>思考深度</div>
<div class="stat-value" id="depthCount">0</div>
</div>
<div class="stat-item">
<div>胜率预测</div>
<div class="stat-value" id="winChance">0%</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="rank-container">
<div class="rank-header">
<i class="fas fa-trophy"></i> 段位系统
</div>
<div class="current-rank">
<div class="rank-icon" id="currentRankIcon">1</div>
<div class="rank-name" id="currentRankName">初学者</div>
<div class="rank-points" id="currentRankPoints">积分: 0</div>
<div class="rank-progress">
<div class="progress-bar" id="rankProgressBar" style="width: 0%"></div>
<div class="progress-text" id="rankProgressText">0%</div>
</div>
</div>
<div class="rank-list" id="rankList"></div>
</div>
<div class="rules-container">
<div class="rules-title">
<i class="fas fa-book"></i> 段位规则说明
</div>
<div class="rules-content">
<p>本游戏采用积分段位系统,玩家通过战胜AI获得积分:</p>
<ul>
<li><b>战胜万层地狱AI</b>:获得 <span style="color:#ffcc00">200-300</span> 积分</li>
<li><b>积分永久保存</b>,可在浏览器中查看</li>
</ul>
<p style="margin-top:10px;color:#ff9900">提示:满血版胜利可获得最高300积分!</p>
</div>
</div>
<div class="version-history">
<div class="version-title">
<i class="fas fa-history"></i> 版本更新记录
</div>
<div class="version-list" id="versionList"></div>
</div>
</div>
<div class="win-message" id="winMessage">
<div class="message-content">
<h2>游戏结束</h2>
<div id="winnerDisplay" class="winner"></div>
<div id="eggMessage" class="egg-message"></div>
<button id="playAgainBtn" class="control-btn reset">
<i class="fas fa-play-circle"></i>
再来一局
</button>
<button id="viewBoardBtn" class="control-btn" style="margin-top: 15px; background: linear-gradient(to bottom, #2a56b0, #1a3a7a);">
<i class="fas fa-eye"></i>
查看棋盘
</button>
</div>
</div>
<audio id="placeSound" src="https://assets.mixkit.co/sfx/preview/mixkit-arcade-game-jump-coin-216.mp3"></audio>
<audio id="winSound" src="https://assets.mixkit.co/sfx/preview/mixkit-winning-chimes-2015.mp3"></audio>
<audio id="clickSound" src="https://assets.mixkit.co/sfx/preview/mixkit-select-click-1109.mp3"></audio>
<!-- 新增脚本:关于作者弹窗控制,不修改原有脚本逻辑 -->
<script>
// 关于作者弹窗逻辑(独立于原有script,不冲突)
(function() {
const authorBtn = document.getElementById('authorBtn');
const authorOverlay = document.getElementById('authorOverlay');
const closeAuthorBtn = document.getElementById('closeAuthorBtn');
function openAuthorModal() {
if (authorOverlay) {
authorOverlay.classList.add('show');
// 播放点击声音(如果存在且需要)
const clickSound = document.getElementById('clickSound');
if (clickSound && typeof clickSound.play === 'function') {
clickSound.currentTime = 0;
clickSound.play().catch(() => {});
}
}
}
function closeAuthorModal() {
if (authorOverlay) {
authorOverlay.classList.remove('show');
}
}
if (authorBtn) {
authorBtn.addEventListener('click', openAuthorModal);
}
if (closeAuthorBtn) {
closeAuthorBtn.addEventListener('click', closeAuthorModal);
}
if (authorOverlay) {
authorOverlay.addEventListener('click', function(e) {
if (e.target === authorOverlay) {
closeAuthorModal();
}
});
}
})();
</script>
<!-- 补充作者弹窗的样式(不修改原有style.css,仅添加内联样式保证可见) -->
<style>
/* 关于作者按钮样式 */
.author-btn {
position: absolute;
top: 20px;
right: 70px;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 69, 0, 0.3);
border-radius: 40px;
padding: 8px 16px;
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
color: #ffcc00;
font-size: 0.9rem;
backdrop-filter: blur(4px);
transition: all 0.2s;
z-index: 10;
font-weight: bold;
}
.author-btn:hover {
background: rgba(255, 69, 0, 0.2);
transform: scale(1.02);
}
.author-btn i {
font-size: 1rem;
}
/* 作者弹窗覆盖层 */
.author-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(8px);
display: flex;
justify-content: center;
align-items: center;
z-index: 10001;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
}
.author-overlay.show {
opacity: 1;
pointer-events: all;
}
.author-modal {
background: linear-gradient(135deg, #1a1a2e, #16213e);
border-radius: 24px;
max-width: 550px;
width: 90%;
padding: 30px;
border: 2px solid #ff4500;
box-shadow: 0 0 30px rgba(255, 69, 0, 0.5);
position: relative;
animation: modalFadeIn 0.3s ease-out;
}
@keyframes modalFadeIn {
from { transform: scale(0.9); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
.author-header {
display: flex;
align-items: center;
gap: 12px;
font-size: 1.8rem;
color: #ffcc00;
margin-bottom: 20px;
border-bottom: 1px solid rgba(255, 69, 0, 0.3);
padding-bottom: 15px;
position: relative;
}
.author-header i {
font-size: 2rem;
}
.close-author {
position: absolute;
right: 0;
top: 0;
background: none;
border: none;
font-size: 2rem;
color: #ffcc00;
cursor: pointer;
line-height: 1;
padding: 0 8px;
transition: transform 0.2s;
}
.close-author:hover {
transform: scale(1.1);
color: #ff4500;
}
.author-body {
color: #ddd;
font-size: 1rem;
line-height: 1.7;
text-align: left;
}
.author-body p {
margin-bottom: 16px;
}
@media (max-width: 600px) {
.author-btn {
top: 15px;
right: 65px;
padding: 6px 12px;
font-size: 0.8rem;
}
.author-modal {
padding: 20px;
}
.author-header {
font-size: 1.4rem;
}
.author-body {
font-size: 0.9rem;
}
}
/* 确保原有声音按钮位置不被遮挡 */
.sound-toggle {
right: 20px;
}
</style>
<script src="script.js"></script>
</body>
</html>