2 Star 0 Fork 3

LoyDgIk / LoyDgIk_Rule

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tc.html 2.13 KB
一键复制 编辑 原始数据 按行查看 历史
LoyDgIk 提交于 2021-02-27 11:22 . 聚合搜索
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
<title>LoyDgIk</title>
<style>
.search-from{
overflow: visible;
}
.input-bg{
line-height: 50px;
height: 50px;
display: flex;
overflow: visible;
font-size:14px;
margin: 14px 18px;
border-radius: 14px;
opacity: 0;
transition: opacity .3s;
will-change: opacity;
border: 2px solid transparent;
opacity: 1;
}
.search-input{
outline:none;
font-size: 17px;
flex: 1;
border:0;
padding-left: 20px;
background-color: transparent;
caret-color: #2196F3;
color: var(--dark);
width: 0;
line-height: 1;
}
.search-btn{
-webkit-user-select: none;
margin-right: 20px;
color: var(--dark);
font-size: 16px;
line-height: 49px;
padding-left: 15px;
font-weight: bold;
border-left:2px solid black;
}
</style>
<body style="overflow:hidden;">
<div class="search-from">
<div class="input-bg animation" style="border-color: var(--dark);">
<input type="text" class="search-input" id="search-input"placeholder="搜索内容 . . .">
<div class="search-btn"id="search-ok">
搜索
</div>
</div>
</div>
<script>
document.getElementById("search-ok").onclick=function(){
var k=document.getElementById("search-input").value
var work=fy_bridge_app.fetch("hiker://files/searchwork.json");
if(work==""){
work=[];
}else{
work=JSON.parse(work);
}
if(work.length<11&&k){
work.unshift(k);
work=Array.from(new Set(work))
//alert(work)
fy_bridge_app.writeFile("hiker://files/searchwork.json",JSON.stringify(work));
}
fy_bridge_app.putVar("searchKeyword",k);
fy_bridge_app.refreshPage(true);
//fy_bridge_app.putVar("searchKeyword",k);
}
if(fy_bridge_app.getVar("searchKeyword")!=""){
document.getElementById("search-input").value=fy_bridge_app.getVar("searchKeyword");
}
</script>
</body>
</html>
JavaScript
1
https://gitee.com/LoyDgIk/LoyDgIk_Rule.git
git@gitee.com:LoyDgIk/LoyDgIk_Rule.git
LoyDgIk
LoyDgIk_Rule
LoyDgIk_Rule
master

搜索帮助