1 Star 0 Fork 5

bnyg/xiaobeiit

forked from xiaobeiit/xiaobeiit 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
search.html 3.12 KB
一键复制 编辑 原始数据 按行查看 历史
xiaobeiit 提交于 2020-06-22 10:21 . 更新项目
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="shortcut icon" href="favicon.ico">
<meta name="keywords" content="小北IT,玩机,灰度,灰度开源项目,软件库,拾穗集,还你干净的世界" />
<meta name="description" content="灰度网页版,轻奢,极简,悦享,还你干净的世界" />
<style type="text/css">
html,body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
text-align: center;
background-color: #282828;
}
.content {
width: 100%;
margin: 0 auto;
}
.input,.google,.baidu,.jump {
background-color: transparent;
border-width: 1px;
border-style: solid;
border-radius: 35px;
border-color: #BEBEBE;
text-align: center;
line-height: 360%;
font-size: 1em;
color: #C2C6C6;
outline: 0;
width: 80%;
margin: 10px;
}
.input {
font-weight: bold;
}
</style>
<title>极简搜索</title>
<link rel="shortcut icon" href="videoicon.png">
</head>
<body>
<div class="content">
<br>
<br>
<input type="text" id="text" value="" class="input" />
<input type="button" value="Google" onclick="google()" class="google" />
<input type="button" value="BaiDu" onclick="baidu()" class="baidu" />
<input type="button" value="Jump" onclick="url()" class="jump" />
<script type="text/javascript">
var flag = document.getElementById('text');
function google() {
if (flag.value.indexOf("https://") >= 0) {
location.href = document.getElementById("text").value;
} else {
if (flag.value.indexOf("http://") >= 0) {
location.href = document.getElementById("text").value;
} else {
location.href = "https://www.google.com.hk/search?safe=strict&q=" + document.getElementById("text").value;
}
}
}
function baidu() {
if (flag.value.indexOf("https://") >= 0) {
location.href = document.getElementById("text").value;
} else {
if (flag.value.indexOf("http://") >= 0) {
location.href = document.getElementById("text").value;
} else {
location.href = "https://www.baidu.com/s?wd=" + document.getElementById("text").value;
}
}
}
function url() {
if (flag.value.indexOf("https://") >= 0) {
location.href = document.getElementById("text").value;
} else {
if (flag.value.indexOf("http://") >= 0) {
location.href = document.getElementById("text").value;
} else {
location.href = "https://" + document.getElementById("text").value;
}
}
}
</script>
</div>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bnyg/xiaobeiit.git
git@gitee.com:bnyg/xiaobeiit.git
bnyg
xiaobeiit
xiaobeiit
master

搜索帮助