master
leishihua 2023-11-13 13:25:57 +08:00
commit 494c54e6bc
17 changed files with 989 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea
.DS_Store

201
LICENSE Normal file
View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# 只言片语 -- 静态导航主页
采用HTML+CSS+JQ开发的最简单的静态页面搭配github pages或者是coding pages食用效果最佳
JS放在keyword.js中HTML+CSS太过简单需要者自行修改即可

177
index.html Normal file
View File

@ -0,0 +1,177 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>只言片语导航 &nbsp;- 不懂就搜,一搜就懂</title>
<meta name="keywords" content="只言片语导航,不懂就搜,实用网址,主页导航,简单网址导航">
<meta name="description" content="只言片语,可寻万物!"/>
<link rel="shortcut icon" href="static/img/favicon.ico">
<link href="static/css/style.css" rel="stylesheet" type="text/css">
<!-- 百度统计代码 -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?786a6208323fbecfb41d71bfda8daca6";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body>
<div class="inner-center main">
<div class="content-inside">
<!-- slogan start -->
<div class="logo-box">
<div class="logo-left">
<img src="./static/img/logo.gif" alt="logo">
</div>
<div class="logo-right">
<span>只言片语,可寻万物</span>
</div>
</div>
<!-- slogan end -->
<!-- 搜索框 start -->
<div id="search_form" class="search-section"target="_blank">
<div class="search-left">
<div id="search_logo" data-type="google" class="search-logo"></div>
<div class="input-wrap">
<input id="search_keyword"
class="search-input"
name="keyword"
maxlength="100"
autocomplete="off"
type="text"
placeholder="不懂么?不懂就搜,给老子搜!">
<div class="clear-keyword" id="clear_keyword" title="清空">x</div>
</div>
<!-- 搜索引擎 start -->
<ul id="search_methods" class="search-methods">
<li data-type="google" class="search-item google">谷歌</li>
<li data-type="baidu" class="search-item baidu">百度</li>
<li data-type="bing" class="search-item bing">必应</li>
<li data-type="so" class="search-item so">360搜索</li>
<li data-type="sogou" class="search-item sogou">搜狗</li>
<li data-type="wangpan" class="search-item wangpan">网盘搜索</li>
</ul>
<!-- 搜索引擎 end -->
<!-- 搜索结果 start -->
<ul id="search_result" class="search-result">
<!--<li class="result-item"></li>-->
</ul>
<!-- 搜索结果 end -->
</div>
<input class="search-submit" value="寻一下" id="search_submit" type="submit">
</div>
<!-- 搜索框 end -->
<!-- 导航地址 start -->
<div class="nav-content">
<div class="jj-list">
<div class="jj-list-tit">This · Me</div>
<ul class="jj-list-con">
<li><a href="https://www.lshserver.com:3000" class="jj-list-link" target="_blank">Gitea</a></li>
<li><a href="https://www.baidu.com/" class="jj-list-link" target="_blank">百度</a></li>
<li><a href="https://cn.bing.com/" class="jj-list-link" target="_blank">Bing</a></li>
<li><a href="https://www.sogou.com/" class="jj-list-link" target="_blank">搜狗搜索</a></li>
<li><a href="https://www.so.com/" class="jj-list-link" target="_blank">360搜索</a></li>
<li><a href="https://www.toutiao.com/search/?keyword=/" class="jj-list-link" target="_blank">头条搜索</a></li>
<li><a href="https://translate.google.cn/" class="jj-list-link" target="_blank">谷歌翻译</a></li>
<li><a href="https://fanyi.baidu.com/" class="jj-list-link" target="_blank">百度翻译</a></li>
<li><a href="http://fanyi.youdao.com/" class="jj-list-link" target="_blank">有道翻译</a></li>
</ul>
</div>
<div class="jj-list">
<div class="jj-list-tit">胖 · Pang</div>
<ul class="jj-list-con">
<li><a href="https://www.zhihu.com/" class="jj-list-link" target="_blank">知乎</a></li>
<li><a href="https://web.okjike.com/feed/" class="jj-list-link" target="_blank">即刻</a></li>
<li><a href="https://www.v2ex.com/" class="jj-list-link" target="_blank">V2EX</a></li>
<li><a href="https://weibo.com/" class="jj-list-link" target="_blank">微博</a></li>
<li><a href="https://www.jianshu.com/" class="jj-list-link" target="_blank">简书</a></li>
<li><a href="https://www.douban.com/" class="jj-list-link" target="_blank">豆瓣</a></li>
<li><a href="http://www.woshipm.com/" class="jj-list-link" target="_blank">产品经理</a></li>
<li><a href="http://www.chanpin100.com/" class="jj-list-link" target="_blank">产品壹佰</a></li>
<li><a href="http://pm.budong.me/" class="jj-list-link" target="_blank">只言片语</a></li>
</ul>
</div>
<div class="jj-list">
<div class="jj-list-tit">皮 · Pi</div>
<ul class="jj-list-con">
<li><a href="https://ke.qq.com/" class="jj-list-link" target="_blank">腾讯课堂</a></li>
<li><a href="https://study.163.com/" class="jj-list-link" target="_blank">网易云课堂</a></li>
<li><a href="https://www.imooc.com/" class="jj-list-link" target="_blank">慕课网</a></li>
<li><a href="https://www.bilibili.com/" class="jj-list-link" target="_blank">哔哩哔哩</a></li>
<li><a href="https://www.iqiyi.com/" class="jj-list-link" target="_blank">爱奇艺</a></li>
<li><a href="https://v.qq.com/" class="jj-list-link" target="_blank">腾讯视频</a></li>
<li><a href="https://www.youku.com/" class="jj-list-link" target="_blank">优酷</a></li>
<li><a href="http://cpc.people.com.cn/" class="jj-list-link" target="_blank">1024</a></li>
<li><a href="http://www.zimuzu.tv/" class="jj-list-link" target="_blank">人人影视</a></li>
</ul>
</div>
<div class="jj-list">
<div class="jj-list-tit">笑 · Xiao</div>
<ul class="jj-list-con">
<li><a href="https://www.36kr.com/" class="jj-list-link" target="_blank">36氪</a></li>
<li><a href="https://www.huxiu.com/" class="jj-list-link" target="_blank">虎嗅</a></li>
<li><a href="https://www.toutiao.com/" class="jj-list-link" target="_blank">今日头条</a></li>
<li><a href="https://www.163.com/" class="jj-list-link" target="_blank">网易</a></li>
<li><a href="https://sspai.com/" class="jj-list-link" target="_blank">少数派</a></li>
<li><a href="http://ac.scmor.com/" class="jj-list-link" target="_blank">谷歌镜像</a></li>
<li><a href="http://crud.budong.me/" class="jj-list-link" target="_blank">小仙女博客</a></li>
<li><a href="https://coding.net/" class="jj-list-link" target="_blank">Coding</a></li>
<li><a href="https://www.coolist.net/" class="jj-list-link" target="_blank">酷软清单</a></li>
</ul>
</div>
<div class="jj-list">
<div class="jj-list-tit">嘻 · Xi</div>
<ul class="jj-list-con">
<li><a href="https://map.baidu.com/" class="jj-list-link" target="_blank">百度地图</a></li>
<li><a href="http://www.google.cn/maps" class="jj-list-link" target="_blank">谷歌地图</a></li>
<li><a href="https://www.amap.com/" class="jj-list-link" target="_blank">高德地图</a></li>
<li><a href="https://sm.ms/" class="jj-list-link" target="_blank">SM图床</a></li>
<li><a href="https://tool.lu/" class="jj-list-link" target="_blank">程序员工具</a></li>
<li><a href="http://www.alloyteam.com/nav/" class="jj-list-link" target="_blank">前端工具</a></li>
<li><a href="http://www.99baiduyun.com/" class="jj-list-link" target="_blank">网盘搜索</a></li>
<li><a href="https://cli.im/" class="jj-list-link" target="_blank">二维码</a></li>
<li><a href="http://www.qinms.com/webapp/barcode/index.aspx" class="jj-list-link" target="_blank">条形码</a></li>
</ul>
</div>
<div class="jj-list">
<div class="jj-list-tit">嘻 · Xi</div>
<ul class="jj-list-con">
<li><a href="http://www.dytt8.net/" class="jj-list-link" target="_blank">电影天堂</a></li>
<li><a href="https://zhuanlan.zhihu.com/p/36456284" class="jj-list-link" target="_blank">图片素材</a></li>
<li><a href="https://www.portablesoft.org/" class="jj-list-link" target="_blank">效率工具</a></li>
<li><a href="https://www.taobao.com/" class="jj-list-link" target="_blank">淘宝</a></li>
<li><a href="https://www.jd.com/" class="jj-list-link" target="_blank">京东</a></li>
<li><a href="https://www.suning.com/" class="jj-list-link" target="_blank">苏宁</a></li>
<li><a href="https://www.smzdm.com/" class="jj-list-link" target="_blank">什么值得买</a></li>
<li><a href="http://www.zealer.com/" class="jj-list-link" target="_blank">Zealer</a></li>
<li><a href="http://www.manmanbuy.com/" class="jj-list-link" target="_blank">慢慢买</a></li>
</ul>
</div>
</div>
<!-- 导航地址 end -->
</div>
</div>
<footer class="inner-center footer">
<p>
<a href="https://github.com/TopVitamin/static-nav" target="_blank"> <img src="./static/css/img/github.png" alt="" height="20" width="20"></a>
</p>
<p style="margin-top:8px;"> <a href="http://pm.budong.me/" style="color:#8C8C8C;" target="_blank">Copyright © 2019 Hosted by 只言片语</a></p>
</footer>
<script src="./static/js/jquery.min.js"></script>
<script src="./static/js/keyword.js"></script>
</body>
</html>

