<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="favicon.ico" type="image/x-icon">
    <!-- google fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;700&display=swap" rel="stylesheet">
    
    <!-- bootstrap css -->
    <link rel="stylesheet" href="dist/css/bootstrap.min.css" crossorigin="anonymous">
    
    <!-- custom css -->
    <link rel="stylesheet" href="styles.css">

    <!--Font Awesome -->
    <link rel="stylesheet" href="fontawesome-free/css/all.css">
        
    <title>Store-On-The-Go</title>
</head>
<body onload="hide_loading0()">
  <div class="load_div">
    <div class="spinner-border text-info p-4 spin-load" role="status">
      <div class="sr-only">Loading...</div>
    </div>
  </div>
  
  <section class="main-background">
    <section id="header">
        <div class="container-fluid">
            <nav class="navbar navbar-expand-lg">
                <a class="navbar-brand" href="/"><img src="shop.png" alt="" style="width: 40px;"> Store-On-The-Go</a>
                <button
                  class="navbar-toggler"
                  type="button"
                  data-toggle="collapse"
                  data-target="#navbarSupportedContent"
                  aria-controls="navbarSupportedContent"
                  aria-expanded="false"
                  aria-label="Toggle navigation"
                >
                <i class="fas fa-ellipsis-v nav-toggler-icon"></i>
                  <!-- <span class="navbar-toggler-icon"></span> -->
                </button>
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                  <ul class="navbar-nav ml-auto">
                    <li class="nav-item">
                      <a class="nav-link" href="/">Location</a>
                    </li>
                    <li class="nav-item">
                      <a class="nav-link" href="/signup">Sign up</a>
                    </li>
                    <li class="nav-item">
                      <a class="nav-link nav-btn mx-auto" href="/login">Log in</a>
                    </li>
                  </ul>
                </div>
              </nav>
        </div>
    </section>
    <section id="location">
      <div id="stickySearchBar">
      
          <div class="sticky-search-box mx-auto">
              <form method="post" action="/explore" id="wordSubmit">
                <input method="" name="input" action="" class="sticky-input-box search-location" type="text" id="word_input" autocomplete="off" autofocus required
                  placeholder="Search city" />
                <button class="sticky-button" href="" id="searchbtn">
                  <i class="fas fa-search"></i>
                </button>
              </form>
              <script>
                var input = document.getElementById("word_input");
            
                  input.addEventListener("keyup", function (event) {
                  // Number 13 is the "Enter" key on the keyboard
                  if (event.keyCode === 13) {
                    // Cancel the default action, if needed
                    event.preventDefault();
                    // Trigger the button element with a click
                    document.getElementById("searchbtn").click();
                  }
                });
              </script>
              <div class="suggestions"></div>
              
            </div>
          </div>
      <div class="container-fluid">
        
        <div class="row">
          <h1 class="home-h1 col-lg-6 col-md-6 col-sm-6 my-auto">Choose your location</h1>
        </div>
        <div class="row">
          <img src="location.svg" alt="" class="col-lg-6 col-md-6 col-sm-6 ml-auto">
        </div>
      </div>
    </section>
    <section id="cities">
        <div class="container-fluid">
          <div class="row">
            <h1 class="col-lg-6 col-md-6 col-sm-6 my-auto home-h1">Suggested cities</h1>
          </div>
          <% const cities = ["Ahmedabad,Gujarat","Vellore,Tamil Nadu","Vadodara,Gujarat","Pune,Maharashtra","Indore,Madhya Pradesh","Chennai,Tamil Nadu","New Delhi,Delhi","Mumbai,Maharashtra","Neemuch,Madhya Pradesh","Godhra,Gujarat"]%>
          <div class="row">
          <% cities.forEach(element => { %>
              <div class="col-lg-4 col-md-6 cart-item">
                <div class="card mx-auto">
                  <div class="card-body text-left">
                    <a href="#stickySearchBar"><h5 class="card-title suggested-city" onclick="autoFillSuggested(this.innerHTML)"><%= element %></h5></a>
                  </div>
                </div>
              </div>
          <% }); %>
        </div>
        </div>
    </section>
    <section id="footer">
        <div class="container-fluid">
          <p>© Copyright <span id="Copyright"></span> Store-On-The-Go</p>
        </div>
    </section>
  </section>

    <script src="script.js"></script>
    <script src="citySuggestion.js"></script>
    <script src="dist/jquery.slim.min.js" crossorigin="anonymous"></script>
    <script src="core/dist/umd/popper.min.js" crossorigin="anonymous"></script>
    <script src="dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
</body>
</html>