falsefalseundefined

Cover-title-bg-icon.png


首页

Operator-title-bg-icon.png


干员

Event-title-bg-icon.png


活动

Operation-title-bg-icon.png


作战

Guide-title-bg-icon.png


攻略

全站通知:

用户:3570506

来自明日方舟WIKI_BWIKI_哔哩哔哩
丛云酱 讨论 | 贡献2020年6月2日 (二) 10:30的版本 (创建页面,内容为“ →‎--游戏通知-- if (document.getElementById("CountDownUI")) { document.getElementById("CountDownUI").innerHTML = '<input id="year" placeholder="YYYY" sty…”
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

/* --游戏通知-- */ if (document.getElementById("CountDownUI")) {

   document.getElementById("CountDownUI").innerHTML = '<input id="year" placeholder="YYYY" style="width: 80px"><input id="month" placeholder="MM" style="width: 40px"><input id="day" placeholder="DD" style="width: 40px"><input id="hour" placeholder="H" style="width: 40px">:<input id="minute" placeholder="M" style="width: 40px">:<input id="second" placeholder="S" style="width: 40px">';
   function CountDown() {
       let year = Number(document.getElementById("year").value);
       let month = Number(document.getElementById("month").value) - 1;
       let day = Number(document.getElementById("day").value);
       let hour = Number(document.getElementById("hour").value);
       let minute = Number(document.getElementById("minute").value);
       let second = Number(document.getElementById("second").value);
       let countDownDate = new Date(year, month, day, hour, minute, second).getTime();
       let now = new Date().getTime();
       let distance = countDownDate - now;
       let days = Math.floor(distance / (1000 * 60 * 60 * 24));
       let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
       let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
       let seconds = Math.floor((distance % (1000 * 60)) / 1000);
       document.getElementById("demo").innerHTML = days + "d " + hours + "h " +
           minutes + "m " + seconds + "s ";
       if (distance < 0) {
           document.getElementById("demo").innerHTML = "EXPIRED";
       }
       setTimeout("CountDown()", 200);
   }
   CountDown();

}

评论

热门评论
全部评论1
我宣布,从现在开始这里是丛云神教٩( 'ω' )و
我宣布,从现在开始这里是丛云神教٩( 'ω' )و
笑死