BIN
static/css/img/github.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
static/css/img/scbaidu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
static/css/img/scbing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/css/img/scgoogle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
static/css/img/scso.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
static/css/img/scsogou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
static/css/img/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

339
static/css/style.css Normal file
View File

@ -0,0 +1,339 @@
/* ================ reset 样式 start ================ */
* {
margin: 0;
padding: 0;
font-family: "微软雅黑";
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body, ul, li, h1, h2, h3, h4, h5, h6, p, form, dl, dt, dd {
margin: 0px;
padding: 0px;
font-size: 14px;
font-weight: normal;
}
img {
border-style: none;
}
li {
list-style: none;
}
a {
text-decoration: none
}
html, body {
background: #fff;
height: 100%;
}
input[type="button"], input[type="submit"], input[type="reset"] {
-webkit-appearance: none;
outline: 0;
}
textarea {
-webkit-appearance: none;
}
/* ================ reset 样式 end ================ */
.inner-center {
width: 1000px;
margin: 0 auto;
}
.main {
padding-top: 5%;
min-height: 100%;
}
.content-inside{
padding-bottom: 60px;
}
.footer {
height: 60px;
text-align: center;
margin-top: -60px;
/* position: relative;
margin-top: -100px;
clear:both; */
}
/* logo start */
.logo-box {
display: flex;
overflow: hidden;
margin-left: 250px;
align-items: center;
}
.logo-left {
position: relative;
width: 125px;
height: 121px;
cursor: pointer;
}
.logo-right {
padding-left: 36px;
font-size: 36px;
color: rgba(0, 39, 102, 1);
font-family: SourceHanSansSC-regular;
}
/* logo end */
/* 搜索框 start */
.search-section {
margin-top: 14px;
margin-bottom: 40px;
}
.search-section {
position: relative;
display: flex;
}
.search-left {
display: flex;
width: 877px;
height: 54px;
line-height: 20px;
border: 1px solid rgba(217, 217, 217, 0.96);
}
.search-logo {
width: 40px;
align-items: center;
justify-content: center;
background: url("./img/scgoogle.png") center center no-repeat;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: alpha(opacity=20);
-moz-opacity: 0.2;
-khtml-opacity: 0.2;
opacity: 0.2;
cursor: pointer;
}
.search-logo:hover {
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
-moz-filter: grayscale(0%);
-o-filter: grayscale(0%);
filter: alpha(opacity=100);
-moz-opacity: 1;
-khtml-opacity: 1;
opacity: 1;
}
.search-methods {
display: none;
position: absolute;
left: 0;
top: 54px;
width: 155px;
border: 1px solid rgba(217, 217, 217, 0.96);
background-color: #fff;
}
.search-methods li {
padding-left: 39px;
background: url("./img/scgoogle.png") 10px no-repeat;
overflow: hidden;
height: 34px;
line-height: 34px;
color: #545454;
cursor: pointer;
}
.search-logo.baidu, li.baidu {
background-image: url("./img/scbaidu.png");
}
.search-logo.bing, li.bing {
background-image: url("./img/scbing.png");
}
.search-logo.sogou, li.sogou {
background-image: url("./img/scsogou.png");
}
.search-logo.wangpan, li.wangpan {
background-image: url("./img/scwangpan.png");
}
.search-logo.so, li.so {
background-image: url("./img/scso.png");
}
.search-logo.google, li.google {
background-image: url("./img/scgoogle.png");
}
.search-methods .search-item:hover {
background-color: #f0f0f0;
}
.search-result {
display: none;
position: absolute;
width: 837px;
top: 55px;
left: 40px;
border: 1px solid rgba(187, 187, 187, 1);
background-color: #fff;
}
.result-item {
height: 34px;
line-height: 34px;
padding-left: 15px;
}
.result-item.active {
background: #F0F0F0;
}
.result-item:hover {
background-color: #eee;
cursor: pointer;
}
.input-wrap {
position: relative;
flex: 1;
}
.input-wrap .search-input {
height: 52px;
width: 100%;
outline: 0;
border: 0;
font-size: 16px;
padding-left: 15px;
}
/* .input-wrap .search-input:focus{
border-style:solid;
border-color: #FDA31E 96%;
box-shadow: 0 0 10px #FDA31E;
} */
/* .search-left:focus{
border-style:solid;
border-color: #FDA31E 96%;
box-shadow: 0 0 10px #FDA31E;
} */
.input-wrap .clear-keyword {
display: none;
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
cursor: pointer;
color: #d2d2d2;
font-size: 30px;
}
.search-submit {
width: 123px;
height: 54px;
line-height: 26px;
/* background: url("./img/search.png") #1890ff 48px center no-repeat; */
background-color: #1890FF;
/* background-image: url("./img/search.png");
background-size: 48px; */
background-repeat: no-repeat;
background-position: center;
-webkit-background-size: 35px 35px;
background-size: 35px 35px;
color: #fff;
font-size: 18px;
font-weight: 500;
text-align: center;
font-family: Roboto;
border: 1px solid #1890ff;
cursor: pointer;
background: linear-gradient(90deg,#1890FF,#455bfb);
}
/* 搜索框 end */
/* 导航内容 start */
.nav-content {
overflow: hidden;
}
/* 导航内容 end */
/*内容区域*/
/*-----------------------------简洁版样式定义- 开始---------------------------------------------------*/
.jj-list {
width: 33.33%;
float: left;
margin-bottom: 30px;
padding-right: 16px;
}
.jj-list:nth-of-type(3n) {
padding-right: 0;
}
.jj-list-tit {
font-size: 16px;
line-height: 25px;
color: rgba(49, 70, 89, 1);
font-weight: bold;
}
.jj-list-con {
overflow: hidden;
margin: 0 auto;
}
.jj-list-con li {
box-sizing: border-box; /*以IE盒子模型的width为标准*/
padding: 1px 1px; /*设置div的内边距*/
width: 33.33%; /*div等分成4部分*/
float: left;
transform-origin: center top;
}
.jj-list-con li:hover {
animation: swing 2s linear 0s 1 forwards
}
@keyframes swing {
0%, 100% {
transform: perspective(200px) rotateX(0);
}
20% {
transform: perspective(200px) rotateX(-45deg);
}
40% {
transform: perspective(200px) rotateX(45deg);
}
50% {
transform: perspective(200px) rotateX(-25deg);
}
60% {
transform: perspective(200px) rotateX(25deg);
}
70% {
transform: perspective(200px) rotateX(-5deg);
}
80% {
transform: perspective(200px) rotateX(5deg);
}
90% {
transform: perspective(200px) rotateX(-3deg);
}
95% {
transform: perspective(200px) rotateX(3deg);
}
}
.jj-list-link {
display: block;
background: rgba(230, 247, 255, 0.96);
color:rgba(49, 70, 89, 1);
font-size: 13px;
text-align: center;
line-height: 44px;
transition: all 0.2s;
border-radius: 2px;
}
.jj-list-link:hover {
background: #1890FF 100%;
font-size: 18px;
font-weight: bold;
color: #fff;
}
/*-----------------------------简洁版样式定义- 结束---------------------------------------------------*/

BIN
static/img/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
static/img/logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 KiB

2
static/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

263
static/js/keyword.js Normal file
View File

@ -0,0 +1,263 @@
$(function () {
// 默认搜索引擎记录
var searchTypeStore = {
set: function (type) {
localStorage.setItem('SearchType', type);
},
get: function () {
return localStorage.getItem('SearchType') || 'baidu';
},
};
var $searchMethods = $('#search_methods');
var $searchLogo = $('#search_logo');
var initSearchType = searchTypeStore.get();
$searchLogo.addClass(initSearchType).data('type', initSearchType);
var search_types = [
{ url: 'https://www.baidu.com/s?wd=', type: 'baidu' },
{ url: 'https://www.sogou.com/web?query=', type: 'sogou' },
{ url: 'https://cn.bing.com/search?q=', type: 'bing' },
{ url: 'https://www.so.com/s?q=', type: 'so' },
{ url: 'https://www.google.com/search?q=', type: 'google' },
{ url: 'http://www.cilimao.cc/search?word=', type: 'cili' },
{ url: 'http://neets.cc/search?key=', type: 'yingyin' },
{ url: 'http://www.panduoduo.net/s/name/', type: 'wangpan' },
];
$searchLogo.on('click', function () {
$searchMethods.show();
});
// 搜索引擎切换
$searchMethods.on('click', 'li', function () {
var type = $(this).data('type');
searchTypeStore.set(type);
$searchLogo.removeClass()
.data('type', type)
.addClass(type + ' search-logo');
$searchMethods.hide();
$('#search_keyword').focus();
});
$searchMethods.on('mouseleave', function () {
$searchMethods.hide();
});
var EVENT_CLEAR_KEYWORD = 'clearKeyword';
var EVENT_SEARCH = 'search';
// 关键词搜索输入
$('#search_keyword').on('keyup', function (event) {
var keyword = $(this).val();
if(event.which==13){
if($('#search_result .active').length>0){
keyword = $('#search_result .active').eq(0).text();
}
openSearch(keyword)
return;
}
// TODO 上下键选择待选答案
var bl = moveChange(event);
if(bl){
keywordChange(keyword);
}
}).on('blur', function () {
// 推荐结果跳转
$('#search_result').on('click', 'li', function () {
var word = $(this).text();
$('#search_keyword').val(word);
openSearch(word);
$('#search_result').hide();
});
// 解决失焦和点击事件冲突问题
setTimeout(function() {
$('#search_result').hide();
}, 100)
}).on('focus', function () {
var keyword = $(this).val();
keywordChange(keyword);
});
function moveChange(e){
var k = e.keyCode || e.which;
var bl = true;
switch(k){
case 38:
rowMove('top');
bl = false;
break;
case 40:
rowMove('down');
bl = false;
break;
}
return bl;
}
function rowMove(move){
var search_result = $('#search_result');
var hove_li = null;
search_result.find('.result-item').each(function(){
if($(this).hasClass('active')){
hove_li = $(this).index();
}
});
if(move == 'top'){
if(hove_li==null){
hove_li = search_result.find('.result-item').length-1;
}else{
hove_li--;
}
}else if(move == 'down'){
if(hove_li==null){
hove_li = 0;
}else{
hove_li==search_result.find('.result-item').length-1?(hove_li=0):(hove_li++);
}
}
search_result.find('.active').removeClass('active');
search_result.find('.result-item').eq(hove_li).addClass('active');
$('#search_keyword').val(search_result.find('.result-item').eq(hove_li).addClass('active').text());
}
function keywordChange(keyword) {
if (keyword === '') {
$(document).trigger(EVENT_CLEAR_KEYWORD);
} else {
$(document).trigger(EVENT_SEARCH, keyword);
$('#clear_keyword').show();
}
}
// 清空输入框
$('#clear_keyword').on('click', function () {
$('#search_keyword').val('');
$('#search_keyword').focus();
$(document).trigger(EVENT_CLEAR_KEYWORD);
});
// 点击高亮显示
$('#search_keyword').on('focus', function () {
$('.search-left').css(
{
"border-style":"solid",
"border-color": "rgba(24, 144, 255, 1)",
"box-shadow": "0px 0px 2px 1px rgba(145, 213, 255, 0.96)",
}
);
}).on('blur', function () {
$('.search-left').prop('style','');
});
// 搜索
$('#search_submit').on('click', function () {
var keyword = $('#search_keyword').val();
var type = getSeachType();
var baseUrl = search_types.find(function (item) {
return item.type === type;
});
if (baseUrl && keyword) {
window.open(baseUrl.url + keyword);
}
});
$(document).on(EVENT_CLEAR_KEYWORD, function () {
$('#clear_keyword').hide();
$('#search_result').hide();
});
$(document).on(EVENT_SEARCH, function (e, keyword) {
getSearchResult(keyword);
});
// 获取搜索引擎类型
function getSeachType() {
return $('#search_logo').data('type');
}
// google 搜索结果
function searchResultGoogle(data) {
var result = data[1];
result = result.map(function (item) {
return item[0];
});
renderSearchResult(result);
}
// 百度 搜索结果
function searchResultBaidu(data) {
if (data === undefined) {
return;
}
var result = data.s;
renderSearchResult(result);
}
// 渲染搜索结果
function renderSearchResult(array) {
var $result = $('#search_result');
$result.empty().hide();
if (!array || array.length <= 0) {
return;
}
for (var i = 0; i < array.length; i++) {
var $li = $('<li class=\'result-item\'></li>');
$li.text(array[i]);
$result.append($li);
}
$result.show();
}
window.searchResultGoogle = searchResultGoogle;
window.searchResultBaidu = searchResultBaidu;
var search_suggest = {
baidu: {
url: 'https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su',
data: function (keyword) {
return {
wd: keyword,
cb: 'window.searchResultBaidu',
};
},
},
google: {
url: 'http://suggestqueries.google.com/complete/search',
data: function (keyword) {
return {
q: keyword,
jsonp: 'window.searchResultGoogle',
client: 'youtube',
};
},
},
wangpan: {
url: 'http://unionsug.baidu.com/su',
data: function (keyword) {
return {
wd: keyword,
cb: 'window.searchResultBaidu',
};
},
},
};
function getSearchResult(keyword) {
var searchType = getSeachType();
var suggest = search_suggest[searchType];
if (!suggest) {
suggest = search_suggest.baidu;
}
$.ajax({
url: suggest.url,
dataType: 'jsonp',
data: suggest.data(keyword),
});
}
function openSearch(keyword) {
var type = getSeachType();
var baseUrl = search_types.find(function (item) {
return item.type === type;
});
if (baseUrl && keyword) {
window.open(baseUrl.url + keyword, keyword);
}
}
});