-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathend.html
More file actions
208 lines (195 loc) · 7.27 KB
/
end.html
File metadata and controls
208 lines (195 loc) · 7.27 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
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>结算 — OI 教练模拟器</title>
<link rel="stylesheet" href="styles.css">
<style>
.ending-highlight {
color: #1976d2;
text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
.ending-animate {
animation: pulse 2s ease-in-out;
}
@keyframes pulse {
0%, 100% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.05); opacity: 0.8; }
}
#end-summary h4 {
margin: 0 0 8px 0;
color: #333;
font-size: 16px;
}
#end-summary table {
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
#end-summary table th {
background: #f5f5f5 !important;
}
.timeline-pin {
transition: transform 0.2s ease;
}
.timeline-pin:hover {
transform: scale(1.2);
}
.progress-bar {
position: relative;
overflow: hidden;
}
.progress-bar::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
animation: shimmer 2s infinite;
}
@keyframes shimmer {
0% { left: -100%; }
100% { left: 100%; }
}
</style>
<!-- Clarity tracking removed -->
<!-- Cloudflare Web Analytics loader (conditional: only load if page load time <= 2s) -->
<script>
(function(){
function injectCF(){
var s = document.createElement('script');
s.defer = true;
s.src = 'https://static.cloudflareinsights.com/beacon.min.js';
s.setAttribute('data-cf-beacon', '{"token": "cd3db41765ea4c17be0930b3f94e3c3a"}');
document.head.appendChild(s);
}
function shouldLoad(){
try{
var start = (performance.timing && performance.timing.navigationStart) || 0;
var elapsed = performance.now ? performance.now() : (Date.now() - start);
return elapsed <= 2000;
}catch(e){ return false; }
}
document.addEventListener('DOMContentLoaded', function(){ if(shouldLoad()) injectCF(); });
})();
</script>
</head>
<body>
<div class="container">
<header>
<h1>🏆 赛季结算</h1>
</header>
<div class="panel" id="end-panel">
<h3>最终结果</h3>
<div id="end-summary" class="small muted">正在加载结算数据……</div>
<div class="modal-actions" style="margin-top:16px">
<button class="btn btn-ghost" id="end-back">回到开始</button>
<button class="btn" id="end-share" style="background:#2b6cb0;color:white;">分享结果</button>
<button class="btn" id="end-playagain">再玩一次</button>
<a class="btn" id="end-help" href="help.html" target="_blank" rel="noopener">通关困难?查看攻略</a>
</div>
</div>
</div>
<script src="lib/chinese-convert.js"></script>
<script src="lib/constants.js"></script>
<script src="lib/utils.js"></script>
<script src="lib/models.js"></script>
<script src="lib/talent.js"></script>
<script src="lib/share.js"></script>
<script src="game.js"></script>
<script src="render.js"></script>
<script src="debug.js"></script>
<script>
document.getElementById('end-back').onclick = ()=>{ window.location.href = 'start.html'; };
document.getElementById('end-playagain').onclick = ()=>{
try{
// 调试弹窗:在清理前显示当前 localStorage 中相关键的值(或其存在性)和调用堆栈,帮助定位是否被误清空
const before = {
oi_coach_save_exists: localStorage.getItem('oi_coach_save') !== null,
oi_coach_ending_reason: localStorage.getItem('oi_coach_ending_reason'),
oi_coach_ending: localStorage.getItem('oi_coach_ending')
};
console.debug('About to clear localStorage keys: oi_coach_save, oi_coach_ending_reason, oi_coach_ending; current:', before);
}catch(e){ /* ignore in case alerts break automated tests */ }
// 清理所有相关的localStorage数据
localStorage.removeItem('oi_coach_save');
localStorage.removeItem('oi_coach_ending_reason');
localStorage.removeItem('oi_coach_ending');
try{ console.debug('localStorage cleanup executed for oi_coach_save and related keys'); }catch(e){}
window.location.href = 'start.html';
};
// 分享按钮事件
document.getElementById('end-share').onclick = () => {
try {
if (typeof ShareManager !== 'undefined' && ShareManager.showShareDialog) {
ShareManager.showShareDialog();
} else {
alert('分享功能加载失败,请刷新页面重试');
}
} catch (e) {
alert('分享失败:' + e.message);
console.error('Share button error:', e);
}
};
// render summary if available
if(typeof renderEndSummary === 'function') renderEndSummary();
// 检查是否需要使用繁体中文
(function(){
try{
if(window.ChineseConverter && window.ChineseConverter.shouldUseTraditionalChinese()){
// 等待DOM完全加载和渲染完成后再转换
setTimeout(function(){
window.ChineseConverter.convertPageToTraditional();
}, 300);
}
}catch(e){
console.error('繁体中文转换失败:', e);
}
})();
</script>
<footer style="text-align:center;padding:12px 8px;color:#666;font-size:13px;border-top:1px solid #eee;margin-top:18px">
作者 @Dreamers-seve · 洛谷: <a href="https://www.luogu.com.cn/user/668972" target="_blank" rel="noopener">https://www.luogu.com.cn/user/668972</a> · GitHub: <a href="https://github.com/seve42/OItrainer" target="_blank" rel="noopener">https://github.com/seve42/OItrainer</a>
</footer>
<!-- footer winter plan insertion (centered & styled) -->
<script>
(function(){
try{
var cutoff = new Date('2026-03-01T00:00:00Z');
var now = new Date();
if(now >= cutoff) return;
var footer = document.querySelector('footer');
var linkHtml = '<a href="https://www.luogu.me/article/n4gmkam0" target="_blank" rel="noopener" style="color:#1976d2;text-decoration:none;font-weight:600;padding:6px 10px;border-radius:6px">冬日绘板计划</a>';
var container;
if(footer){
container = footer.querySelector('#winter-plan');
if(!container){
container = document.createElement('div');
container.id = 'winter-plan';
container.style.marginTop = '8px';
container.style.fontSize = '13px';
container.style.color = '#1976d2';
container.style.textAlign = 'center';
footer.appendChild(container);
}
} else {
container = document.getElementById('winter-plan');
if(!container){
container = document.createElement('div');
container.id = 'winter-plan';
container.style.position = 'fixed';
container.style.left = '0';
container.style.right = '0';
container.style.bottom = '8px';
container.style.textAlign = 'center';
container.style.fontSize = '13px';
container.style.zIndex = '9999';
document.body.appendChild(container);
}
}
container.innerHTML = linkHtml;
}catch(e){}
})();
</script>
</body>
</html>