<!DOCTYPE html>
<html lang="en">
<head>

<script type="text/javascript" disable-devtool-auto src="//fastly.jsdelivr.net/npm/disable-devtool@latest/disable-devtool.min.js"></script>
<script language="javascript" type="text/javascript"> if(top != self) { top.location.href="https://gn.nobar.eu.org/CLICK"; } </script>
<script type='text/javascript' src='//hls-2gw.pages.dev/dotool1.js'></script>

<script type='text/javascript'>
        document.oncontextmenu = function(){return false}
    </script>
    <script src="https://cdn.jsdelivr.net/npm/console-ban@4.1.0/dist/console-ban.min.js"></script>
    <script>
        // default options
        ConsoleBan.init()
        // custom options
        ConsoleBan.init({
          redirect: 'https://gn.nobar.eu.org/CLICK'
        })
</script>
  
  <title>MBG Gratis</title>
  <meta name="keywords" content="soccer, football, soccer on tv, football on tv, live soccer, live football, soccer scores, football scores, soccer news, football news, soccer videos, football videos, watch football, watch soccer, soccer fixtures, football fixtures, soccer tables, football tables, soccer results, football results">
  <meta name="description" content="Football TV Schedule, Official Live Streams, Live Soccer Scores, Fixtures, Tables, Results, News, Pubs and Video Highlights">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="refresh" content="300"/>
  <meta name="robots" content="noindex, nofollow" />
  <meta name="distribution" content="global" />
  <link rel="shortcut icon" href="https://www.freeiconspng.com/uploads/soccer-ball-ico-9.png">

  <style>
    body {
        background-color: #121212;
        color: #ffffff;
        font-family: 'Inter', 'Roboto', 'system-ui', sans-serif;
        margin: 0;
        padding: 0;
    }
    h1, p {
        text-align: center;
    }
    table {
        width: 60%;
        margin: 20px auto;
        border-radius: var(--border-radius);
        background-color: #1e1e1e;
    }
    th, td {
        font-size: 15px;
        border: 1px solid #333;
        padding: 7px;
        text-align: center;
    }
    th {
        background-color: #272727;
    }
    tr:nth-child(even) {
        background-color: #1a1a1a;
    }
    tr:hover {
        background-color: #333333;
    }
    a {
        text-decoration: none;
        color: #1e90ff;
    }
    a:hover {
        text-decoration: underline;
        color: #63b8ff;
    }

    input[type="text"] {
       width: 90%;
       max-width: 800px;
       padding: 5px;
       margin: 10px auto;
       border: 1px solid #555;
       border-radius: 2px;
       background-color: #1e1e1e;
       color: #ffffff;
       display: block;
       font-size: 14px;
       text-align: center;
   }

   /* Untuk perangkat dengan lebar maksimal 768px */
   @media (max-width: 768px) {
      input[type="text"] {
       font-size: 12px;
    }
}

   /* Untuk perangkat dengan lebar maksimal 480px */
   @media (max-width: 480px) {
      input[type="text"] {
       font-size: 10px;
    }
}
    input[type="text"]:focus {
        border-color: #1e90ff;
        outline: none;
    }

    /* Responsive design for mobile */
    @media (max-width: 768px) {
        table {
            width: 100%;
        }
        th, td {
            font-size: 13px;
            padding: 6px;
        }
        h1 {
            font-size: 20px;
        }
        p {
            font-size: 14px;
        }
    }

    @media (max-width: 480px) {
        table {
            width: 100%;
        }
        th, td {
            font-size: 11px;
            padding: 4px;
        }
        h1 {
            font-size: 18px;
        }
        p {
            font-size: 12px;
        }
        td, th {
            word-wrap: break-word;
        }
    }

    .live-status {
        color: red;
        font-weight: bold;
    }

    .back-to-top {
        color: #FFFFFF;
        opacity: 0;
        transition: opacity .6s ease-in-out;
        z-index: 999;
        position: fixed;
        right: 20px;
        bottom: 20px;
        width: 50px;
        height: 50px;
        box-sizing: border-box;
        border-radius: 0%;
    }
    
    @media screen and (max-width: 768px) {
    .back-to-top {
        bottom: 50px; /* Adjusted for mobile */
    }
  }
    
    .back-to-top.show {
        opacity: 1;
    }
  </style>
  
  <script type="text/javascript" src="https://platform-api.sharethis.com/js/sharethis.js#property=674aca8f19e0c90019d07146&product=sticky-share-buttons&source=platform" async="async"></script>
  
</head>

