<!DOCTYPE html>
<html lang="en">
<head>
  <title>TOPISTO</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Bangers" rel="stylesheet" type="text/css">

  <link href="css/topisto.css" rel="stylesheet" type="text/css">
  <link href="css/fonts.css" rel="stylesheet" type="text/css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

  <script src="js/console.js" defer></script>
  <script src="js/lastblock.js" defer></script>
  <script src="js/blockexplorer.js" defer></script>

  <script>

    var lastScroll = 0;

    $(document).ready(function(){
      // Mask navigator scrollbar
      // Doesn't work : can't scroll anymore
      //$("body").css('overflow', 'hidden');

      $('#myNavbar').on('show.bs.collapse', function () {
        $('#logo_topisto').css({'height' : '30px','width' : '30px'});
        $('#titre_topisto').css({'font-size' : '30px'});
      });
      $('#myNavbar').on('hidden.bs.collapse', function () {
        $('#logo_topisto').css({'height' : '72px','width' : '72px'});
        $('#titre_topisto').css({'font-size' : '60px'});
      });

      $(window).scroll(function() {
        if ( window.scrollY > (2200+lastScroll))
        {
            lastScroll = window.scrollY;
            blockchainExplorer.addBottomBlock();
        }
      });

      showInfos();

    });

    function showInfos()
    {
      lastScroll = 0;
      blockchainExplorer.init(parseInt($('#mode_selector').val()), document.getElementById("mode_checkbox").checked);
    }

    function toggleInfos()
    {
      blockchainExplorer.toggleInfos();
    }
  </script>

</head>
<body id="myPage" data-spy="scroll" data-target=".navbar" data-offset="60">

<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle bg-grey" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="index.php">
        <img id="logo_topisto" src="images/topisto_vert.png" style="border-radius:6px;display:inline-block;height:72px;;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19)">
        <span id="titre_topisto" style="vertical-align:text-bottom;display:inline-block;color:black;font-family: Bangers, sans-serif;font-size: 60px;text-shadow: 2px 2px #ffffff">TOPISTO</span>
      </a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="about.php">About</a></li>
        <li><a href="#explorer">Explorer</a></li>
        <li><a href="blog.php">Blog</a></li>
      </ul>
    </div>
  </div>
</nav>

<div id="explorer" class="container-fluid bg-grey navbar-fixed-top" style="padding-bottom:10px">
  <div class="row">
    <div class="col-sm-12 text-right">
      <br><small>An image for each block of the BTC Blockchain</small>
      <br><a href="nft.php">Click here to buy a block as an NFT</a>
      <br><select id="mode_selector" onchange="showInfos()">
        <option value=0>Full Blockchain Explorer</option>
        <option value=1>My special Blocks list</option>
      </select>
      <br>
      <label>show block infos&nbsp;</label><input id="mode_checkbox" type="checkbox" onchange="toggleInfos()">
    </div>
  </div>
</div>

<div id="blockchain" style="position:absolute;top:210px;width:100%"></div>

</body>
</html>
