Skip to content

Commit

Permalink
Update example_acdemo.html
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhucheng committed Oct 23, 2024
1 parent 42ace39 commit 7717971
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions server/plugins/example/templates/example_acdemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,31 @@
<h1>Welcome to the Demo NHP-AC Server</h1>
<p>acdemo.opennhp.org</p>
<div><a href="https://dnschecker.org/port-scanner.php?query=acdemo.opennhp.org" target="_blank">Scan Its Ports &gt;&gt;</a></div>
<!-- 添加倒计时显示 -->
<!-- Add countdown display -->
<div id="countdown">This Server Will be Hidden after <span id="timer">15</span> seconds ...</div>
<!-- 已隐藏信息的消息 -->
<!-- Messages with hidden information -->
<div id="message">The Server Has been Hidden.</div>
</div>

<script>
// 初始化倒计时秒数
// Initialize countdown seconds
let seconds = 15;

// 获取DOM元素
// Retrieve DOM elements
const timerElement = document.getElementById('timer');
const countdownElement = document.getElementById('countdown');
const messageElement = document.getElementById('message');

// 每秒更新倒计时
// Update countdown every second
const countdownInterval = setInterval(() => {
seconds--;
timerElement.textContent = seconds;

if (seconds <= 0) {
clearInterval(countdownInterval);
// 隐藏倒计时
// Hide Countdown
countdownElement.style.display = 'none';
// 显示隐藏消息
// Show hidden messages
messageElement.style.display = 'block';
}
}, 1000);
Expand Down

0 comments on commit 7717971

Please sign in to comment.