<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Molecules</title>
    <link
      rel="stylesheet"
      href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
    />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
    <script src="https://cdn.lordicon.com/libs/mssddfmo/lord-icon-2.1.0.js"></script>
    <link rel="stylesheet" href="/css/molecules.css" />
    <link rel="stylesheet" href="/css/footer.css">
    <link rel="stylesheet" href="/css/navbarfinal.css">
  </head>

  <body>
    <script src="../public/js/navbar.js"></script>
      <nav class="navbar navbar-expand-custom navbar-mainbg">
        <img src="/assets/o2.png" style="width: 30px; height: 30px; margin-left: 10px;">
        <a class="navbar-brand navbar-logo" href="#">ChemStudy</a>  
        <button
          class="navbar-toggler"
          type="button"
          aria-controls="navbarSupportedContent"
          aria-expanded="false"
          aria-label="Toggle navigation"
        >
          <i class="fas fa-bars text-white"></i>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
          <ul class="navbar-nav ml-auto">
            <div class="hori-selector">
              <div class="left"></div>
              <div class="right"></div>
            </div>
            <li class="nav-item">
              <a class="nav-link" href="/"
                ><i class="fas fa-tachometer-alt"></i>Dashboard</a
              >
            </li>
            <li class="nav-item active">
              <a class="nav-link active" href="/chapter"
                ><i class="far fa-address-book"></i>Chapters</a
              >
            </li>
            <li class="nav-item">
              <a class="nav-link" href="/quiz"
                ><i class="far fa-clone"></i>Quiz</a
              >
            </li>
            <li class="nav-item">
              <a class="nav-link" href="/contact"
                ><i class="far fa-calendar-alt"></i>Contact US</a
              >
            </li>
          </ul>
        </div>
      </nav>
    <div>
      <ul class="cards">
        <li>
          <a href="" class="card" style="border: none">
            <iframe
              style="width: 100%; height: 520px"
              frameborder="0"
              src="https://embed.molview.org/v1/?mode=balls&cid=3015637&bg=black"
            ></iframe>

            <div class="card__overlay">
              <div class="card__header">
                <div class="card__header-text">
                  <h3 class="card__title">
                    <p class="lead">Ester aldehyde</p>
                  </h3>
                  <p>
                    <b>IUPAC Name : methyl ethanoate </b>
                    <br />
                    <b>Molecular Formula : CH3COOCH3 </b>
                  </p>
                </div>
              </div>
            </div>
          </a>
        </li>
        <li>
          <a href="" class="card" style="border: none">
            <iframe
              style="width: 100%; height: 520px"
              frameborder="0"
              src="https://embed.molview.org/v1/?mode=balls&cid=62348&bg=black"
            >
          </iframe>

            <div class="card__overlay">
              <div class="card__header">
                <div class="card__header-text">
                  <h3 class="card__title">
                    <p class="lead">Vanilin</p>
                  </h3>
                  <p>
                    <b>IUPAC Name : 4-hydroxy-3-methoxybenzaldehyde
                    
                       </b>
                    <br />
                    <b>Molecular Formula : C8H8O3 </b>
                  </p>
                </div>
              </div>
            </div>
          </a>
        </li>
        <li>
          <a href="" class="card" style="border: none">
            <iframe
              style="width: 100%; height: 520px"
              frameborder="0"
              src="https://embed.molview.org/v1/?mode=balls&cid=6998&bg=black"
            ></iframe>

            <div class="card__overlay">
              <div class="card__header">
                <div class="card__header-text">
                  <h3 class="card__title">
                    <p class="lead">Salicylaldehyde</p>
                  </h3>
                  <p>
                    <b>IUPAC Name : 2-hydroxybenzaldehyde</b>
                    <br />
                    <b>Molecular Formula : C7H6O2 </b>
                  </p>
                </div>
              </div>
            </div>
          </a>
        </li>
        <li>
          <a href="" class="card" style="border: none">
            <iframe
              style="width: 100%; height: 520px"
              frameborder="0"
              src="https://embed.molview.org/v1/?mode=balls&cid=307&bg=black"
            ></iframe>

            <div class="card__overlay">
              <div class="card__header">
                <div class="card__header-text">
                  <h3 class="card__title">
                    <p class="lead">Cinnamaldehyde</p>
                  </h3>
                  <p>
                    <b>IUPAC Name : (E)-3-phenylprop-2-enal </b>
                    <br />
                    <b>Molecular Formula : C9H8O
                    </b>
                  </p>
                </div>
              </div>
            </div>
          </a>
        </li>
      </ul>
    </div>
    <div class="button1">
      <a href="/chapter"><button type="button" class="btn btn-primary" >Back to Chapters</button></a>
    </div>
    <footer class="footer-20192">
      <div class="site-section">
        <div class="container">
          <div class="cta d-block d-md-flex align-items-center px-5">
            <div>
              <h2 class="mb-0">Ready for a next project?</h2>
              <h3 class="text-dark">Let's get started!</h3>
            </div>
            <div class="ml-auto">
              <a href="/contact" class="btn btn-dark rounded-0 py-3 px-5">Contact us</a>
            </div>
          </div>
          <div class="row">
            <div class="col-sm">
              <a href="/" class="footer-logo">ChemStudy</a>
              <p class="copyright">
                <small>&copy; 2019</small>
              </p>
            </div>
            <div class="col-sm">
              <h3>Customers</h3>
              <ul class="list-unstyled links">
                <li><a href="#">Buyer</a></li>
                <li><a href="#">Supplier</a></li>
              </ul>
            </div>
            <div class="col-sm">
              <h3>Company</h3>
              <ul class="list-unstyled links">
                <li><a href="#">About us</a></li>
                <li><a href="#">Careers</a></li>
                <li><a href="/contact">Contact us</a></li>
              </ul>
            </div>
            <div class="col-sm">
              <h3>Further Information</h3>
              <ul class="list-unstyled links">
                <li><a href="#">Terms &amp; Conditions</a></li>
                <li><a href="#">Privacy Policy</a></li>
              </ul>
            </div>
            <div class="col-md-3">
              <h3>Follow us</h3>
              <ul class="list-unstyled social">
                <li>
                  <a href="#"><span class="icon-facebook"></span></a>
                </li>
                <li>
                  <a href="#"><span class="icon-twitter"></span></a>
                </li>
                <li>
                  <a href="#"><span class="icon-linkedin"></span></a>
                </li>
                <li>
                  <a href="#"><span class="icon-medium"></span></a>
                </li>
                <li>
                  <a href="#"><span class="icon-paper-plane"></span></a>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </footer>    
  </body>
  <script>
    function test() {
      var tabsNewAnim = $("#navbarSupportedContent");
      var selectorNewAnim = $("#navbarSupportedContent").find("li").length;
      var activeItemNewAnim = tabsNewAnim.find(".active");
      var activeWidthNewAnimHeight = activeItemNewAnim.innerHeight();
      var activeWidthNewAnimWidth = activeItemNewAnim.innerWidth();
      var itemPosNewAnimTop = activeItemNewAnim.position();
      var itemPosNewAnimLeft = activeItemNewAnim.position();
      $(".hori-selector").css({
        top: itemPosNewAnimTop.top + "px",
        left: itemPosNewAnimLeft.left + "px",
        height: activeWidthNewAnimHeight + "px",
        width: activeWidthNewAnimWidth + "px",
      });
      $("#navbarSupportedContent").on("click", "li", function (e) {
        $("#navbarSupportedContent ul li").removeClass("active");
        $(this).addClass("active");
        var activeWidthNewAnimHeight = $(this).innerHeight();
        var activeWidthNewAnimWidth = $(this).innerWidth();
        var itemPosNewAnimTop = $(this).position();
        var itemPosNewAnimLeft = $(this).position();
        $(".hori-selector").css({
          top: itemPosNewAnimTop.top + "px",
          left: itemPosNewAnimLeft.left + "px",
          height: activeWidthNewAnimHeight + "px",
          width: activeWidthNewAnimWidth + "px",
        });
      });
    }
    $(document).ready(function () {
      setTimeout(function () {
        test();
      });
    });
    $(window).on("resize", function () {
      setTimeout(function () {
        test();
      }, 500);
    });
    $(".navbar-toggler").click(function () {
      $(".navbar-collapse").slideToggle(300);
      setTimeout(function () {
        test();
      });
    });

    // --------------add active class-on another-page move----------
    jQuery(document).ready(function ($) {
      // Get current path and find target link
      var path = window.location.pathname.split("/").pop();

      // Account for home page with empty path
      if (path == "") {
        path = "index.ejs";
      }

      var target = $('#navbarSupportedContent ul li a[href="' + path + '"]');
      // Add active class to target link
      target.parent().addClass("active");
    });
  </script>
</html>
