index.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>perfect-scrollbar</title>
  6. <link href="bootstrap-combined.min.css" rel="stylesheet">
  7. <link href="perfect-scrollbar.css" rel="stylesheet">
  8. <link href="prettify.css" rel="stylesheet">
  9. <style>
  10. .github-corner:hover .octo-arm {
  11. animation:octocat-wave 560ms ease-in-out;
  12. }
  13. @keyframes octocat-wave {
  14. 0%,100% { transform:rotate(0); }
  15. 20%,60% { transform:rotate(-25deg); }
  16. 40%,80%{ transform:rotate(10deg); }
  17. }
  18. @media (max-width: 500px) {
  19. .github-corner:hover .octo-arm {
  20. animation:none;
  21. }
  22. .github-corner .octo-arm {
  23. animation:octocat-wave 560ms ease-in-out;
  24. }
  25. }
  26. </style>
  27. <style>
  28. html, body { background-color: #fcfcfe; }
  29. .body { padding: 50px 0px; }
  30. .logo { font-size:100px; text-align:center; line-height: 70px; }
  31. .description { padding-top: 20px; text-align:center; }
  32. .subtitle { padding: 70px 0 30px; }
  33. .list { width: 250px; margin: 0 auto; text-align: left; }
  34. .list li { margin-bottom: 5px; white-space: nowrap; }
  35. #demo { position:relative; margin:0px auto; padding:0px; width: 600px; height: 400px; overflow: hidden; }
  36. #demo .content { background-image: url('./azusa.jpg'); width: 1280px; height: 720px; }
  37. </style>
  38. <style>
  39. @import url(https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css);
  40. pre.prettyprint {
  41. text-align:left;
  42. width: 470px;
  43. margin:0px auto;
  44. font-size: 15px;
  45. font-family: 'Fira Code', Monaco, Menlo, Consolas, 'Courier New', monospace;
  46. background-color: #fafafc;
  47. padding: 15px 20px;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <a href="https://github.com/utatti/perfect-scrollbar" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: fixed; top: 0; border: 0; right: 0; z-index: 100;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
  53. <div class="body">
  54. <h1 class="logo">perfect-scrollbar</h1>
  55. <p class="lead" style="text-align:center;">Minimalistic but perfect custom scrollbar plugin</p>
  56. <div class="description">
  57. <h2 class="subtitle"><i>perfect</i> means...</h2>
  58. <ul class="list">
  59. <li class="lead">No change on design layout</li>
  60. <li class="lead">No manipulation on DOM tree</li>
  61. <li class="lead">Use plain scrollTop and scrollLeft</li>
  62. <li class="lead">Scrollbar style is fully customizable</li>
  63. <li class="lead">Efficient update on layout change</li>
  64. </ul>
  65. <h2 class="subtitle">Demo</h2>
  66. <div id="demo">
  67. <div class="content">
  68. </div>
  69. </div>
  70. <div style="margin-top:15px;">
  71. <div class="input-prepend">
  72. <span class="add-on" style="width:100px;">Width</span>
  73. <input type="text" id="width" placeholder="600">
  74. </div>
  75. <div class="input-prepend">
  76. <span class="add-on" style="width:100px;">Height</span>
  77. <input type="text" id="height" placeholder="400">
  78. </div>
  79. <button id="button" class="btn btn-primary">Change Size!</button>
  80. </div>
  81. <h2 class="subtitle">Code</h2>
  82. <pre class="prettyprint">
  83. const ps = new PerfectScrollbar(demoDiv);
  84. button.addEventListener('click', () => {
  85. demoDiv.style.width = `${widthInput.value}px`;
  86. demoDiv.style.height = `${heightInput.value}px`;
  87. ps.update();
  88. });
  89. </pre>
  90. <h2 class="subtitle">Documentation</h2>
  91. <p class="lead">
  92. Please refer to the <a href="http://github.com/utatti/perfect-scrollbar">README</a>.
  93. </p>
  94. <h2 class="subtitle">License</h2>
  95. <p class="lead">
  96. The MIT License (MIT)
  97. <br>
  98. Copyright (c) 2012-2017 <a href="http://github.com/utatti">Hyunje Jun</a> and other <a href="https://github.com/utatti/perfect-scrollbar/graphs/contributors">contributors</a>.
  99. </p>
  100. </div>
  101. </div>
  102. <script src="perfect-scrollbar.min.js"></script>
  103. <script src="prettify.js"></script>
  104. <script>
  105. var $ = document.getElementById.bind(document);
  106. var demoDiv = $('demo');
  107. var widthInput = $('width');
  108. var heightInput = $('height');
  109. var button = $('button');
  110. var ps = new PerfectScrollbar(demoDiv);
  111. button.addEventListener('click', function () {
  112. demoDiv.style.width = (widthInput.value || 600) + 'px';
  113. demoDiv.style.height = (heightInput.value || 400) + 'px';
  114. ps.update();
  115. });
  116. prettyPrint();
  117. </script>
  118. </body>
  119. </html>