Admin留言 | 贡献
无编辑摘要
Admin留言 | 贡献
无编辑摘要
第3行: 第3行:


// 维护开始时间戳(2025-04-05 03:00:00 UTC)
// 维护开始时间戳(2025-04-05 03:00:00 UTC)
// 维护开始时间(示例:2020-09-01 00:00:00 UTC)
const startTimestamp = 1743814800;
const startTimestamp = 1743814800;


第9行: 第11行:
     const duration = now - startTimestamp;
     const duration = now - startTimestamp;


    // 计算天、小时、分钟
     const days = Math.floor(duration / 86400);
     const days = Math.floor(duration / 86400);
     const hours = Math.floor((duration % 86400) / 3600);
     const hours = Math.floor((duration % 86400) / 3600);
     const minutes = Math.floor((duration % 3600) / 60);
     const minutes = Math.floor((duration % 3600) / 60);
    const seconds = duration % 60;


    // 更新页面显示
     const timerElement = document.getElementById("maintenance-timer");
     const timerElement = document.getElementById("maintenance-timer");
     if (timerElement) {
     if (timerElement) {
         timerElement.textContent = `距离本WIKI开始维护已过去${days}天${hours}时${minutes}分${seconds}秒`;
         timerElement.textContent =`距离本WIKI开始维护已过去${days}天${hours}时${minutes}分${seconds}秒`;
     }
     }
}
}


document.addEventListener("DOMContentLoaded", function() {
// 首次加载更新
    updateMaintenanceTimer();
updateMaintenanceTimer();
    setInterval(updateMaintenanceTimer, 1000);
// 每秒刷新
});
setInterval(updateMaintenanceTimer, 1000);