index.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <link rel="stylesheet" href="../style.css#" type="text/css" />
  7. <title>Gestures</title>
  8. <script>
  9. function findLang(){
  10. let href = location.href;
  11. for(let i=href.length-1;i>0;i--){
  12. if('/'==href.charAt(i) && '/'==href.charAt(i-3))
  13. return i;
  14. }
  15. return 0;
  16. }
  17. function nav2(page){
  18. let i = findLang();
  19. location.href = location.href.substring(0,i+1)+page;
  20. }
  21. function nav2Lang(lang){
  22. let i = findLang();
  23. let href = location.href;
  24. location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
  25. }
  26. </script>
  27. </head>
  28. <body>
  29. <header class='header'>
  30. <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>
  31. <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
  32. <nav>
  33. </nav>
  34. </header>
  35. <br />
  36. <div class="container">
  37. <h1 class="title">Gestures
  38. <br>
  39. <span class="subtitle"></span>
  40. </h1>
  41. <ul class="tags">
  42. </ul>
  43. <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>
  44. <p>Swipe left/right near the toolbar to switch window; fling left/right to switch to the last/first window.</p>
  45. <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>
  46. <p>The algorithm to match swiping gesture to a line in the file &quot;default.gesture&quot; is as follows:</p>
  47. <ul>
  48. <li>Divide the screen width to three parts evenly, assign each part with a number 0, 1, 2 respectively.</li>
  49. <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>
  50. <li>For turning back and forth, add &quot;10&quot; each time.</li>
  51. </ul>
  52. <p>The final line number will match the corresponding line in &quot;default.gesture&quot;, 0 to the first line, ...</p>
  53. <p>&quot;default.gesture2&quot; is for the right side gesturs and the algorithm is similar to &quot;default.gesture&quot;.</p>
  54. <p>Example links:<br>
  55. Toggle fullscreen::0003<br>
  56. back:javascript:history.back()<br>
  57. forward:javascript:history.forward()<br>
  58. back2:javascript:history.go(-2)</p>
  59. </div>
  60. <p>Last Modified: 2 April 2024<br>
  61. add js function in README<br>
  62. <pre></pre>
  63. </p>
  64. <script id='jsgiscus'
  65. src='https://giscus.app/client.js'
  66. data-repo="torappinfo/uweb"
  67. data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
  68. data-category="Announcements"
  69. data-category-id="DIC_kwDOEgNLGc4CQjsh"
  70. data-mapping="title"
  71. data-strict="0"
  72. data-reactions-enabled="1"
  73. data-emit-metadata="0"
  74. data-input-position="top"
  75. data-theme="light"
  76. data-lang="en"
  77. data-loading="lazy"
  78. crossorigin="anonymous" async>
  79. </script>
  80. <footer class="site-footer">
  81. <div class="container">
  82. &copy; 2018-2024 Richard H. Cao
  83. </div>
  84. </footer>
  85. <!-- 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/>. -->
  86. </body>
  87. </html>