uweb/en/gesture/index.html

92 lines
3.4 KiB
HTML
Raw Normal View History

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
2023-12-11 07:23:07 +00:00
2024-04-01 13:51:55 +00:00
<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'>
2024-04-02 05:42:43 +00:00
<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>
2024-04-02 05:42:43 +00:00
<p>Last Modified: 2 April 2024<br>
add js function in README<br>
2023-03-07 02:07:05 +00:00
<pre></pre>
</p>
2024-03-21 01:04:37 +00:00
2023-05-06 01:56:44 +00:00
<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"
2023-05-06 02:49:29 +00:00
data-mapping="title"
2023-05-06 01:56:44 +00:00
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="en"
data-loading="lazy"
2023-05-06 02:49:29 +00:00
crossorigin="anonymous" async>
2023-05-06 01:40:28 +00:00
</script>
</body>
</html>