Skip to content

Commit d781cfb

Browse files
authored
添加崩溃日志分析群页面强制弹窗公告 (#229)
1 parent c123b2d commit d781cfb

4 files changed

Lines changed: 107 additions & 3 deletions

File tree

_docs/crash-support-group.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: "加入 HMCL 报错崩溃交流群"
3+
permalink: /crash-support-group.html
4+
date: 2024-03-05 17:00:00 +0800
5+
categories: 启动器
6+
toc: true
7+
---
8+
9+
![Hits](https://hits.zkitefly.eu.org/?tag=https%3A%2F%2Fdocs.hmcl.net%2Fgroups.html)
10+
11+
> 本文由 zkitefly 编写
12+
13+
![](/assets/img/docs/groups/crash.png)
14+
15+
如果你遇到了游戏非正常退出问题,欢迎加入报错崩溃交流群咨询解决方案:[Minecraft 报错崩溃交流群 (666546887)](https://qm.qq.com/q/nG0Ti1kJri)
16+
17+
**本群仅处理游戏报错崩溃问题,无关话题请前往其他群聊讨论。**
18+
19+
由于加群人数过多,我们会移出问题已解决的用户。如果你在被移出后遇到了新的问题需要求助,你可以再次加群。
20+
21+
<script>
22+
document.addEventListener('DOMContentLoaded', function() {
23+
const modal = document.createElement('div');
24+
modal.style.cssText = `
25+
position: fixed;
26+
top: 0;
27+
left: 0;
28+
width: 100%;
29+
height: 100%;
30+
background: rgba(0, 0, 0, 0.5);
31+
display: flex;
32+
justify-content: center;
33+
align-items: center;
34+
z-index: 9999;
35+
`;
36+
37+
const modalContent = document.createElement('div');
38+
modalContent.style.cssText = `
39+
background: white;
40+
padding: 20px;
41+
border-radius: 8px;
42+
max-width: 500px;
43+
width: 90%;
44+
`;
45+
46+
let timeLeft = 30 ; // 倒计时秒数
47+
const closeButton = document.createElement('button');
48+
closeButton.textContent = '我已了解';
49+
closeButton.style.cssText = `
50+
display: block;
51+
margin: 15px auto 0;
52+
padding: 8px 20px;
53+
background: #007bff;
54+
color: white;
55+
border: none;
56+
border-radius: 4px;
57+
cursor: not-allowed;
58+
opacity: 0.6;
59+
`;
60+
closeButton.disabled = true;
61+
62+
modalContent.innerHTML = `
63+
<h1>⚠️加入群聊前请注意⚠️</h2>
64+
<ul>
65+
<li>游戏非正常退出时,请点击左下角 <img src="/assets/img/docs/groups/button-1.png" style="display: inline; height: 1.5em; vertical-align: middle;" title="导出游戏崩溃日志"> 按钮(不是 <img src="/assets/img/docs/groups/button-2.png" style="display: inline; height: 1.5em; vertical-align: middle;" title="日志"> 按钮),并完整发送生成的报错压缩包</li>
66+
<li>遇到其他问题时,请详细说明情况并提供相关截图,以便我们提供帮助</li>
67+
<li>使用整合包时,请说明具体的整合包名称与版本</li>
68+
<li>请保持耐心,群管理和群友会协助解决问题。严禁辱骂、催促他人</li>
69+
<li>禁止讨论政治、色情、违法、金钱交易等敏感内容,禁止人身攻击、造谣诽谤等行为</li>
70+
<li>禁止刷屏、灌水、挑起争端、发泄情绪等影响群聊秩序的行为</li>
71+
<li>禁止使用第三方插件发送特殊消息;禁止讨论多人游戏作弊工具</li>
72+
<li>本群仅支持 HMCL 启动器相关问题。PCL 启动器用户请加入 978054335 群</li>
73+
<li>请勿重复发送文件,如需重新获取关注,请引用之前发送的消息</li>
74+
<li>因人数限制,已解决问题的用户会被移出群聊。如遇新问题可再次加入</li>
75+
<li>本群仅处理游戏崩溃相关问题,其他话题请到其他群讨论</li>
76+
</ul>
77+
<p style="text-align: center; margin-top: 15px;">
78+
请等待 <span id="countdown">${timeLeft}</span> 秒,请认真阅读注意事项
79+
</p>
80+
`;
81+
82+
modalContent.appendChild(closeButton);
83+
modal.appendChild(modalContent);
84+
document.body.appendChild(modal);
85+
86+
// 倒计时功能
87+
const countdownInterval = setInterval(() => {
88+
timeLeft--;
89+
document.getElementById('countdown').textContent = timeLeft;
90+
if (timeLeft <= 0) {
91+
clearInterval(countdownInterval);
92+
document.getElementById('countdown').parentElement.textContent = '请点击下方按钮关闭';
93+
closeButton.disabled = false;
94+
closeButton.style.cursor = 'pointer';
95+
closeButton.style.opacity = '1';
96+
}
97+
}, 1000);
98+
99+
// 添加关闭按钮事件
100+
closeButton.addEventListener('click', () => {
101+
if (!closeButton.disabled) {
102+
document.body.removeChild(modal);
103+
}
104+
});
105+
});
106+
</script>

_docs/groups.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ toc: true
4141

4242
## 报错崩溃交流群
4343

44-
![](/assets/img/docs/groups/crash.png)
45-
46-
如果你遇到了游戏非正常退出问题,欢迎加入报错崩溃交流群咨询解决方案:[Minecraft 报错崩溃交流群 (666546887)](https://qm.qq.com/q/nG0Ti1kJri)
44+
如果你遇到了游戏非正常退出问题,欢迎加入报错崩溃交流群咨询解决方案:[Minecraft 报错崩溃交流群](/crash-support-group.html)
4745

4846
**本群仅处理游戏报错崩溃问题,无关话题请前往其他群聊讨论。**
4947

4.32 KB
Loading
1.22 KB
Loading

0 commit comments

Comments
 (0)