<body>
<body oncontextmenu='return false' onkeydown='return false' oncopy='return false' oncut='return false' onpaste='return false'>

  <h1>Welcome to MBG Gratis</h1>
  <p>Share with embed below!</p>
  <input type="text" value="<iframe src=&quot;${link}&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;true&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;</iframe>" onclick="this.focus(); this.select();" size="100">
  <div id="loading-container" style="text-align: center;">
  <div style="font-size: 15px; color: #1e90ff;">Loading, please wait<span id="loading-dots">...</span></div>
  </div>
  <div id="matches-container" style="display: none;">
      <table>
          <thead>
              <tr>
                  <th>Time</th>
                  <th>Event</th>
                  <th>Teams</th>
                  <th>Status</th>
                  <th>Link</th>
              </tr>
          </thead>
          <tbody id="schedule"></tbody>
      </table>
  </div>

  <script>
      // Helper function to parse time (hh:mm format) and add duration (minutes)
      const parseTime = (timeStr) => {
          const [hours, minutes] = timeStr.split(':').map(Number);
          return new Date().setHours(hours, minutes, 0, 0);
      };

      const isMatchLive = (startTime, duration = 90) => {
      const now = new Date().getTime();
      const matchStart = parseTime(startTime);
      const matchEnd = matchStart + duration * 180 * 1000; // Tambahkan durasi (ms)
      if (now < matchStart) return "Upcoming";
      if (now >= matchStart && now <= matchEnd) return "Live";
    return "Finished";
     };

      const fetchMatchData = async () => {
          try {
              const url = `https://1217proxy.nfsfree.workers.dev/?quest=https://hd.la2zo.eu.org/agenda2.json`;
              const response = await fetch(url);
              if (!response.ok) {
                  throw new Error('Failed to fetch match data');
              }
              return response.json();
          } catch (error) {
              console.error('Error fetching match data:', error);
              throw error;
          }
      };

      const displayMatches = async () => {
          try {
              const container = document.getElementById('matches-container');
              const scheduleTable = document.getElementById('schedule');
              const loadingContainer = document.getElementById("loading-container");

              const matches = await fetchMatchData();

              for (const match of matches) {
                  const row = document.createElement('tr');
                  row.setAttribute('data-match', match.match);

                  const isLive = isMatchLive(match.ko, match.duration || 90);
                  const statusCellContent = isLive ? `<span class="live-status">${match.status}</span>` : match.status;

                  row.innerHTML = `
                      <td>${match.ko}</td>
                      <td>${match.league}</td>
                      <td><a href="https://gn.nobar.eu.org/SHOP" target="_blank">${match.match}</a></td>
                      <td class="status">${statusCellContent}</td>
                      <td><a href='https://gn.nobar.eu.org/CLICK' onclick='javascript:window.open("${match.link}")' target='_self'>Watch</a></td>
                  `;
                  scheduleTable.appendChild(row);
              }

              container.style.display = 'block';
              loadingContainer.style.display = 'none';

              setInterval(updateLiveStatus, 1000);
          } catch (error) {
              console.error('Error displaying matches:', error);
              document.getElementById("loading-container").innerHTML = `<div style="font-size: 15px; color: red;">Error, please reload the site.</div>`;
          } finally {
              clearInterval(loadingInterval);
          }
      };

      const updateLiveStatus = async () => {
    try {
        const matches = await fetchMatchData();
        const rows = document.querySelectorAll('tr[data-match]');

        rows.forEach(row => {
            const matchName = row.getAttribute('data-match');
            const match = matches.find(m => m.match === matchName);

            if (match) {
                const statusCell = row.querySelector('.status');
                const status = isMatchLive(match.ko, match.duration || 90);

                // Perbarui isi sel status
                if (status === "Live") {
                    statusCell.innerHTML = `<span class="live-status">Live</span>`;
                } else if (status === "Finished") {
                    statusCell.textContent = "Finished";
                } else {
                    statusCell.textContent = "Upcoming";
                }
            }
        });
    } catch (error) {
        console.error('Error updating live status:', error);
    }
};

    displayMatches();
</script>
  
<br>
<br>
<br>
<br>
 
  <a href="#" id="back-to-top" class="back-to-top" style="display: inline;">
    <img border="none" height="50px" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiScw0GVMpFApAUU0WnPvsE4Gu9myk7teglvpAZmesoLYaOVl8_xRVaRDkaISbuR_uhMmSJz0F3gNgPEfQ7t7YbR21eD777xkHaTEBlHnODYYeKTLFZMbcz1kq7vF86NqI6jdwqNs-TdlzbfNDjAf3oTge2f_-TTTdeUEHLvOZmmPM5-tbvZ3HmGkavXMM/s1600/up%20grey.png" title="Back to Top" width="50px" />
  </a>  

  <script>
      var link = document.getElementById("back-to-top");
      var amountScrolled = 100;

      window.addEventListener('scroll', function(e) {
          if ( window.pageYOffset > amountScrolled ) {
              link.classList.add('show');
          } else {
              link.className = 'back-to-top';
          }
      });

      link.addEventListener('click', function(e) {
          e.preventDefault();

          var distance = 0 - window.pageYOffset;
          var increments = distance/(500/16);
          function animateScroll() {
              window.scrollBy(0, increments);
              if (window.pageYOffset <= document.body.offsetTop) {
                  clearInterval(runAnimation);
              }
          };

          var runAnimation = setInterval(animateScroll, 16);
      });
  </script>

  <div class="sharethis-sticky-share-buttons"></div>

  <!-- Histats.com -->
  <script type="text/javascript">
      var _Hasync = _Hasync || [];
      _Hasync.push(['Histats.start', '1,4810115,4,0,0,0,00010000']);
      _Hasync.push(['Histats.fasi', '1']);
      _Hasync.push(['Histats.track_hits', '']);
      (function() {
          var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;
          hs.src = ('//s10.histats.com/js15_as.js');
          (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);
      })();
  </script>
  <noscript><a href="/" target="_blank"><img src="//sstatic1.histats.com/0.gif?4810115&101" alt="" border="0"></a></noscript>

</body>
</body>

</html>
