From 0c63e8b25f4c95065dbf76be261ce5723ff244f0 Mon Sep 17 00:00:00 2001 From: FW27623 <1970446279@qq.com> Date: Sun, 27 Aug 2023 03:46:04 +0800 Subject: [PATCH 1/8] Add files via upload --- index.html | 144 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 104 insertions(+), 40 deletions(-) diff --git a/index.html b/index.html index ddd177d2..9bce8ae1 100644 --- a/index.html +++ b/index.html @@ -1,41 +1,105 @@ - - - - - - 李跳跳规则 - - - - - -

如果发现提示“复制成功”却失败了,说明没有权限写入,需要自己长按输入框全选复制

-

- 规则原项目地址: - - Snoopy1866/LiTiaotiao-Custom-Rules - -

- - + + + + + + LiTiaotiao-Custom-Rules + + + +
+

LiTiaotiao-Custom-Rules

+
+ + +
+

+ + +

+
+ + + + \ No newline at end of file From 674d08fee5ba65cd29782020a0d2200562cc7f53 Mon Sep 17 00:00:00 2001 From: FW27623 <1970446279@qq.com> Date: Sun, 27 Aug 2023 03:51:40 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0json=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 9bce8ae1..c5e5444a 100644 --- a/index.html +++ b/index.html @@ -66,8 +66,8 @@

LiTiaotiao-Custom-Rules

From a01b09f3b5ec10217ea37cc4b9aa1fc9ce0d37c7 Mon Sep 17 00:00:00 2001 From: FW27623 <1970446279@qq.com> Date: Sat, 2 Sep 2023 13:34:36 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=81=9C=E6=AD=A2=E4=BD=BF=E7=94=A8ghproxy?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E7=94=A8jsdelivr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 91759c08..4e1d1f5c 100644 --- a/index.html +++ b/index.html @@ -66,8 +66,8 @@

李跳跳自定义规则

+ diff --git a/js/script.js b/js/script.js new file mode 100644 index 00000000..231d291a --- /dev/null +++ b/js/script.js @@ -0,0 +1,61 @@ +function loadJSON(type) { + console.log(` + ███████╗██╗ ██╗██████╗ ███████╗ ██████╗ ██████╗ ██████╗ + ██╔════╝██║ ██║╚════██╗╚════██║██╔════╝ ╚════██╗╚════██╗ + █████╗ ██║ █╗ ██║ █████╔╝ ██╔╝███████╗ █████╔╝ █████╔╝ + ██╔══╝ ██║███╗██║██╔═══╝ ██╔╝ ██╔═══██╗██╔═══╝ ╚═══██╗ + ██║ ╚███╔███╔╝███████╗ ██║ ╚██████╔╝███████╗██████╔╝ + ╚═╝ ╚══╝╚══╝ ╚══════╝ ╚═╝ ╚═════╝ ╚══════╝╚═════╝ + Github:https://github.com/FW27623 + `); + var urls = { + 'basic': 'https://cdn.jsdelivr.net/gh/Snoopy1866/LiTiaotiao-Custom-Rules@latest/BasicRules.json', + 'all': 'https://cdn.jsdelivr.net/gh/Snoopy1866/LiTiaotiao-Custom-Rules@latest/AllRules.json' + }; + var url = urls[type]; + var ruleName = type === 'basic' ? '基础规则' : '全部规则'; + + var ruleType = document.getElementById('rule-type'); + ruleType.innerHTML = `当前选择的是${ruleName}`; + + var cachedData = localStorage.getItem(url); + var cacheTime = localStorage.getItem(url + '-time'); + var now = new Date().getTime(); + if (cachedData && cacheTime && (now - cacheTime < 10 * 60 * 1000)) { + var diff = Math.round((now - cacheTime) / 1000); + var size = Math.round(cachedData.length / 1024); + console.log(`从缓存中加载数据:${ruleName},已缓存时间:${diff}秒,大小:${size}KB`); + document.getElementById('json-text').value = cachedData; + } else { + console.log(`请求数据:${ruleName}`); + fetch(url) + .then(response => { + console.log(`响应状态码:${response.status}`); + return response.text(); + }) + .then(data => { + localStorage.setItem(url, data); + localStorage.setItem(url + '-time', now); + var size = Math.round(data.length / 1024); + console.log(`缓存数据:${ruleName},大小:${size}KB`); + document.getElementById('json-text').value = data; + }); + } +} + +function copyText() { + var text = document.getElementById('json-text'); + text.select(); + navigator.clipboard.writeText(text.value); + + var message = document.getElementById('copy-message'); + message.textContent = '文本已成功复制到剪贴板中!'; + + setTimeout(function() { + message.textContent = ''; + }, 8000); +} + +window.addEventListener('beforeunload', function() { + localStorage.clear(); +}); \ No newline at end of file From cb4a3f31bafe227be3f0afee957ae40987add265 Mon Sep 17 00:00:00 2001 From: FW27623 <1970446279@qq.com> Date: Sat, 2 Sep 2023 16:07:48 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E6=97=A0=E6=B3=95=E5=A4=8D=E5=88=B6=E8=A7=84=E5=88=99?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 10 ++++++++++ js/script.js | 11 +---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 4eee3492..bb58023e 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,15 @@ 李跳跳自定义规则 +
@@ -20,6 +29,7 @@

李跳跳自定义规则

+