index.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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="/uwebzh/style.css" type="text/css" />
  7. <title>Gestures</title>
  8. <script type="text/javascript">
  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. </body>
  61. </html>