Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
5iux committed Mar 23, 2020
1 parent d42a73a commit fdc2940
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 288 deletions.
112 changes: 49 additions & 63 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
if ($t=="b"){
echo'<script>window.location.href="//www.baidu.com/s?ie=utf-8&word='.$q.'";</script>';
}else if($t=="g"){
echo'<script>window.location.href="https://www.google.com/search?hl=zh&q='.$q.'";</script>';
echo'<script>window.location.href="https://www.google.com.hk/search?hl=zh&q='.$q.'";</script>';
}else{
//默认谷歌
echo'<script>window.location.href="https://www.google.com/search?hl=zh&q='.$q.'";</script>';
echo'<script>window.location.href="https://www.google.com.hk/search?hl=zh&q='.$q.'";</script>';
}
};
?>
Expand All @@ -35,39 +35,10 @@
<meta name="x5-page-mode" content="app"><!--QQ应用模式-->
<title>简单搜索</title>
<link href="style.css?t=<?php echo date("ymdhi"); ?>" rel="stylesheet">
<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="//at.alicdn.com/t/font_1230786_59ub5vczww4.js"></script>
<script src="sou.js?t=<?php echo date("ymdhi"); ?>"></script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?2530a31105f02a18bdca86cb33da26ec";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-138875328-5"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-138875328-5');
</script>
<style>
svg.icon {
width: 14px;
height:14px;
margin: 0 5px 0 8px;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
.list ul li.title svg.icon{
width: 20px; height: 20px;
}
</style>
</head>

Expand All @@ -86,17 +57,14 @@ function gtag(){dataLayer.push(arguments);}
<li><a rel="nofollow" href="http://www.acfun.cn/index.html" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-acfun"></use></svg>ACFUN</a></li>
<li><a rel="nofollow" href="https://www.bilibili.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-bili"></use></svg>哔哩哔哩</a></li>
<li><a rel="nofollow" href="https://dagu.ml" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-yunbo"></use></svg>影视搜索</a></li>
<!------>
<li class="title"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-sheji"></use></svg> 设计视觉</li>
<li><a rel="nofollow" href="https://web.yyv.me/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-daohang1"></use></svg>设计导航</a></li>
<li><a rel="nofollow" href="https://www.pinterest.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-pinterest"></use></svg>Pinterest</a></li>
<li><a rel="nofollow" href="https://www.behance.net/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-behance"></use></svg>Behance</a></li>
<li><a rel="nofollow" href="https://www.dribbble.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-dribbble"></use></svg>Dribbble</a></li>
<li><a rel="nofollow" href="https://huaban.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-huaban"></use></svg>花瓣</a></li>
<li><a rel="nofollow" href="https://www.zcool.com.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-zhanku"></use></svg>站酷</a></li>
<li><a rel="nofollow" href="https://www.iconfont.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-iconfont"></use></svg>阿里图标</a></li>
<li><a rel="nofollow" href="https://www.iconfinder.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-eye"></use></svg>IconFinder</a></li>
<li><a rel="nofollow" href="https://uiiiuiii.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-jiaocheng"></use></svg>优设教程</a></li>
<!------>
<li class="title"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-youxiang"></use></svg> 邮箱</li>
<li><a rel="nofollow" href="https://mail.google.com/mail/u/0/#inbox" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-gmail"></use></svg>Gmail</a></li>
<li><a rel="nofollow" href="https://outlook.live.com/mail/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-windows"></use></svg>Hotmail</a></li>
<li><a rel="nofollow" href="https://mail.163.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-wangyi"></use></svg>网易邮箱</a></li>
<li><a rel="nofollow" href="https://mail.sina.com.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-xinlangwang"></use></svg>新浪邮箱</a></li>
<li><a rel="nofollow" href="https://mail.qq.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-QQ"></use></svg>QQ邮箱</a></li>
<li><a rel="nofollow" href="https://qiye.aliyun.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-yunyouxiang"></use></svg>阿里邮箱</a></li>
<!------>
<li class="title"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-msg"></use></svg> 社交</li>
<li><a rel="nofollow" href="https://www.weibo.com" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-weibo"></use></svg>微博</a></li>
Expand All @@ -119,6 +87,17 @@ function gtag(){dataLayer.push(arguments);}
<li><a rel="nofollow" href="https://www.amazon.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-amazon"></use></svg>亚马逊</a></li>
<li><a rel="nofollow" href="http://www.dangdang.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-dangdang"></use></svg>当当</a></li>
<li><a rel="nofollow" href="https://wat.dyartstyle.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-wat"></use></svg>吾爱淘</a></li>
<!------>
<li class="title"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-sheji"></use></svg> 设计视觉</li>
<li><a rel="nofollow" href="https://web.yyv.me/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-daohang1"></use></svg>设计导航</a></li>
<li><a rel="nofollow" href="https://www.pinterest.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-pinterest"></use></svg>Pinterest</a></li>
<li><a rel="nofollow" href="https://www.behance.net/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-behance"></use></svg>Behance</a></li>
<li><a rel="nofollow" href="https://www.dribbble.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-dribbble"></use></svg>Dribbble</a></li>
<li><a rel="nofollow" href="https://huaban.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-huaban"></use></svg>花瓣</a></li>
<li><a rel="nofollow" href="https://www.zcool.com.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-zhanku"></use></svg>站酷</a></li>
<li><a rel="nofollow" href="https://www.iconfont.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-iconfont"></use></svg>阿里图标</a></li>
<li><a rel="nofollow" href="https://www.iconfinder.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-eye"></use></svg>IconFinder</a></li>
<li><a rel="nofollow" href="https://uiiiuiii.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-jiaocheng"></use></svg>优设教程</a></li>
<!------>
<li class="title"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-sousuo"></use></svg> 搜索引擎</li>
<li><a rel="nofollow" href="https://www.google.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-google"></use></svg>Google</a></li>
Expand All @@ -131,14 +110,6 @@ function gtag(){dataLayer.push(arguments);}
<li><a rel="nofollow" href="https://mijisou.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-miji"></use></svg>秘迹</a></li>
<li><a rel="nofollow" href="https://www.dogedoge.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-gougou"></use></svg>多吉</a></li>
<li><a rel="nofollow" href="https://seeres.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-sousuo"></use></svg>seeres</a></li>
<!------>
<li class="title"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-youxiang"></use></svg> 邮箱</li>
<li><a rel="nofollow" href="https://mail.google.com/mail/u/0/#inbox" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-gmail"></use></svg>Gmail</a></li>
<li><a rel="nofollow" href="https://outlook.live.com/mail/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-windows"></use></svg>Hotmail</a></li>
<li><a rel="nofollow" href="https://mail.163.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-wangyi"></use></svg>网易邮箱</a></li>
<li><a rel="nofollow" href="https://mail.sina.com.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-xinlangwang"></use></svg>新浪邮箱</a></li>
<li><a rel="nofollow" href="https://mail.qq.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-QQ"></use></svg>QQ邮箱</a></li>
<li><a rel="nofollow" href="https://qiye.aliyun.com/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-yunyouxiang"></use></svg>阿里邮箱</a></li>
<!------>
<li class="title"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-ai-tool"></use></svg> 工具</li>
<li><a rel="nofollow" href="http://tools.imiku.me/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-ai-tool"></use></svg>Miku工具</a></li>
Expand Down Expand Up @@ -169,17 +140,32 @@ function gtag(){dataLayer.push(arguments);}
<li><a rel="nofollow" href="https://www.swiper.com.cn/" target="_blank"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-S"></use></svg>Swiper</a></li>
</ul>
</div>
<div class="mywth">
<div class="wea_hover">
<div class="wea_in wea_top"></div>
<div class="wea_in wea_con">
<ul></ul>
</div>
<div class="wea_in wea_foot">
<ul></ul>
</div>
</div>
<!--天气插件,基于www.tianqiapi.com 天气接口制作-->
<div class="mywth" style="width: 320px;">
<div id="he-plugin-simple"></div>
<script>
WIDGET = {
CONFIG: {
"modules": "01234",
"background": 5,
"tmpColor": "4A4A4A",
"tmpSize": "12",
"cityColor": "4A4A4A",
"citySize": "12",
"aqiSize": "12",
"weatherIconSize": "16",
"alertIconSize": "14",
"padding": "0px 5px 0px 5px",
"shadow": "1",
"language": "auto",
"fixed": "false",
"vertical": "middle",
"horizontal": "left",
"key": "8b21767309324253afe012f7747bdb8f"
}
}
</script>
<script src="https://widget.heweather.net/simple/static/js/he-simple-common.js?v=1.1"></script>
<!--和风天气插件-->
</div>
<div id="content">
<div class="con">
Expand All @@ -202,7 +188,7 @@ function gtag(){dataLayer.push(arguments);}
作者:D.Young
主页:https://yyv.me/
github:https://github.com/5iux/sou
日期:2020-03-16
日期:2020-03-23
版权所有,请勿删除
-->
</body>
Expand Down
44 changes: 1 addition & 43 deletions sou.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
作者:D.Young
主页:https://yyv.me/
github:https://github.com/5iux/sou
日期:2020-03-16
日期:2019-07-26
版权所有,请勿删除
*/

Expand Down Expand Up @@ -55,45 +55,3 @@ $(document).ready(function() {
});
});


