From 4d9236b46f6aac3aa54042ca4095a8f938852913 Mon Sep 17 00:00:00 2001 From: zhangds Date: Mon, 25 Mar 2024 19:57:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=A4=AE=E8=A7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs.js | 2 +- packkey/style.css | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs.js b/libs.js index 3d8ebec..81f83f2 100644 --- a/libs.js +++ b/libs.js @@ -46,7 +46,7 @@ const getQueryString = (name) => { * @returns */ const pageOutTime = (timestamp) => { - if (timestamp) { + if (timestamp || timestamp === "0") { const now = new Date().getTime(); // 获取当前时间的时间戳 let diff = Number(timestamp) - now; // 计算差异(以毫秒为单位) diff --git a/packkey/style.css b/packkey/style.css index dbf3fe2..1ba381e 100644 --- a/packkey/style.css +++ b/packkey/style.css @@ -129,11 +129,14 @@ a { .countdown { position: absolute; - top: 2.4%; - left: 7%; + top: 50%; + left: 50%; display: flex; align-items: center; color: #fff; + z-index: 999; + /* 使用transform属性进行微调,确保完全居中 */ + transform: translate(-50%, -50%); } .countdown p {