vasil_k_k

YouTube_FastSeek

Feb 4th, 2026 (edited)
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.08 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Document</title>
  7. </head>
  8. <style>
  9.     body {
  10.         display: grid;
  11.         place-items: center;
  12.         height: 100vh;
  13.         background-color: #a11414;
  14.     }
  15.     .screen {
  16.         font: bold 48px/1.2 Arial, sans-serif;
  17.     }
  18. </style>
  19. <body>
  20.     <div class="screen">YouTube</div>
  21. </body>
  22. <script>
  23.     const screenElement = document.querySelector('.screen');
  24.  
  25.     const DELAY = 500;
  26.     const STEP = 10;
  27.     let count = 0;
  28.     let busy = null;
  29.  
  30.  
  31.     document.addEventListener('keydown', (event) => {
  32.         clearTimeout(busy);
  33.  
  34.         count += STEP;
  35.  
  36.         ({
  37.             ArrowRight: () => screenElement.textContent = `Forward: >> +${count}`,
  38.             ArrowLeft:  () => screenElement.textContent = `Backward: << -${count}`
  39.        }[event.key]?.());
  40.  
  41.        busy = setTimeout(() => {
  42.             count = 0;
  43.             screenElement.textContent = 'YouTube';
  44.         }, DELAY);
  45.     });
  46. </script>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment