
<div id="myData"></div>

<script>

  const copyrightDate = new Date().getFullYear();
  document.getElementById('copyYear').innerHTML = copyrightDate;

</script>


<!-- JavaScript Bundle with Popper -->

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous">
    </script>

  <script src="https://code.jquery.com/jquery-3.6.0.min.js"
    integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>

  <script>
    $(window).scroll(function () {
      $('nav').toggleClass('scrolled', $(this).scrollTop() > 100);
    });

    if (localStorage['signup'].match(/:::/)) {
      const [username, serial_] = localStorage.signup.split(':::');
      const serial = (+serial_).toLocaleString()
      $('.box-auth-true').show();
      $('.box-auth-false').hide();
      $('#auth-username').html(username);
      $('#count').html(`${serial} / <span id='count3'></span>`);
      $('#count-sub-text').html('YOUR AUTHENTICATION NUMBER');
      $('#communitea').html('Thanks for joining our communi&#39;<span style="color:#54BAAB;">tea</span>');
      $('#revolution-text').html(
        'Now stay tuned! As an early authenticator, you’ll be entitled to a variety of exciting rewards, including minted NFT certificates.'
      );
      $('#auth-body-text').hide();
      $('.rounded-pill').hide();
      $('.auth-btn').html('Configure GitHub App');
      $('.auth-btn').attr('href', 'https://github.com/apps/tea-xyz')
    }
  </script>

<script type="text/javascript">
    (function(c,l,a,r,i,t,y){
        c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
        t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
        y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
    })(window, document, "clarity", "script", "c9ohlhyxzf");
</script>

<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q3M5LVH76F"></script>
  <script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
      dataLayer.push(arguments);
    }
    gtag('js', new Date());

    gtag('config', 'G-Q3M5LVH76F');
  </script>

  <script>
    const textList = [
    "game&#8208;dev",
    "AI",
    "automation",
    "data",
    "ML",
    "web",
    "devops",
    "creating",
    "everything",
    "<i>you<i>"
    ];
    const cycle = document.querySelector(".cycle","#cycle");
    let i = 0;
    const cycleText = () => {
      cycle.innerHTML = textList[i];
      i = ++i % textList.length;
    };
    cycleText();
    setInterval(cycleText, 2400);

  </script>

  <script>
    rdt('track', 'SignUp');
    rdt('track', 'ViewContent');
  </script>

  <script>

    const url = 'https://tea.breezy.hr/json?verbose=true';

    fetch(url)
    .then(res => res.json())
    .then((out) => {
      //Debugging + Reference
      console.log(out);
      //Job Description One
      document.getElementById('typeOne').innerHTML = out[0].type.name;
      document.getElementById('deptOne').innerHTML = out[0].department;
      out[0].location.is_remote === true ? document.getElementById('locOne').innerHTML = 'Remote' : document.getElementById('locOne').innerHTML = out[0].location.name;
      document.getElementById('jobOne').innerHTML = out[0].name;
      document.getElementById('descOne').innerHTML = out[0].description;
      document.getElementById('linkOne').href = out[0].url;
      document.getElementById('typeTwo').innerHTML = out[1].type.name;
      document.getElementById('deptTwo').innerHTML = out[1].department;
      document.getElementById('jobTwo').innerHTML = out[1].name;
      document.getElementById('descTwo').innerHTML = out[1].description;
      out[1].location.is_remote === true ? document.getElementById('locTwo').innerHTML = 'Remote' : document.getElementById('locTwo').innerHTML = out[1].location.name;
      document.getElementById('linkTwo').href = out[1].url;
      document.getElementById('jobThree').innerHTML = out[2].name;
      document.getElementById('typeThree').innerHTML = out[2].type.name;
      document.getElementById('deptThree').innerHTML = out[2].department;
      out[2].location.is_remote === true ? document.getElementById('locThree').innerHTML = 'Remote' : document.getElementById('locThree').innerHTML = out[2].location.name;
      document.getElementById('descThree').innerHTML = out[2].description;
      document.getElementById('linkThree').href = out[2].url;
    })
    .catch(err => { throw err });

  </script>

  <script>


    const toastTrigger = document.getElementById('liveToastBtn')
    const toastLiveExample = document.getElementById('liveToast')
    if (toastTrigger) {
      toastTrigger.addEventListener('click', () => {
        const toast = new bootstrap.Toast(toastLiveExample)

        toast.show()
      })
    }

  </script>

  <script>
    $(document).ready(function() {
      var repository = "teaxyz/cli";
      var urlRepo = "https://api.github.com/repos/" + repository;
      var urlRelease = "https://api.github.com/repos/" + repository + "/releases/latest";
      var token = "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";

      // Check if the data is already stored in local storage
      var dataRepo = JSON.parse(localStorage.getItem('dataRepo'));
      var dataRelease = JSON.parse(localStorage.getItem('dataRelease'));

      if (dataRepo && dataRelease) {
        // If the data is already stored, use it to update the page
        var stargazers = "(" + numeral(dataRepo.stargazers_count).format("0.0a") + ")";
        var release = dataRelease.tag_name;
        $(".stargazers").html(stargazers).hide().fadeIn(400);
        $(".release").html(release).hide().fadeIn(400);
      } else {
        // If the data is not stored, make the API requests
        $.when(
          $.ajax({
            url: urlRepo,
            headers: {
              "Authorization": "token " + token
            },
          }),
          $.ajax({
            url: urlRelease,
            headers: {
              "Authorization": "token " + token
            },
          })
        ).done(function(dataRepo, dataRelease) {
          // Store the response data in local storage
          localStorage.setItem('dataRepo', JSON.stringify(dataRepo[0]));
          localStorage.setItem('dataRelease', JSON.stringify(dataRelease[0]));

          // Update the page with the response data
          var stargazers = "(" + numeral(JSON.parse(localStorage.getItem('dataRepo')).stargazers_count).format("0.0a") + ")";
          var release = JSON.parse(localStorage.getItem('dataRelease')).tag_name;
          $(".stargazers").html(stargazers).hide().fadeIn(400);
          $(".release").html(release).hide().fadeIn(400);

          // Reserve the space for the stargazers element
          var stargazersWidth = $(".stargazers").width();
          $(".content").css("min-width", stargazersWidth);
        });
      }
    });
  </script>
