Facebook
From Speedy Hamster, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 109
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>Document</title>
  8.     <style>
  9.         body{
  10.             background-color: green;
  11.             margin: 0px;
  12.             padding: 0px;
  13.         }
  14.         #czas{
  15.             position: absolute;
  16.             min-width: 200px;
  17.             height: 35px;
  18.             right: 0px;
  19.             top: 0px;
  20.             font-size: 20px;
  21.             padding: 15px 15px 0px 15px;
  22.             background-color: goldenrod;
  23.             color: white;
  24.             border-radius: 0px 0px 0px 10px;
  25.             text-align: center;
  26.         }
  27.         header{
  28.             color: white;
  29.             background-color: pink;
  30.             width: 100vw;
  31.             height: 400px;
  32.             margin: 0px;
  33.         }
  34.         #baner{
  35.             color: white;
  36.             background-color: rosybrown;
  37.             width: 100vw;
  38.             height: 35px;
  39.             padding: 15px 15px 0px 15px;
  40.             margin: 0px;
  41.             text-align: center;
  42.             font-style: italic;
  43.         }
  44.         #czasy{
  45.             float: left;
  46.         }
  47.     </style>
  48. </head>
  49. <body>
  50.     <script>
  51.          function animacja() {
  52.                         var blok = document.getElementById('napis');
  53.                         if (parseInt(blok.style.left) < 50) {
  54.                                 blok.style.left = "500px";
  55.                         } else {
  56.                                 blok.style.left = (parseInt(blok.style.left) - 3) + "px";
  57.                         }
  58.                 }
  59.                 window.setInterval (animacja,100);
  60.     </script>
  61.     <header>
  62.         <div id="czas">
  63.             <div id="czasy">
  64.        
  65.             </div>
  66.            
  67.             <div id="data">
  68.         </div>
  69.         </div>
  70.     </header>
  71.     <div class="baner">
  72.        <p id="napis">Witamy na naszej stronie</p>
  73.     </div>
  74.     <script  type="text/javascript">
  75.         function zegar(){
  76.            
  77.             now = new Date();
  78.             var hours = now.getHours();
  79.             var min = now.getMinutes();
  80.             var sec = now.getSeconds();
  81.             var days = now.getDate();
  82.             var months = now.getMonth() +1;
  83.             var years = now.getFullYear();
  84.            
  85.             if (hours < 10) hours = "0" + hours;
  86.             if (min < 10) min = "0" + min;
  87.             if (sec < 10) sec = "0" + sec;
  88.             var czas = hours+ ":" + min+ ":" + sec;
  89.             var data = days+ ":" + months+ ":" + years;
  90.             document.getElementById('czasy').innerHTML = czas;
  91.             document.getElementById("data").innerHTML = data;
  92.             setTimeout("zegar()", 1000);
  93.  
  94.         }
  95.         zegar();
  96.         </script>
  97. </body>
  98. </html>