uweb/en/gesture/index.html

100 lines
3.8 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="../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 &quot;swipe to hide tools&quot;; 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 &quot;default.gesture&quot;, 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 &quot;default.gesture&quot; 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 &quot;s&quot; and &quot;e&quot; are the above defined numbers for the gesture start point and end point. Let &quot;linenumber = 3*s+e&quot; , 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 &quot;10&quot; each time.</li>
</ul>
<p>The final line number will match the corresponding line in &quot;default.gesture&quot;, 0 to the first line, ...</p>
<p>&quot;default.gesture2&quot; is for the right side gesturs and the algorithm is similar to &quot;default.gesture&quot;.</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>
<p>Last Modified: 2 April 2024<br>
add js function in README<br>
<pre></pre>
</p>
<script id='jsgiscus'
src='https://giscus.app/client.js'
data-repo="torappinfo/uweb"
data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
data-category="Announcements"
data-category-id="DIC_kwDOEgNLGc4CQjsh"
data-mapping="title"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous" async>
</script>
<footer class="site-footer">
<div class="container">
&copy; 2018-2024 Richard H. Cao
</div>
</footer>
<!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->
</body>
</html>