From 5f79695cef613d3f2f3302759cf224f251aa436c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=95=E5=B1=82=E7=94=A8=E6=88=B7?= Date: Sun, 22 May 2022 13:50:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E8=A8=80=E7=82=B9=E5=87=BB=E5=8F=AF?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/cursor.css | 2 +- css/style.css | 1 + js/cursor.js | 4 ++-- js/main.js | 26 ++++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/css/cursor.css b/css/cursor.css index b791917..6d94ec7 100644 --- a/css/cursor.css +++ b/css/cursor.css @@ -5,7 +5,7 @@ background: #ffffffcc; border-radius: 8px; opacity: 0.25; - z-index: 10086; + z-index: 99999999; pointer-events: none; transition: 0.2s ease-in-out; transition-property: background, opacity, transform; diff --git a/css/style.css b/css/style.css index 0bd4b7c..87f0673 100644 --- a/css/style.css +++ b/css/style.css @@ -771,6 +771,7 @@ input[type="radio"]:checked+label { /*Aplayer*/ .box-right { flex: 0 54%; + max-width: 54%; display: flex; flex-direction: row; justify-content: center; diff --git a/js/cursor.js b/js/cursor.js index 1b347e7..0d5c55f 100644 --- a/js/cursor.js +++ b/js/cursor.js @@ -79,8 +79,8 @@ class Cursor { render() { if (this.pos.prev) { - this.pos.prev.x = Math.lerp(this.pos.prev.x, this.pos.curr.x, 0.15); - this.pos.prev.y = Math.lerp(this.pos.prev.y, this.pos.curr.y, 0.15); + this.pos.prev.x = Math.lerp(this.pos.prev.x, this.pos.curr.x, 0.45); + this.pos.prev.y = Math.lerp(this.pos.prev.y, this.pos.curr.y, 0.45); this.move(this.pos.prev.x, this.pos.prev.y); } else { this.pos.prev = this.pos.curr; diff --git a/js/main.js b/js/main.js index ca47e29..3adc31a 100644 --- a/js/main.js +++ b/js/main.js @@ -92,6 +92,32 @@ fetch('https://v1.hitokoto.cn?max_length=24') }) .catch(console.error) +var time = 0; +$('#hitokoto').click(function () { + if (time == 0) { + time = 1; + var index = setInterval(function () { + time--; + if (time == 0) { + clearInterval(index); + } + }, 1000); + fetch('https://v1.hitokoto.cn?max_length=24') + .then(response => response.json()) + .then(data => { + $('#hitokoto_text').html(data.hitokoto) + $('#from_text').html(data.from) + }) + .catch(console.error) + } else { + iziToast.show({ + timeout: 2000, + iconUrl: './img/icon/warn.png', + message: '你点太快了吧' + }); + } +}); + //获取天气 //每日限量 100 次 //请前往 https://www.tianqiapi.com/ 申请(免费)