aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/site/themes/coming-soon/static/js/script.js
diff options
context:
space:
mode:
author白咕咕 <67865300+baimianxiao@users.noreply.github.com>2023-11-07 01:28:02 +0800
committerGitHub <noreply@github.com>2023-11-07 01:28:02 +0800
commit477ea421a6ecd12645dd25b4d14fd1d67085f08f (patch)
treea81b072e65a0b7484b67c159f425b0c4c9834dfb /site/themes/coming-soon/static/js/script.js
parentf3bea281fbe19f5c8b4fae94b8832eee3ccfcf70 (diff)
downloadHydroRoll-477ea421a6ecd12645dd25b4d14fd1d67085f08f.tar.gz
HydroRoll-477ea421a6ecd12645dd25b4d14fd1d67085f08f.zip
倒计时组件 (#72)
* 部署官网框架 * 部署官网框架 * 部署官网框架 * 修改标题 * 初步完成左侧倒计时组件 * favicon --------- Co-authored-by: 白咕咕 <baiguguos@gmail.com>
Diffstat (limited to 'site/themes/coming-soon/static/js/script.js')
-rw-r--r--site/themes/coming-soon/static/js/script.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/site/themes/coming-soon/static/js/script.js b/site/themes/coming-soon/static/js/script.js
deleted file mode 100644
index f41ff4b..0000000
--- a/site/themes/coming-soon/static/js/script.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Get the release date from the data attribute
-var releaseDateStr = document.getElementById("countdown").getAttribute("data-release");
-
-// Create a JavaScript Date object using the release date string
-var countDownDate = new Date(releaseDateStr);
-
-// Update the count down every 1 second
-var x = setInterval(function() {
-
- // Get todays date and time
- var now = new Date().getTime();
-
- // Find the distance between now an the count down date
- var distance = countDownDate - now;
-
- // Time calculations for days, hours, minutes and seconds
- var days = Math.floor(distance / (1000 * 60 * 60 * 24));
- var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
- var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
- var seconds = Math.floor((distance % (1000 * 60)) / 1000);
-
- // Display the result in an element with id="demo"
- document.getElementById("demo").innerHTML = days + "天 " + hours + "小时 "
- + minutes + "分 " + seconds + "秒 ";
-
- // If the count down is finished, write some text
- if (distance < 0) {
- clearInterval(x);
- document.getElementById("demo").innerHTML = "EXPIRED";
- }
-}, 1000); \ No newline at end of file