-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
293 lines (271 loc) · 14.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>快速直达</title>
<!-- 使用本地 icon.png 文件作为页面图标 -->
<link rel="icon" href="icon.png" type="image/png">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 100%;
height: 100%;
overflow: hidden; /* 禁止页面滚动 */
}
body {
display: flex;
flex-direction: column;
align-items: center;
font-family: Arial, sans-serif;
background-color: #f4f4f9;
justify-content: flex-start;
padding-top: 251px; /* 桌面端偏上的距离 */
}
/* 媒体查询,适用于手机端 */
@media (max-width: 768px) {
body {
padding-top: 275px; /* 手机端偏上的距离,可以根据实际情况调整 */
}
}
.title {
font-size: 24px;
font-weight: bold;
color: #333;
margin-bottom: 20px;
}
.search-container {
display: flex;
width: 90%;
max-width: 500px;
background: #fff;
border-radius: 50px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
overflow: hidden;
margin-bottom: 20px; /* 给搜索框和标题之间增加间距 */
}
input[type="text"] {
flex: 1;
padding: 15px 20px;
font-size: 18px;
border: none;
outline: none;
}
button {
padding: 0 20px;
font-size: 18px;
color: #fff;
background: #007BFF;
border: none;
cursor: pointer;
outline: none;
transition: background 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
button:hover {
background: #0056b3;
}
.options-container {
margin-top: 20px;
display: none;
flex-direction: column;
gap: 10px;
}
.options-container button {
padding: 10px 20px;
font-size: 16px;
background: #007BFF;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s ease;
}
.options-container button:hover {
background: #0056b3;
}
</style>
</head>
<body>
<div class="title">快速直达</div>
<div class="search-container">
<input type="text" id="searchInput" placeholder="输入指定字符">
</div>
<div id="options" class="options-container"></div>
<script>
// 定义关键词和对应网站的映射
const mapping = {
"weixinplay": ["http://play.google.com/store/apps/details?id=com.tencent.mm#:~:text=%E6%9B%B4%E6%96%B0%E6%97%A5%E6%9C%9F"],
"weixinkuan": ["https://www.coolapk.com/apk/com.tencent.mm"],
"viakuan": ["https://www.coolapk.com/apk/mark.via"],
"chenzhongjiangkuan": ["http://www.coolapk.com/u/630380"],
"chenzhongjiangbilibili": ["https://space.bilibili.com/251013709/video"],
"kuan": ["https://www.coolapk.com/apk/com.coolapk.market"],
"kuanxiaobian": ["http://www.coolapk.com/u/12202"],
"wuminglangbei": ["http://www.coolapk.com/u/470134"],
"juhesousuo": ["https://sousuo123.com/"],
"dingzhibanapp": ["https://gitee.com/ww3w/dzb/blob/master/dzb.md"],
"banbenguaidian": ["https://gitee.com/ww3w/dzb/blob/master/bbk.md"],
"iosapp": ["https://qianling.pw/ios-app/"],
"laodoujia": ["https://oldpods.mysxl.cn/"],
"gugebanben": ["https://pan.lanzoui.com/b0cxoc3mh"],
"axutongxue": ["https://data.newrank.cn/m/s.html?s=OyowODQ2KTxLQA"],
"axutongxuechuwujian": ["https://axutongxue.net/"],
"businiao": ["https://iui.su/"],
"4414": ["https://www.4414.cn/"],
"zhujiluntan": ["https://hostloc.com/forum-45-1.html"],
"chongbuluo": ["https://www.chongbuluo.com/"],
"mtluntan": ["https://bbs.binmt.cc/forum.php"],
"lzhan": ["https://linux.do/"],
"qqyinyuemeizuban": ["https://i3.mzres.com/resources/appStore/browser/views/browser-detail.html?packageName=com.meizu.media.music&app_id=1619000&versionCode=9006002&business=20"],
"youkujingdianban": ["https://appgallery.huawei.com/#/app/C10360236"],
"zhanneisousuo": ["https://www.google.com/search?hl=zh-CN&safe=off&num=30&as_qdr=d7&q=%20%22%E5%AE%9A%E5%88%B6%E7%89%88%22%20|%20%22%E6%8F%90%E5%8F%96%E8%87%AA%22%20|%20%22%E6%8F%90%E5%8F%96%E7%89%88%22%20-forum%20-page%20(site:zntx.cc%20|%20site:52pojie.cn%20|%20site:423down.com)"],
"yizhouzixun": ["https://www.google.com/search?hl=zh-CN&safe=off&num=30&as_qdr=d7&q=%22Android%22%20%7C%20%22%E5%AE%89%E5%8D%93%22%20%7C%20%22IOS%22%20-page%20-search%20-mobile%20-tag%20-issue%20-tutorials%20-tech%20-os%20(site:ruancan.com%20|%20site:landiannews.com%20|%20site:solidot.org)"],
"weixingengxinrizhi": ["https://weixin.qq.com/updates"],
"weixinxiaochengxu": ["https://developers.weixin.qq.com/miniprogram/dev/framework/client-lib/version.html"],
"fuliba": ["https://fuliba2023.net/"],
"xinwenshiyanshi": ["https://newsletter.newslab.info/"],
"dawuxiansheng": ["https://zhiyou.smzdm.com/member/4818555877/?tab=yuanchuang"],
"zhiweishijian": ["https://ef.zhiweidata.com/app3/dist/"],
"paichusuodajijin": ["http://www.coolapk.com/u/669533"],
"benpaozhongdenailao": ["https://www.runningcheese.com/chrome"],
"xiaolinshuo": ["https://www.youtube.com/@xiao_lin_shuo/videos"],
"xiaodaodalangchui": ["https://www.youtube.com/@xiaodaodalang/videos"],
"wangzhian": ["https://www.youtube.com/@wangzhian/videos"],
"shengdongzaokafei": ["https://podcasts.apple.com/cn/podcast/%E5%A3%B0%E5%8A%A8%E6%97%A9%E5%92%96%E5%95%A1/id1573189055"],
"kejiluandun": ["https://podcasts.apple.com/cn/podcast/%E7%A7%91%E6%8A%80%E4%B9%B1%E7%82%96/id1492740686"],
"luanfanshu": ["https://podcasts.apple.com/cn/podcast/%E4%B9%B1%E7%BF%BB%E4%B9%A6/id1591595410"],
"zishiluntan": ["https://bbs.zsxwz.com/"],
"TIMAPP": ["https://tim.qq.com/download.html"],
"QQPlay": ["javascript:(function()%7B%0A%20%20const%20lastUpdateDate%20%3D%20new%20Date('2020-12-25')%3B%0A%20%20const%20currentDate%20%3D%20new%20Date()%3B%0A%20%20const%20diffTime%20%3D%20Math.abs(currentDate%20-%20lastUpdateDate)%3B%0A%20%20const%20diffDays%20%3D%20Math.ceil(diffTime%20/%20(1000%20*%2060%20*%2060%20*%2024))%3B%0A%20%20const%20message%20%3D%20%60谷歌版本上次更新距今已有「%24%7BdiffDays%7D」天了%60%3B%0A%20%20alert(message)%3B%0A%7D)()"],
"zhiweireci": ["https://trends.zhiweidata.com/"],
"saraba1st": ["https://www.saraba1st.com/2b/forum-51-1.html"],
"NGA": ["https://bbs.nga.cn/thread.php?fid=436&rand=924"],
"V2EX": ["https://www.v2ex.com/go/android"],
"daojishi": ["javascript:tdy6Nb5=new%20Date();w2RtxZ=tdy6Nb5.getYear();tG82Nu=(w2RtxZ<2000)?w2RtxZ+1900:w2RtxZ;YbU7v3w=%27December%2031,%27+tG82Nu;var%20eY2FH9t=new%20Date(YbU7v3w);alert(%27今年只剩下「%20%27+Math.round((eY2FH9t.getTime()-tdy6Nb5.getTime())/86400000)+%27%20」天了!加油!%27)"],
"xiaozhongluntan": ["https://meta.appinn.net/tag/android"],
"xiaodaichendu": ["https://space.bilibili.com/1556651916/video"],
"shuiqianxiaoxi": ["https://space.bilibili.com/316568752/video"],
"baike": ["https://cse.google.com/cse?cx=d67d52521b5214dca"],
"rebang": ["https://tophub.today/daily", "https://rebang.today/home?tab=top"]
};
// 定义扩展关键词组
const keywordGroups = {
"weixinplay": ["weixinplay", "微信谷歌", "谷歌微信", "wxg", "wxp"],
"weixinkuan": ["weixinkuan", "微信酷安", "wxk", "wxka"],
"viakuan": ["viakuan", "viaka", "viak"],
"chenzhongjiangkuan": ["chenzhongjiangkuan", "czjk", "czjka", "晨钟酱k"],
"chenzhongjiangbilibili": ["chenzhongjiangbilibili", "czjb", "czjbz", "晨钟酱b", "晨钟酱"],
"kuan": ["kuan", "kuan", "酷安", "ka"],
"kuanxiaobian": ["kuanxiaobian", "kaxb", "酷安小编"],
"wuminglangbei": ["wuminglangbei", "wmlb", "无名狼辈"],
"juhesousuo": ["juhesousuo", "jhss", "聚合搜索", "ss123"],
"dingzhibanapp": ["dingzhibanapp", "dzb", "定制版"],
"banbenguaidian": ["banbenguaidian", "bbk", "版本拐点", "拐点"],
"iosapp": ["iosapp", "ios", "ios旧版", "ios版本"],
"laodoujia": ["laodoujia", "laodoujia", "老豆荚", "ldj"],
"gugebanben": ["gugebanben", "ggbb", "hj", "谷歌版本"],
"axutongxue": ["axutongxue", "axtx", "阿虚同学", "阿虚公众号"],
"axutongxuechuwujian": ["axutongxuechuwujian", "cwj", "储物间", "阿虚储物间"],
"businiao": ["businiao", "bsn", "不死鸟"],
"4414": ["4414", "4414z", "站长"],
"zhujiluntan": ["zhujiluntan", "主机论坛", "zjlt", "zj", "hz"],
"chongbuluo": ["chongbuluo", "虫部落", "cbl"],
"mtluntan": ["mtluntan", "mt", "mz", "mtlt", "MT论坛", "mt论坛"],
"lzhan": ["lzhan", "lz", "L站", "l站", "Lzhan"],
"qqyinyuemeizuban": ["qqyinyuemeizuban", "qq音乐魅族版", "魅族版", "qqyymzb", "qqyy", "mzb"],
"youkujingdianban": ["youkujingdianban", "优酷经典版", "经典版", "jdb", "ykjdb"],
"zhanneisousuo": ["zhanneisousuo", "znss", "站内搜索"],
"yizhouzixun": ["yizhouzixun", "yzzx", "一周资讯"],
"weixingengxinrizhi": ["weixingengxinrizhi", "wxgxrz", "wxgx", "gxrz", "微信更新日志"],
"weixinxiaochengxu": ["weixinxiaochengxu", "微信小程序", "wxxcx", "xcx", "小程序"],
"fuliba": ["fuliba", "flb", "福利吧"],
"xinwenshiyanshi": ["xinwenshiyanshi", "新闻实验室", "xwsys", "方可成", "fkc"],
"dawuxiansheng": ["dawuxiansheng", "dwxs", "大巫先生"],
"zhiweishijian": ["zhiweishijian", "zwsj", "zhiwei", "知微事见", "知微"],
"paichusuodajijin": ["paichusuodajijin", "pcs", "pcsdjj"],
"benpaozhongdenailao": ["benpaozhongdenailao", "奔跑中的奶酪", "nl", "nailao", "chrome"],
"xiaolinshuo": ["xiaolinshuo", "小林说", "xls", "小lin说"],
"xiaodaodalangchui": ["xiaodaodalangchui", "小岛大浪吹", "xiaodao", "xddlc", "xddl"],
"wangzhian": ["wangzhian", "wza", "王志安"],
"shengdongzaokafei": ["shengdongzaokafei", "zkf", "sdzkf", "声动早咖啡", "早咖啡"],
"kejiluandun": ["kejiluandun", "kjld", "科技乱炖", "luandun", "jjld"],
"luanfanshu": ["luanfanshu", "lfs", "乱翻书", "lfsbk", "乱翻书播客"],
"zishiluntan": ["zishiluntan", "zslt", "姿势论坛", "zishi", "姿势"],
"TIMAPP": ["TIMAPP", "TIM", "tim", "qqjjb"],
"QQPlay": ["QQPlay", "qq", "QQ", "qp"],
"zhiweireci": ["zhiweireci", "zwrc", "rc", "知微热词", "热词"],
"saraba1st": ["saraba1st", "s1", "szhan", "sz", "s1lt", "s1luntan"],
"NGA": ["NGA", "nga", "nitan", "nt", "nzhan", "nz"],
"V2EX": ["V2EX", "v2", "vzhan", "vz"],
"daojishi": ["daojishi", "倒计时", "djs", "剩余多少天"],
"xiaozhongluntan": ["xiaozhongluntan", "xzlt", "xz", "小众软件", "小众论坛"],
"xiaodaichendu": ["xiaodaichendu", "xdcd", "小黛晨读", "xd", "小黛"],
"shuiqianxiaoxi": ["shuiqianxiaoxi", "睡前消息", "马督工", "sqxx", "mdg"],
"baike": ["baike", "百科", "bk", "百科搜索", "bkss"],
"rebang": ["rebang", "热榜", "今日热榜", "jrrb", "rb"]
};
// 根据输入找到对应的主关键词
function findMainKeyword(input) {
for (const [mainKey, synonyms] of Object.entries(keywordGroups)) {
if (synonyms.includes(input.toLowerCase())) {
return mainKey;
}
}
return null;
}
// 跳转逻辑
function redirect() {
const input = document.getElementById("searchInput").value.trim();
const mainKeyword = findMainKeyword(input);
const optionsContainer = document.getElementById("options");
if (!mainKeyword || !mapping[mainKeyword]) {
alert("无效的指定字符,请检查输入!");
optionsContainer.style.display = "none";
return;
}
const urls = mapping[mainKeyword];
if (urls.length === 1) {
// 如果只有一个网站,直接跳转
window.location.href = urls[0];
} else {
// 如果有多个网站,显示选择按钮
optionsContainer.innerHTML = ""; // 清空之前的选项
urls.forEach(url => {
const button = document.createElement("button");
button.textContent = url;
button.onclick = () => window.location.href = url;
optionsContainer.appendChild(button);
});
optionsContainer.style.display = "flex";
}
// 跳转后清空搜索框
document.getElementById("searchInput").value = '';
}
// 监听回车键事件
document.getElementById("searchInput").addEventListener("keypress", function(event) {
if (event.key === "Enter") {
redirect();
}
});
// 页面加载完成后根据设备类型自动聚焦输入框或调用输入法
document.addEventListener("DOMContentLoaded", () => {
const inputField = document.getElementById("searchInput");
const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints; // 检测是否为触摸设备
if (isTouchDevice) {
// 手机端(触摸设备)默认调用输入法
inputField.setAttribute('autofocus', true);
} else {
// 桌面端自动把光标定在搜索框里
inputField.focus();
}
});
</script>
</body>
</html>