Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8.     <title>Clipboard</title>
  9.     <style>
  10.         * {
  11.             margin: 0;
  12.             padding: 0;
  13.             box-sizing: border-box;
  14.         }
  15.  
  16.         body {
  17.             background-color: #7c07b4;
  18.         }
  19.  
  20.         p {
  21.             color: #fff;
  22.             margin: 5px;
  23.             font-family: 'Trebuchet MS', sans-serif;
  24.             font-size: 60px;
  25.             font-weight: bold;
  26.             user-select: none;
  27.         }
  28.     </style>
  29. </head>
  30.  
  31. <body>
  32.     <p></p>
  33.     <script>
  34.         const cbd = document.querySelector('p');
  35.         let counter = 1;
  36.  
  37.         const ds = ['500413', '4821371', '14711284', '314897520'];
  38.         const ns = ['288142', '3109512', '28461756', '361142410'];
  39.         let tempValor;
  40.  
  41.         window.setInterval(function () {
  42.             let clipboarddata = window.clipboardData.getData("Text");
  43.             if (tempValor != clipboarddata) {
  44.                 tempValor = clipboarddata;
  45.                 if (ds.indexOf(tempValor) != -1) {
  46.                     cbd.textContent = 'DS';
  47.                 } else if (ns.indexOf(tempValor) != -1) {
  48.                     cbd.textContent = 'NS';
  49.                 } else {
  50.                     cbd.textContent = '';
  51.                 }
  52.             }
  53.         }, 500);
  54.     </script>
  55. </body>
  56.  
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement