mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
70 lines
2.9 KiB
HTML
70 lines
2.9 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<link rel="stylesheet" href="../../uweb/style.css" type="text/css" />
|
|
<title>Gestures</title>
|
|
<script type="text/javascript">
|
|
function findLang(){
|
|
let href = location.href;
|
|
for(let i=href.length-1;i>0;i--){
|
|
if('/'==href.charAt(i) && '/'==href.charAt(i-3))
|
|
return i;
|
|
}
|
|
return 0;
|
|
}
|
|
function nav2(page){
|
|
let i = findLang();
|
|
location.href = location.href.substring(0,i+1)+page;
|
|
}
|
|
function nav2Lang(lang){
|
|
let i = findLang();
|
|
let href = location.href;
|
|
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<header class='header'>
|
|
<a class="logo" href="javascript:void(0)" onclick="return nav2('index.html')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html')">Tags</a>
|
|
|
|
|
|
<a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
|
|
|
|
|
|
<nav>
|
|
</nav>
|
|
</header>
|
|
<br />
|
|
|
|
<div class="container">
|
|
<h1 class="title">Gestures
|
|
<br>
|
|
<span class="subtitle"></span>
|
|
</h1>
|
|
<ul class="tags">
|
|
|
|
</ul>
|
|
<p>Swipe down from the top to show the address bar; swipe up to the top to hide the address bar. Swipe down to the bottom to hide the toolbar with option "swipe to hide tools"; swipe on the bottom corners to show the toolbar.</p>
|
|
<p>Swipe left/right near the toolbar to switch window; fling left/right to switch to the last/first window.</p>
|
|
<p>Swiping on the top part of content window (near the top address bar by default) triggers corresponding link in the file "default.gesture", which has the same format as <a href="../links/index.html">default.link</a>.</p>
|
|
<p>The algorithm to match swiping gesture to a line in the file "default.gesture" is as follows:</p>
|
|
<ul>
|
|
<li>Divide the screen width to three parts evenly, assign each part with a number 0, 1, 2 respectively.</li>
|
|
<li>Assume "s" and "e" are the above defined numbers for the gesture start point and end point. Let "linenumber = 3*s+e" , if it is equal to 4 and the gesture's first direction is left, then change it to be 9.</li>
|
|
<li>For turning back and forth, add "10" each time.</li>
|
|
</ul>
|
|
<p>The final line number will match the corresponding line in "default.gesture", 0 to the first line, ...</p>
|
|
<p>"default.gesture2" is for the right side gesturs and the algorithm is similar to "default.gesture".</p>
|
|
<p>Example links:<br>
|
|
Toggle fullscreen::0003<br>
|
|
back:javascript:history.back()<br>
|
|
forward:javascript:history.forward()<br>
|
|
back2:javascript:history.go(-2)</p>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|