-
Notifications
You must be signed in to change notification settings - Fork 0
/
via.html
7 lines (7 loc) · 2.88 KB
/
via.html
1
2
3
4
5
6
7
<!DOCTYPE html><html><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui"><title>主页</title><link rel="stylesheet" href="./css/via.css"><style></style></head><body><div class='frosted-glass' id='gesture-indicator'></div><div id="content"><div class="search_part"><a class="logo" href="" onclick="window.via.cmd(257);" title="书签"><img class="smaller" src="./images/via.png" /></a><form onsubmit="return search()" class="search_bar" title="搜索"><button onclick="search()" id="search_submit" value="" aria-label="搜索"><div class="search icon"></div></button><span><input class="search" onfocus="showButton()" onblur="hideButton()" type="text" value="" autocomplete="off" id="search_input" title="搜索"></span></form></div><script type="text/javascript">function showButton(){document.getElementById("search_submit").style.display="block"}
function hideButton(){""==document.getElementById("search_input").value&&(document.getElementById("search_submit").style.display="none")}
function search(){var a=document.getElementById("search_input");if(""!=a.value){try{window.via.searchText(a.value)}catch(b){alert(b)}a.value="";document.getElementById("search_submit").style.display="none";document.activeElement.blur()}return!1}
function fadeIn(a){if(a&&a.style)var b=Math.max(.05,parseFloat(a.style.opacity)),d=setInterval(function(){1<=b&&clearInterval(d);a.style.opacity=Math.min(1,b);b+=.1*b},6)}
function isGestureDisabled(){return document.activeElement&&"search_input"==document.activeElement.id||window.via&&!window.via.cmd(515)?!0:0!=(document.documentElement.scrollTop||document.body.scrollTop)};
function initGesture(d){var b=document.getElementById("content"),e=0,f=1,g=!1,a=0;d.addEventListener("touchstart",function(c){g=isGestureDisabled();e=c.touches[0].pageY;a=0},!1);d.addEventListener("touchmove",function(c){g||(0<a/*&&(document.body.style.position="fixed")*/,a=c.touches[0].pageY-e,0<a&&98>a&&(f=Math.max(.1,1-Math.min(1,a/98)),b.style.opacity=f,b.style.transform="translateY("+a+"px)"))},!1);d.addEventListener("touchend",function(c){/*document.body.style.position="static";*/if(0!=a){if(88.2<a)try{window.via.cmd(514)}catch(h){}b.style.transform="translateY(0px)";fadeIn(b)}},!1)};
initGesture(document.getElementById("gesture-indicator"));initGesture(document.getElementById("content"));</script><script charset="gbk" src="./js/via.js"></script><script type="text/javascript">function show(str){var searchbox = document.getElementById("search_input"); searchbox.innerHTML = str; searchbox.blur(); search();} var params = {"XOffset":0, "YOffset":0, "fontColor":"#666666", "fontColorHI":"#FFF", "fontSize":"14px", "borderColor":"#eee", "bgcolorHI":"#7B90E3", "sugSubmit":false }; BaiduSuggestion.bind("search_input",params,show); </script></div></body></html>