diff --git a/waifu-tips.js b/waifu-tips.js index 2d39b6d..40058ea 100755 --- a/waifu-tips.js +++ b/waifu-tips.js @@ -19,7 +19,7 @@ function loadWidget(waifuPath, apiPath) { `); - $("#waifu").show().animate({ bottom: 0 }, 3000); + $("#waifu").show().css({ bottom: 0 }); function registerEventListener() { document.querySelector("#waifu-tool .fa-comment").addEventListener("click", showHitokoto); @@ -46,10 +46,11 @@ function loadWidget(waifuPath, apiPath) { document.querySelector("#waifu-tool .fa-times").addEventListener("click", () => { localStorage.setItem("waifu-display", Date.now()); showMessage("愿你有一天能与重要的人重逢。", 2000, 11); - $("#waifu").animate({ bottom: -500 }, 3000, () => { + $("#waifu").css({ bottom: -500 }); + setTimeout(() => { $("#waifu").hide(); $("#waifu-toggle").show().animate({ "margin-left": -50 }, 1000); - }); + }, 3000); }); var devtools = () => {}; console.log("%c", devtools); @@ -235,7 +236,7 @@ function initWidget(waifuPath = "/waifu-tips.json", apiPath = "") { $("#waifu-toggle").attr("first-time", false); } else { localStorage.removeItem("waifu-display"); - $("#waifu").show().animate({ bottom: 0 }, 3000); + $("#waifu").show().css({ bottom: 0 }); } }); if (localStorage.getItem("waifu-display") && Date.now() - localStorage.getItem("waifu-display") <= 86400000) { diff --git a/waifu.css b/waifu.css index a8c7554..45b1ef1 100755 --- a/waifu.css +++ b/waifu.css @@ -18,7 +18,7 @@ line-height: 0; position: fixed; transform: translateY(3px); - transition: transform .3s ease-in-out; + transition: transform .3s ease-in-out, bottom 3s ease-in-out; z-index: 1; }