From aeee1b77f3ca9883b4e746101876df74f96a5af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Fri, 29 Jul 2022 20:33:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- html/assets/css/main.css | 8 ++++++++ html/assets/js/isMobile.js | 24 ++++++++++++++++++++++++ html/bilibili_hotband.html | 25 ++++++++++++++++++++++++- html/bilibili_rank.html | 4 ++++ html/weibo_hotband.html | 4 ++++ index.html | 2 +- 7 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 html/assets/js/isMobile.js diff --git a/README.md b/README.md index c50ab09..f6889b3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ 微博热搜接口:https://weibo.com/ajax/statuses/hot_band -> 该接口来自页面:https://weibo.com/newlogin?tabtype=search +> 该接口来自页面:https://weibo.com/hot/search B站热搜接口:https://app.bilibili.com/x/v2/search/trending/ranking diff --git a/html/assets/css/main.css b/html/assets/css/main.css index a2c74fd..8e2dc52 100644 --- a/html/assets/css/main.css +++ b/html/assets/css/main.css @@ -22,3 +22,11 @@ font-size: 10px; display: inline-block; } + +.bottom-placeholder { + height: 60px; + font-size:13px; + color: #999; + display: grid; + place-items: center; +} diff --git a/html/assets/js/isMobile.js b/html/assets/js/isMobile.js new file mode 100644 index 0000000..49fbeb1 --- /dev/null +++ b/html/assets/js/isMobile.js @@ -0,0 +1,24 @@ +function isMobile() { + var userAgentInfo = navigator.userAgent; + + var mobileAgents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; + + var mobile_flag = false; + + //根据userAgent判断是否是手机 + for (var v = 0; v < mobileAgents.length; v++) { + if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { + mobile_flag = true; + break; + } + } + // var screen_width = window.screen.width; + // var screen_height = window.screen.height; + + // //根据屏幕分辨率判断是否是手机 + // if (screen_width > 325 && screen_height < 750) { + // mobile_flag = true; + // } + + return mobile_flag; +} \ No newline at end of file diff --git a/html/bilibili_hotband.html b/html/bilibili_hotband.html index 364158d..e5ae67c 100644 --- a/html/bilibili_hotband.html +++ b/html/bilibili_hotband.html @@ -11,6 +11,12 @@ #list td { font-size: 14px; } + + #mobile-info { + color: grey; + font-size: 13px; + text-align: center; + } @@ -53,6 +59,16 @@
— 到底啦 —
+