/*天气插件开始
天气插件api请在
申请地址:和风天气-https://dev.heweather.com/
*/
$.ajax({
url: 'https://free-api.heweather.net/s6/weather/?location=auto_ip&key=此处请填入自己申请的KEY',
dataType: 'json',
error: function() {
console.log('天气插件网络错误!');
},
success: function(res) {
//判断夜晚
var now = new Date(),
hour = now.getHours();
if (hour < 18) { myday = "d"; } else { myday = "n"; }
//天气
$('.mywth').append(res.HeWeather6[0].basic.location + ' <img class="wea" src="https://cdn.heweather.com/img/plugin/190516/icon/c/' + res.HeWeather6[0].now.cond_code + myday + '.png"> ' + res.HeWeather6[0].now.cond_txt + ' ' + res.HeWeather6[0].now.tmp + '℃ ' + res.HeWeather6[0].now.wind_dir);

$('.wea_hover').css('background-image', 'url(https://cdn.heweather.com/img/plugin/190516/bg/sticker/' + res.HeWeather6[0].now.cond_code + myday + '.png)');
//今日天气
$('.wea_top').append('<span class="city"><b>' + res.HeWeather6[0].basic.location + '</b> ' + res.HeWeather6[0].update.loc + ' 更新</span><span class="img" style="background:url(https://cdn.heweather.com/img/plugin/190516/icon/c/' + res.HeWeather6[0].now.cond_code + myday + '.png) no-repeat center/contain;"></span> <span class="tem"><b>' + res.HeWeather6[0].now.tmp + '℃</b>' + res.HeWeather6[0].now.cond_txt + '</span><span class="air">紫外线指数:' + res.HeWeather6[0].lifestyle[5].brf + '<br>相对湿度:' + res.HeWeather6[0].now.hum + '%<br>' + res.HeWeather6[0].now.wind_dir + ':' + res.HeWeather6[0].now.wind_sc + '级</span><span class="air_tips">' + res.HeWeather6[0].lifestyle[3].txt + '</span>');
//今日指数
$('.wea_con ul').append('<li>舒适度指数<br><b>' + res.HeWeather6[0].lifestyle[0].brf + '</b></li>');
$('.wea_con ul').append('<li>穿衣指数<br><b>' + res.HeWeather6[0].lifestyle[1].brf + '</b></li>');
$('.wea_con ul').append('<li>感冒指数<br><b>' + res.HeWeather6[0].lifestyle[2].brf + '</b></li>');
$('.wea_con ul').append('<li>运动指数<br><b>' + res.HeWeather6[0].lifestyle[3].brf + '</b></li>');
$('.wea_con ul').append('<li>旅游指数<br><b>' + res.HeWeather6[0].lifestyle[4].brf + '</b></li>');
$('.wea_con ul').append('<li>紫外线指数<br><b>' + res.HeWeather6[0].lifestyle[5].brf + '</b></li>');
$('.wea_con ul').append('<li>洗车指数<br><b>' + res.HeWeather6[0].lifestyle[6].brf + '</b></li>');
$('.wea_con ul').append('<li>空气指数<br><b>' + res.HeWeather6[0].lifestyle[7].brf + '</b></li>');

//未来3天天气
$('.wea_foot ul').append('<li>' + res.HeWeather6[0].daily_forecast[0].date + '<br><img src="https://cdn.heweather.com/img/plugin/190516/icon/c/' + res.HeWeather6[0].daily_forecast[0].cond_code_d + myday + '.png"><br><b>' + res.HeWeather6[0].daily_forecast[0].cond_txt_d + '</b><br><i>' + res.HeWeather6[0].daily_forecast[0].tmp_min + '°/' + res.HeWeather6[0].daily_forecast[0].tmp_max + '°' + '</i></li>');

$('.wea_foot ul').append('<li>' + res.HeWeather6[0].daily_forecast[1].date + '<br><img src="https://cdn.heweather.com/img/plugin/190516/icon/c/' + res.HeWeather6[0].daily_forecast[1].cond_code_d + myday + '.png"><br><b>' + res.HeWeather6[0].daily_forecast[1].cond_txt_d + '</b><br><i>' + res.HeWeather6[0].daily_forecast[1].tmp_min + '°/' + res.HeWeather6[0].daily_forecast[1].tmp_max + '°' + '</i></li>');

$('.wea_foot ul').append('<li>' + res.HeWeather6[0].daily_forecast[2].date + '<br><img src="https://cdn.heweather.com/img/plugin/190516/icon/c/' + res.HeWeather6[0].daily_forecast[2].cond_code_d + myday + '.png"><br><b>' + res.HeWeather6[0].daily_forecast[2].cond_txt_d + '</b><br><i>' + res.HeWeather6[0].daily_forecast[2].tmp_min + '°/' + res.HeWeather6[0].daily_forecast[2].tmp_max + '°' + '</i></li>');
}
});

/*天气插件结束*/
Loading

0 comments on commit fdc2940

Please sign in to comment.