Advertisement
1xptolevitico69

Arrow function javascript

Jan 4th, 2022
1,375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.49 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5.   <title>Arrow function javascript</title>
  6.   <meta charset="UTF-8">
  7.   <meta name="viewport" content="width=device-width">
  8.   <style>
  9.  
  10.     .clone {
  11.       position: absolute;
  12.       top: 10px;
  13.       left: 10px;
  14.       text-decoration: none;
  15.       background-color: snow;
  16.       width: 150px;
  17.       text-align: center;
  18.       color: red;
  19.       font-family: arial black;
  20.       padding: 5px 20px;
  21.     }
  22.  
  23.     body {
  24.       background-color: red;
  25.     }
  26.  
  27.     h1 {
  28.       font-size: 40px;
  29.       font-family: courier;
  30.       text-indent: 100px;
  31.       text-align: justify;
  32.       padding: 0 20px;
  33.       color: snow;
  34.       font-style: italic;
  35.     }
  36.   </style>
  37. </head>
  38.  
  39. <body>
  40.   <h1 id='p'></h1>
  41.  
  42.   <a class='clone' title="Subscribe and hit the notification bell for more updates. It's free." href='https://www.youtube.com/channel/UCqLpDK0eOsG1eEeF9jOUZkw'>SUBSCRIBE</a>
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.   <script>
  50.     post = 'One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. ';
  51.     i = 0;
  52.     setTimeout(function() {
  53.       (start = () => {
  54.         x = requestAnimationFrame(start);
  55.         p.innerHTML += post[i];
  56.         i++;
  57.         if (i == post.length) {
  58.           cancelAnimationFrame(x);
  59.         }
  60.       })();
  61.     }, 2000);
  62.   </script>
  63. </body>
  64. </htm>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement