Advertisement
1xptolevitico69

Display info from html module

Aug 20th, 2022
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.88 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.   <!-- Global site tag (gtag.js) - Google Analytics -->
  6.   <script async="" src="https://www.googletagmanager.com/gtag/js?id=G-420XFJRS1M"></script>
  7.   <script>
  8.     window.dataLayer = window.dataLayer || [];
  9.  
  10.     function gtag() {
  11.       dataLayer.push(arguments);
  12.     }
  13.     gtag('js', new Date());
  14.     gtag('config', 'G-420XFJRS1M');
  15.   </script>
  16.   <link rel="shortcut icon" href="https://1xpto.netlify.app/items/favicon.gif" type="image/x-icon">
  17.   <meta charset="UTF-8">
  18.   <meta http-equiv="X-UA-Compatible" content="IE=edge">
  19.   <meta name="keywords" content="Display info from html module">
  20.   <meta name="viewport" content="width=device-width, initial-scale=1.0">
  21.   <title>Display info from html module</title>
  22.   <style>
  23.     body {
  24.       margin: 0;
  25.       font-family: calibri;
  26.     }
  27.  
  28.     .info {
  29.       background-color: red;
  30.       display: block;
  31.       margin: 10px auto;
  32.       width: 50%;
  33.       padding: 10px 0;
  34.     }
  35.  
  36.     .info h2 {
  37.       text-align: center;
  38.     }
  39.  
  40.     h1 {
  41.       font-family: verdana;
  42.       padding: 50px 20px;
  43.     }
  44.  
  45.     .app {
  46.       font-size: 16px;
  47.       z-index: 1;
  48.       text-decoration: none;
  49.       font-family: verdana;
  50.       font-weight: bold;
  51.       color: red;
  52.       position: absolute;
  53.       top: 0;
  54.       right: 0;
  55.       margin: 5px;
  56.       border: 2px solid red;
  57.       padding: 5px 10px;
  58.     }
  59.  
  60.     @media all and (orientation: portrait) and (max-width: 425px) {
  61.       .info {
  62.         width: 60%;
  63.       }
  64.  
  65.       .app {
  66.         word-wrap: break-word;
  67.         width: 20px;
  68.       }
  69.  
  70.       h1 {
  71.         font-size: 18px;
  72.       }
  73.     }
  74.  
  75.     @media all and (orientation: landscape) and (max-width: 640px) {
  76.       .info {
  77.         width: 60%;
  78.       }
  79.  
  80.       .app {
  81.         word-wrap: break-word;
  82.         width: 20px;
  83.       }
  84.  
  85.       h1 {
  86.         font-size: 18px;
  87.       }
  88.     }
  89.  
  90.  
  91.   </style>
  92. </head>
  93.  
  94. <body>
  95.   <a class='app' href='https://1xpto.netlify.app/'>Visite Site</a>
  96.  
  97.   <module class='info'>
  98.     <h2>John 32 years old has broken a tooth.</h2>
  99.     <h2>Henrietta 40 year old, single, wants to marry right now.</h2>
  100.     <h2>Marcus 10 years old loves his pet.</h2>
  101.     </module.info>
  102.  
  103.     <script>
  104.       i = 0;
  105.       a = 0;
  106.       x = document.getElementsByTagName('h2');
  107.       list_content = x[i].innerHTML;
  108.       foo = x.length;
  109.       document.body.appendChild(h1 = document.createElement('h1'));
  110.       stop = setInterval(loop, 100);
  111.  
  112.       function loop() {
  113.         if (i == foo) {
  114.           clearInterval(stop);
  115.         } else {
  116.           h1.innerHTML += '<i>' + list_content[a] + '</i>';
  117.           window.scrollBy(0, 100);
  118.           a++;
  119.           if (a == list_content.length) {
  120.             h1.innerHTML += '<br>';
  121.             i++;
  122.             list_content = x[i].innerHTML;
  123.             a = 0;
  124.           }
  125.         }
  126.       }
  127.     </script>
  128. </body>
  129. </htm>
  130.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement