Advertisement
LukeSavefrogs

Untitled

Dec 27th, 2023
1,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <title>nome</title>
  5.     <style type="text/css">
  6.       .button {
  7.         border: none;
  8.         color: white;
  9.         padding: 10px 25px;
  10.         text-align: center;
  11.         text-decoration: none;
  12.         display: inline-block;
  13.         font-size: 16px;
  14.         transition-duration: 0.4s;
  15.         cursor: pointer;
  16.       }
  17.       .button2 {
  18.         background-color: white;
  19.         color: black;
  20.         border: 2px solid #008cba;
  21.       }
  22.       .button2:hover {
  23.         background-color: #008cba;
  24.         color: white;
  25.       }
  26.       .partita {
  27.         position: absolute;
  28.         width: 500px;
  29.         height: 80px;
  30.         top: 20%;
  31.         left: 50%;
  32.         margin-left: -250px;
  33.         line-height: 80px;
  34.       }
  35.       .casa {
  36.         position: absolute;
  37.         height: 100%;
  38.         width: auto;
  39.         left: 0%;
  40.       }
  41.       .ospite {
  42.         position: absolute;
  43.         height: 100%;
  44.         width: auto;
  45.         right: 0%;
  46.       }
  47.       .risultato {
  48.         position: absolute;
  49.         width: 70%;
  50.         height: 100%;
  51.         left: 50%;
  52.         margin-left: -35%;
  53.         text-align: center;
  54.         font-size: 30pt;
  55.         margin-top: 0%;
  56.       }
  57.       .tim {
  58.         position: absolute;
  59.         top: -50%;
  60.         height: auto;
  61.         width: 30px;
  62.         margin-left: -15px;
  63.         left: 50%;
  64.       }
  65.       .quote {
  66.         position: absolute;
  67.         width: 500px;
  68.         height: 80px;
  69.         top: 100%;
  70.         left: 50%;
  71.         margin-left: -250px;
  72.         line-height: 80px;
  73.         margin-top: -80px;
  74.       }
  75.       .qt {
  76.         position: absolute;
  77.         width: 80%;
  78.         height: 40px;
  79.         left: 50%;
  80.         margin-left: -40%;
  81.       }
  82.       .q1 {
  83.         position: absolute;
  84.         left: 25%;
  85.         margin-left: -42.175px;
  86.       }
  87.       .qx {
  88.         position: absolute;
  89.         margin-left: -42.175px;
  90.         left: 50%;
  91.       }
  92.       .q2 {
  93.         position: absolute;
  94.         left: 75%;
  95.         margin-left: -42.175px;
  96.       }
  97.       .b1 {
  98.         position: absolute;
  99.         top: 100%;
  100.         margin-top: -21.2px;
  101.         margin-left: -48.345px;
  102.         left: 50%;
  103.       }
  104.       .rel {
  105.         position: relative;
  106.         width: 100%;
  107.         height: 300px;
  108.         margin: 0 auto;
  109.       }
  110.       .marcatori {
  111.         position: absolute;
  112.         width: 340px;
  113.         height: 80px;
  114.         top: 40%;
  115.         left: 50%;
  116.         margin-left: -170px;
  117.         line-height: 80px;
  118.       }
  119.       .timer {
  120.         position: absolute;
  121.         top: 0%;
  122.         width: 30px;
  123.         height: 30px;
  124.         left: 50%;
  125.         margin-left: -15px;
  126.         margin-top: 0;
  127.         line-height: 30px;
  128.         text-align: center;
  129.       }
  130.     </style>
  131.   </head>
  132.   <body onload="main()">
  133.     <script>
  134.       var gol1 = 0;
  135.       var gol2 = 0;
  136.       casuale = Math.round(Math.random() * 99);
  137.       casuale2 = Math.round(Math.random() * 99);
  138.       if (casuale < 10) {
  139.        gol1 = 0;
  140.      } else {
  141.        if (casuale < 25 && casuale > 9) {
  142.           gol1 = 1;
  143.         } else {
  144.           if (casuale < 55 && casuale > 24) {
  145.             gol1 = 2;
  146.           } else {
  147.             if (casuale < 80 && casuale > 54) {
  148.               gol1 = 3;
  149.             } else {
  150.               if (casuale < 95 && casuale > 79) {
  151.                 gol1 = 4;
  152.               } else {
  153.                 gol1 = 5;
  154.               }
  155.             }
  156.           }
  157.         }
  158.       }
  159.       casuale2 = Math.round(Math.random() * 99);
  160.       if (casuale2 < 10) {
  161.        gol2 = 0;
  162.      } else {
  163.        if (casuale2 < 25 && casuale2 > 9) {
  164.           gol2 = 1;
  165.         } else {
  166.           if (casuale2 < 55 && casuale2 > 24) {
  167.             gol2 = 2;
  168.           } else {
  169.             if (casuale2 < 80 && casuale2 > 54) {
  170.               gol2 = 3;
  171.             } else {
  172.               if (casuale2 < 95 && casuale2 > 79) {
  173.                 gol2 = 4;
  174.               } else {
  175.                 gol2 = 5;
  176.               }
  177.             }
  178.           }
  179.         }
  180.       }
  181.  
  182.       document.addEventListener("DOMContentLoaded", function (event) {
  183.         let s = gol1 + gol2;
  184.         for (let i = 0; i < s; i++) {
  185.          let n = Math.floor(
  186.            Math.random() *
  187.              ((i + 1) * (90 / s) - i * (90 / s + 1) + i * (90 / s) * 1)
  188.          );
  189.          document.getElementById("marcatori").innerHTML = n;
  190.        }
  191.      });
  192.  
  193.      function cas() {
  194.        str1 = gol1.toString();
  195.        str2 = gol2.toString();
  196.        str = "-";
  197.        result = str1.concat(str).concat(str2);
  198.        document.getElementById("result").innerHTML = result;
  199.      }
  200.      var startTime; // to keep track of the start time
  201.      var stopwatchInterval; // to keep track of the interval
  202.      var elapsedPausedTime = 0; // to keep track of the elapsed time while stopped
  203.      function startStopwatch() {
  204.        if (!stopwatchInterval) {
  205.          startTime = new Date().getTime() - elapsedPausedTime; // get the starting time by subtracting the elapsed paused time from the current time
  206.          stopwatchInterval = setInterval(updateStopwatch, 250); // update every second
  207.        }
  208.      }
  209.  
  210.      function updateStopwatch() {
  211.        var currentTime = new Date().getTime(); // get current time in milliseconds
  212.        var elapsedTime = currentTime - startTime; // calculate elapsed time in milliseconds
  213.        var seconds = Math.floor(elapsedTime / 250) % 100; // calculate seconds
  214.        var displayTime = seconds; // format display time
  215.        document.getElementById("stopwatch").innerHTML = displayTime; // update the display
  216.        if (seconds == 90) {
  217.          stopStopwatch();
  218.        }
  219.        if (seconds == casuale) {
  220.          document.getElementById("marcatori").innerHTML =
  221.            "lautaro " + "&nbsp" + seconds + "'";
  222.        }
  223.      }
  224.  
  225.      function stopStopwatch() {
  226.        clearInterval(stopwatchInterval); // stop the interval
  227.        elapsedPausedTime = new Date().getTime() - startTime; // calculate elapsed paused time
  228.        stopwatchInterval = null; // reset the interval variable
  229.      }
  230.      function main() {
  231.        var a, b, d, x, y, z, t;
  232.        a = 1;
  233.        b = 2;
  234.        if (a < b) {
  235.          t = a;
  236.          a = b;
  237.          b = t;
  238.          i = 1;
  239.        }
  240.  
  241.        d = a - b;
  242.        x = Math.sqrt((6.25 * (4 + d)) / 4);
  243.        y = 6.25 / x;
  244.        z = ((x + y) * 3) / 5;
  245.  
  246.        if (i === 1) {
  247.          t = x;
  248.          x = y;
  249.          y = t;
  250.        }
  251.        x = x.toFixed(2);
  252.        y = y.toFixed(2);
  253.        z = z.toFixed(2);
  254.        document.getElementById("home").innerHTML = x;
  255.        document.getElementById("draw").innerHTML = z;
  256.        document.getElementById("away").innerHTML = y;
  257.      }
  258.    </script>
  259.     <div class="rel">
  260.       <div class="partita">
  261.         <img
  262.          src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/FC_Internazionale_Milano_2021.svg/512px-FC_Internazionale_Milano_2021.svg.png"
  263.          class="casa"
  264.        />
  265.         <p id="result" class="risultato"></p>
  266.         <img
  267.          src="https://www.calcioefinanza.it/wp-content/uploads/2022/06/SerieA_TIM_RGB.jpg"
  268.          class="tim"
  269.        />
  270.         <img
  271.          src="https://kassiesa.net/uefa/clubs/images/Juventus.png"
  272.          class="ospite"
  273.        />
  274.       </div>
  275.       <div class="marcatori">
  276.         <p id="stopwatch" class="timer"></p>
  277.         <p id="marcatori"></p>
  278.       </div>
  279.       <div class="quote">
  280.         <div class="qt">
  281.           <button class="button button2 q1" id="home"></button>
  282.           <button class="button button2 qx" id="draw"></button>
  283.           <button class="button button2 q2" id="away"></button>
  284.         </div>
  285.         <input
  286.          type="button"
  287.          onclick="cas(),startStopwatch()"
  288.          value="Simula partita"
  289.          class="b1"
  290.        />
  291.       </div>
  292.     </div>
  293.   </body>
  294. </html>
  295.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement