Files
进击的Creeper 092a9022c3 重新上传停更版1.0.3资料
重新上传停更版1.0.3资料

Signed-off-by: 进击的Creeper <alvenma307@gmail.com>
2025-10-29 09:32:17 +08:00

43 lines
1.2 KiB
JavaScript

const days = document.getElementById('days'),
hours = document.getElementById('hours'),
minutes = document.getElementById('minutes'),
seconds = document.getElementById('seconds');
const dd = document.getElementById('dd'),
hh = document.getElementById('hh'),
mm = document.getElementById('mm'),
ss = document.getElementById('ss');
const day_dot = document.querySelector('.day_dot'),
hr_dot = document.querySelector('.hr_dot'),
min_dot = document.querySelector('.min_dot'),
sec_dot = document.querySelector('.sec_dot');
const endDate = '03/08/2026 00:00:00';
// date format mm/dd/yyyy
const x= setInterval(()=>{
const now = new Date(endDate).getTime();
const countDown = new Date().getTime();
const distance = now - countDown;
// 时间计算 for dats, hours, minutes and seconds
let d = Math.floor(distance / (1000 * 60 * 60 * 24));
let h = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let m = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let s = Math.floor((distance % (1000 * 60)) / (1000));
// output the result in element with id
days.innerHTML = d + "<br><span>Days</span>"
// animate stroke
dd.style.strokeDashoffset = 440 - (440 * d) / 365;
})