Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <html>
  <head>
    <title>Restosearch</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link href="style.css" rel="stylesheet" type="text/css">
  </head>
  
   <body>
      <!-- Menu down below -->
    <div class="circle"></div>
    <button class="btn">
      <span class="btn__line"></span>
      <span class="btn__line"></span>
      <span class="btn__line"></span>
    </button>
    <div class="full-menu">
      <div class="layer"></div>
      <nav class="nav">
        <ul class="nav__list">
          <li class="nav__item">
            <a href="#" class="nav__link">
              Home
            </a>
          </li>
          <li class="nav__item">
            <a href="#" class="nav__link">
              About
            </a>
          </li>
          <li class="nav__item">
            <a href="#" class="nav__link">
              Portfolio
            </a>
          </li>
          <li class="nav__item">
            <a href="#" class="nav__link">
              Contacts
            </a>
          </li>
        </ul>
      </nav>
    </div>
    <!-- Menu up above -->
    
    <!-- Input, maps and cards down below -->
    <main>
        <div class="container">
            <div class="box">
                <div>
                    <h2 style="font-size: 5em">Restosearch</h2>
                </div>
            </div> 
        </div>
        <div class="downBox">
                    <input id="pac-input" class="controls" type="text" placeholder="What are you looking for?">
        </div>
        <div id="buttonContainer">
            
            <button class="buttonTwo button1">Add your restaurant</button>
            <div class="textContainer">
                <p class="infoAdd">Click with the right button on the map</p>
            </div>
        </div>
        <div class="divider"></div>
        
        <!-- 2 columns map and cards down below, this section will appear only when you type in the searchbar -->

            <div class="columnsContainer">
          <div class="leftColumn">
            <div class="filterResearch">
              <select name="filter" id="searchFilter">
                <option value="all">Apply a filter</option>
                <option value="1">1 Star</option>
                <option value="2">2 Stars</option>
                <option value="3">3 Stars</option>
                <option value="4">4 Stars</option>
                <option value="5">5 Stars</option>
              </select>
            </div>
            <div id="map"></div>
            <div class="rightColumn" style="margin-top:50px;">
              <div class="card-grid">
                
                
              </div>
            </div>
          </div>
        </div>
        <div class="divider"></div>
        
        <!-- this section will appear only when you click on a card -->
            
        <div class="columnsContainerTwo">
	  	    <div class="leftColumnTwo">
	  	    <img src="https://image.ibb.co/k4SSPK/Spinaci_Green_Dark_Blue.jpg" class="detailPhoto" style="margin-bottom: -50px;">
               <div class="detailInfo">
                   <div class="leftInfoParagraph">
                        <p style="padding-bottom: 40px;" id="addressRestaurant">Address here Address here Address here Address here Address here </p>
                    </div>
                   
	  	            <p class="leftInfoParagraph" style="padding-bottom: 30px;" id="ratingPlace">Rating here</p>
                   
                    <button class="button button1">Add your review</button>
                   
                </div>  		
                <div class="rightColumnTwo">
                    <div class="division"></div>
                    <h2 class="titleRestaurant">Titolo del ristorante qua</h2>
                    <hr>
                    <div class="division"></div>
                    <div class="containerForm">
                          <div id="contact" >
                            <div class="left">
                                <input type="text" name="authName" placeholder="Name" id="authName">
                            </div>
                            <div class="right">
                              <textarea placeholder="Your review here" name="reviewHere" id="reviewHere" required="required"></textarea>
                            </div>
                            <div class="send-button cl">
                              <button type="submit" id="sendButton">Send</button>
                            </div>
                        </div>
                    </div>
                    <section class="cardDetail">
                     
                    </section>
                    <div id="mapA"></div>
                    <div id="pano"></div>
                </div>
            </div>
        </div>
        <!-- Input, maps and cards up above -->
    </main>  
  </body>
  <script
  src="https://code.jquery.com/jquery-3.3.1.js"
  integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
  crossorigin="anonymous"></script>
  <script src="script.js"> </script>
  <script src="https://maps.googleapis.com/maps/api/js?key=MYAPIKEY&libraries=places&callback=initAutocomplete" async defer></script>
</html>
            
          
!

CSS

            
              *, *:before, *:after {
  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}

body.disable-scroll {
  overflow: hidden;
}

@import url('https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,700,700i,900,900i');

* {
  box-sizing:border-box;
}

html{
  margin:0px;
  padding:0px;
  height:100%;
  width:100%;
  font-family: 'Playfair Display', serif;
}

body{
  position:relative;
  height:100%;
  width:100%;
  margin: 0;
  padding: 0;
}
.content {
    display: flex;
    display: -webkit-flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.circle {
    z-index:1000; 
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 95px;
    border-bottom-right-radius: 100%;
    background-color: black;
}


.title {
    margin: 0;
    font-size: 28px;
    letter-spacing: 1px;
    font-weight: 400;
    padding: 0 15px;
}

.btn{
  position:absolute;
  top:20px;
  left:20px;
  background-color:transparent;
  border:0;
  padding:0px;
  z-index:1001;
  cursor:pointer;
}

.btn__line{
  height:2px;
  width:32px;
  display:block;
  background-color: gold;
  transition: all 0.5s;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  -ms-transition: all 0.5s;
  -o-transition: all 0.5s;
  position: relative;
}

.btn__line:nth-child(1){
  left:-4px;
}
.btn__line:nth-child(2){
  left:4px;
}
.btn__line:nth-child(3){
  left:-4px;
}


.btn__line + .btn__line{
  margin-top:6px;
}

.btn:hover .btn__line, .btn--open .btn__line{
  left:0px;
}

.btn--open .btn__line{
  background-color:#fff;
}

.nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    transition: all 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
    opacity: 0;
    display: flex;
    flex-direction: row;
    -webkit-transition: all 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  -moz-transition: all 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  -ms-transition: all 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  -o-transition: all 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  transition: all 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.nav__item--hover{
  opacity: 0.25;
}

.nav__item{
    position:sticky;
}

.full-menu {
    z-index: 10;
  position: fixed;
  top:0;
    width: 100%;
  height:0;
    display: flex;
    justify-content: center;
    align-items: center;
   transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -webkit-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -moz-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -ms-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -o-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
}

.full-menu:before, .full-menu:after{
  content: '';
  height: 0;
   position: fixed;
  top:0;
    width: 100%;
    height: 0;
}

.full-menu:before{
  z-index: -10;
  background-color:darkgrey;
    transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -webkit-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -moz-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -ms-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -o-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
} 

.full-menu:after{
   z-index: -10;
  background-color:black;
    transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -webkit-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -moz-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -ms-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
  -o-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) ;
}



.menu--open:before, .menu--open:after{
  height: 100%;
}

.menu--open:before{
    transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  -webkit-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  -moz-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  -ms-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  -o-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1);
} 

.menu--open:after{
    transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -webkit-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -moz-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -ms-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -o-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
}

.menu--open{
  height:100%;
  transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -webkit-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -moz-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -ms-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -o-transition: height 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
}

.nav__item {
    padding: 0 20px;
  visibility: hidden;
    transition: all 0.4s;
  -webkit-transition: all 0.4s;
  -moz-transition: all 0.4s;
  -ms-transition: all 0.4s;
  -o-transition: all 0.4s;
}

.menu--open .nav__item{
  visibility: visible;
}

.menu--open .nav__list{
  visibilty: visible;
  opacity: 1;
  -webkit-transition: all 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -moz-transition: all 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -ms-transition: all 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  -o-transition: all 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
  transition: all 0.9s cubic-bezier(0.77, 0, 0.175, 1) 0.3s;
}

.nav__link {
    text-decoration: none;
    color: #fff;
    font-size: 30px;
     letter-spacing: 1px;
}

.nav__item:hover {
    transform: scale(1.1, 1.1);
    
}
.nav__item:hover .nav__link{
  font-weight:700;
}

.nav__item-not-hover{
  opacity:0.3;
}

@media screen and (max-width:767px){
  .nav__list{
    flex-direction:column;
    text-align:center;
  }
  .nav__item{
    padding:8px 0;
  }
  
}

@media screen and (max-width:480px){
  .nav__link{
    font-size:26px;
  }
}

/*------------------------- menu up above -------------------------*/

/*------------------------- main content down below -------------------------*/

.container{
    z-index: -1;
    background-image: url(https://image.ibb.co/nayb1z/meat_Orange_And_Dark.jpg);
    background-size: cover;
    display: flex;
    width: 100%; 
    position: relative;
    height: 70%;
}

.downBox {
  margin-top: 30px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

h2{
    font-size: 5vw;
}

.box div {
  text-shadow: 5px 5px 5px black;
  color: white;
  text-align: center;
  width: 50%;
  height: 50%;
}
      
/* ------------------------   google api style, searchbox and map    ----------------------*/

#description {
    font-family: Roboto;
    font-size: 15px;
    font-weight: 300;
}

#infowindow-content .title {
    font-weight: bold;
}

#infowindow-content {
    display: none;      
}

#map #infowindow-content {
    display: inline;
}

.pac-card {
    margin: 10px 10px 0 0;
    border-radius: 2px 0 0 2px;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    background-color: #fff;
    font-family: Roboto;
}

#pac-container {
    padding-bottom: 12px;
    margin-right: 12px;
}

.pac-controls {
    display: inline-block;
    padding: 5px 11px;
}

.pac-controls label {
    font-family: Roboto;
    font-size: 13px;
    font-weight: 300;
}

#pac-input {
    border: 2px solid red;
    border-radius: 5px;
    background-color: #fff;
    font-family: Roboto;
    font-size: 23px;
    font-weight: 300;
    margin-left: 0;
    padding: 0 11px 0 13px;
    text-overflow: ellipsis;
    width: 50%;
}

#pac-input:focus {
    border-color: #4d90fe;
}

#title {
    color: #fff;
    background-color: #4d90fe;
    font-size: 25px;
    font-weight: 500;
   
}
      
#target {      
    width: 345px;      
}

#map {
        height: 100%;
      }
main{
    z-index: -4;
}


.downBox{
    margin-bottom:30px;
}

/* cards and map div here, sidebar right   */ 

/* cards style down below */


.divider{
    height: 5%;
    width: 100%;
    background-color: black;
}

*, *:after, *:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

img {
  max-width:100%;
}

.card-grid {
  width:100%;
}
.card-grid:after {
  content: "";
  display: table;
  clear: both;
}

.card-wrap {
  cursor: pointer;
  clear: both;
  float:left;
  width:100%;
  padding:0px;
}

@media(min-width: 500px){
  .card-wrap {
    width:100%;
  }
}
@media (min-width: 720px) {
  .card-wrap {
    width:100%;
  }
}


.card {
    text-align: center;
  background-color:white;
  border-radius:5px;
  border-bottom:2px solid #ccc;
}
.card > div {
  padding:0;
}


*, *:before, *:after {
  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}

.columnsContainerTwo, .columnsContainer, footer, header { position: relative; margin: 0px; }

.leftColumnTwo, .rightColumnTwo, .leftColumn, .rightColumn, footer, header {padding: 1.25em; height:94%; overflow: auto; overflow-x: hidden;}

.leftColumn, leftColumnTwo{ margin-bottom: .5em; }

.rightColumn{text-align: center;}

.leftColumnTwo{background-color: #ecf0f2;}

.detailInfo{
    
    font-size: 1.5em;
    width: 100%;
    text-align: center;
    height: 100%;
    height: 55%;
    padding-left: 10px;
    padding-right: 10px;
}

.nav {
  list-style: none;
  margin-left: 0;
  margin-bottom: 0;
  padding-left: 0;
}

.nav > li,
.nav > li > a {
  display: inline-block;
  *display: inline;
  zoom: 1;
}

.inline-items {
  margin-top: 0;
}

.inline-items li {
  margin-left: 0;
  border-left: 1px solid black;
  padding-left: 10px;
  padding-right: 10px;
}

.inline-items li:first-child {
  margin-left: 0;
  border: none;
  padding-left: 0;
  padding-right: 10px;
}

.inline-items li:last-child {
  padding-right: 0;
}

/* MEDIA QUERIES */
@media screen and (min-width: 70.5em ) {
  .leftColumn { margin-right: 19.5em; }

	.rightColumn { position: absolute; top: 0; right: 0; width: 18.75em;}
    
    .leftColumnTwo{ margin-right: 65em;}
    
    .rightColumnTwo { position: absolute; top: 0; right: 0; width: 65.15em; height: 100%;}
}



*, *:after, *:before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}


.detailInfo{
    padding-top: 25%;
    height: 50%;
}

img {
  max-width:100%;
}
.photo{
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    
}

.card-wrap{
    border-radius: 10px; 
    box-shadow: 0px 0px 30px 0px;
    margin-bottom: 30px;
}

.titleRestaurant{
    text-shadow: 1px 1px 2px black;
    color:black;
    font-size: 3em;
    margin-top: 20px;
    margin-left: 45px;
    margin-bottom: 10px;
}

.ratePlace{
    padding-bottom: 25px;
}

select{
    width:100%;
}


.filterResearch{
    margin-top:20px;
    margin-bottom:20px;
    margin-left: 79.5%;
    position: absolute;
    height: 20px;
    border: 1px solid black;
    width: 18.5%;
    top:0;
}

hr{
    height: 2px;
    background-color: black;
    box-shadow: 1px 1px 1px black;
    margin-top:0;
    float:left;
    width:30%;
}

.division{
    clear: both;
}


.card-grid {
  text-align:center;
  width:100%;
}
.card-grid:after {
  content: "";
  display: table;
  clear: both;
}

.notSearched {
  display: none;
}

.streetView{
    z-index: 9999999
    height: 300px;
    margin-top: 30px;
    width: 100%;
    border: 1px solid black;
}


#pano{
    margin-top: 40px;
    z-index: 10000;
    float:left;
    width: 100%;
    height: 50%;
}

/* ---------------------- Horizontal scroll down below ----------------*/

.cardDetail {
  display: flex;
  min-width: 100%;
  height: 300px;
  overflow-x: auto;
  overflow-y: hidden;
}

.cardDetail--contentDetail {
  background-color: #ecf0f1;
  min-width: 200px;
  height:270px;
  margin: 5px;
  margin-bottom: 20px;  
  padding: 5px;
  color: #34495e;
  overflow-y:auto;
}

.photoUser{
    height: 50%;
}

/*------------------------ Buttons down below ----------------------- */

.buttonContainer{
    width:100%;
}

.buttonTwo {
    background-color: black; /* Green */
    border: none;
    color: white;
    margin-left:41%;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    margin-bottom: 30px;
    cursor: pointer;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
}

.button1 {
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}


.button {
    background-color: black; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
}

.button1 {
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}

/*------------------------ form for review down below ----------------------- */
.containerForm,{
  position: relative;
  width: 100%;
	padding: 1em;
	margin: auto;
}

.containerFormTwo{
    position: relative;
    width: 50%;
	padding: 1em;
	margin: auto;
}

.containerForm h2{
	text-align: center;
	text-transform: uppercase;
	color: #f55;
}

#contact input[type="text"],#contact input[type="email"], #contact textarea{
	display: block;
	padding: 10px;
	margin: 10px auto;
	width: 100%;
	font-size: 18px;
	color: #777;
  border: 1px solid #ccc;
}

#contact textarea{
	font-size: 16px;
}

#contact input:hover, #contact textarea:hover{
	border: 1px solid #888;
}
#contact input:focus, #contact textarea:focus{
	border: 1px solid #777;
}


#contact textarea{
	max-width: 100%;
	min-width: 100%;
	max-height: 180px;
	min-height: 180px;
  resize: none;
}

#contact .send-button{
	text-align: center;
}

#contact .send-button button[type="submit"]{
	color: #fff;
  background: #e74c3c;
  border: none;
	width: 100%;
	padding: 10px 0;
	font-size: 20px;
	text-transform: uppercase;
	transition: .5s all ease;
  cursor: pointer;
}

#contact .send-button button[type="submit"]:hover{
	background: #c0392b;
}

#contact .send-button button[type="submit"]:focus{
	position: relative;
	top: 2px;
}

.textContainer{
    width:100%;
    text-align: center;
}
            
          
!

JS

            
              $(document).ready(function(){
  var burger = $('.btn');
  var menu = $('.full-menu');
  var navItems =$('.nav__item');
  
  burger.click(function(){
    $(document).toggleClass("disable-scroll");
    burger.toggleClass('btn--open');
    menu.toggleClass('menu--open');
  });
  
  navItems.hover(function(){
    navItems.not($(this)).toggleClass('nav__item--hover');
  });
});

//$(".columnsContainer").hide();

// ---------------- GOOGLE API DOWN BELOW ------------------------

var sectionShow =false; //check for the first section

function initAutocomplete() {
        var map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -33.8688, lng: 151.2195},
          zoom: 13,
          mapTypeId: 'roadmap'
        });
    
        initialize();
    
        google.maps.event.addListener(map, 'rightclick', function(event) {
        placeMarker(event.latLng);
            console.log(event.latLng);
        });

        function placeMarker(location) {
            var marker = new google.maps.Marker({
                position: location, 
                map: map
            });
        }

        // Create the search box and link it to the UI element.
        var input = document.getElementById('pac-input');
        var searchBox = new google.maps.places.SearchBox(input);
        
        // Bias the SearchBox results towards current map's viewport.
        map.addListener('bounds_changed', function() {
          searchBox.setBounds(map.getBounds());
        });

        var markers = [];
        
        // Listen for the event fired when the user selects a prediction and retrieve    
        // more details for that place.
        searchBox.addListener('places_changed', function() {
            
            //check if the first sectin is already Up
            if(!sectionShow){
                $(".columnsContainer").fadeIn();
                sectionShow=true;
            }
            
            //automatic movements of the scroll
            document.querySelector('#map').scrollIntoView({ 
                behavior: 'smooth'         
            });
            
          var places = searchBox.getPlaces();  
          if (places.length == 0) {
            return;
          }
            
            review = [];
            //this jquery line delete the previous card if you start another research 
            $(".card-grid").parent().find('.card-wrap').remove();
          // Clear out the old markers.
          markers.forEach(function(marker) {
            marker.setMap(null);
          });
          markers = [];
            
            
          // For each place, get the icon, name and location.
          var bounds = new google.maps.LatLngBounds();
          places.forEach(function(place) {
            //hai aggiunto bounds, ricorda che stai cercando di passare le coordinate posto per posto.
              
            if (!place.geometry) {
              console.log("Returned place contains no geometry");
              return;
            }
              
              containerPlace=places;
              
            var photos = place.photos;
            if (!photos) {
            return;
            }
    
            var icon = {
              url: place.icon,
              size: new google.maps.Size(71, 71),
              origin: new google.maps.Point(0, 0),
              anchor: new google.maps.Point(17, 34),
              scaledSize: new google.maps.Size(25, 25)
            };
              
              // photo is usefull to store the photo of every place.
              var photo = photos[0].getUrl({'maxWidth': 800, 'maxHeight': 900})
              var title = place.name;
              var rating = place.rating;
              var address = place.formatted_address;
              var idPlace = place.place_id;   
              
              console.log(idPlace);
              
              printCard(photo, title, rating, address, idPlace);
              initMap(idPlace, map);            
                                      
            if (place.geometry.viewport) {
              // Only geocodes have viewport.
              bounds.union(place.geometry.viewport);
            } else {
              bounds.extend(place.geometry.location);
            }
          });
          map.fitBounds(bounds);
        });
     infoWindow = new google.maps.InfoWindow;

        // GeoLocation from Here
        if (navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(function(position) {
            var pos = {
              lat: position.coords.latitude,
              lng: position.coords.longitude
            };
              
            $(".columnsContainer").fadeIn();
            document.querySelector('#map').scrollIntoView({ 
                behavior: 'smooth'         
            });

            infoWindow.setPosition(pos);
            infoWindow.setContent('You are here');
            infoWindow.open(map);
            map.setCenter(pos);
          }, function() {
            handleLocationError(true, infoWindow, map.getCenter());
          });
        } else {
          // Browser doesn't support Geolocation
          handleLocationError(false, infoWindow, map.getCenter());
        }
    
}

      function handleLocationError(browserHasGeolocation, infoWindow, pos) {
        infoWindow.setPosition(pos);
        infoWindow.setContent(browserHasGeolocation ?
                              'Error: The Geolocation service failed.' :
                              'Error: Your browser doesn\'t support geolocation.');
        infoWindow.open(map);
      }

 
function printCard(photoMarker, name, rating, address, idPlace){
        
    let card ="<div class=\"card-wrap\" id=\"" + idPlace + "\"><img src=\"" + photoMarker + " class=\"photo\" style=\"border-top-left-radius: 10px;border-top-right-radius: 10px;\"><div class=\"restoName\"><h3>" + name + "</h3><p class=\"restoAddress\">" + address + "</p><p class=\"ratePlace\">Rating: " + rating + "</p></div></div>";
    
    $(".card-grid").append(card);
}



// these 2 functions below are necessary for the correct function of the street view, in the detailed section downbelow.

var detailSectionShow = false;
    //store the information to print in the detailed section 
$(".columnsContainerTwo").hide();

$(document).on("click", ".card-wrap", function(){
    //check if the section detailed (columnsContainerTwo) is already open
    if(!detailSectionShow){
                $(".columnsContainerTwo").fadeIn();
                detailSectionShow=true;
            }
    
    //move the scroll on the right section
    document.querySelector('.columnsContainerTwo').scrollIntoView({ 
                behavior: 'smooth'         
            });
    
    //save the variable to print
    let restaurant = {
        img: $(this).find("img").attr("src"),
        name: $(this).find("h3").text(),
        address: $(this).find(".restoAddress").text(),
        rating: "Rating: " + $(this).find(".ratePlace").text(),
        id: $(this).attr("id")
    };
    
    printDetailSection(restaurant);
    initialize(restaurant.address);
});

function initMap(idPlace, map) {

    var infowindow = new google.maps.InfoWindow();
    var service = new google.maps.places.PlacesService(map);

    service.getDetails({
      placeId: idPlace
    }, function(place, status) {
      if (status === google.maps.places.PlacesServiceStatus.OK) {
        var marker = new google.maps.Marker({
          map: map,
          position: place.geometry.location
        });
         
        for(let i = 0; i<place.reviews.length; i++){
              let AReview = {
                  author: place.reviews[i].author_name,
                  comment: place.reviews[i].text,
                  relativeTime: place.reviews[i].relative_time_description,
                  rating:place.reviews[i].rating,
              }
              review.push(AReview);
            }
          
          //ricorda di personalizzare l'infowindow e il marker
          console.log(place);
        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent('<div><strong>' + place.name + '</strong><br>' +
            place.formatted_address + '</div>');
          infowindow.open(map, this);
        });
      }
    });
    
  }

let review = [];

function printDetailSection(InfoToPrint){
    $(".detailPhoto").attr("src", InfoToPrint.img);                                         $(".titleRestaurant").text(InfoToPrint.name);
    $("#addressRestaurant").text(InfoToPrint.address);
    $("#ratingPlace").text(InfoToPrint.rating);    
    printReview(review);
}

function removeElement(elementId) {
    var element = document.getElementsByClassName(elementId);
    element.parentNode.removeChild(element);
}

function printReview(review){
    //clean previous reviews
    $(".cardDetail--contentDetail").remove();
    
    let card = "<div class=\"cardDetail--contentDetail\"><p class=\"authorName\">"+ review[0].author +"</p><p class=\"review\">" + review[0].comment + "</p><p class=\"dateOfReview\">"+ review[0].relativeTime +"</p></div>"
        
    for(let i = 0; i<review.length; i++){
        card = "<div class=\"cardDetail--contentDetail\"><p class=\"authorName\">"+ review[i].author +"</p><p class=\"review\">" + review[i].comment + "</p><p class=\"dateOfReview\">"+ review[i].relativeTime +"</p><p class=\"rating\">"+  "</p></div>"
        
        $(".cardDetail").append(card);
    }
}

//Filtersearch function

$("select").on("change", function() {
  let selectedValue = parseInt(this.value, 10) || 0;
    
    $('.card-wrap').removeClass("notSearched");

  if (selectedValue === 0)
    return;

  $('.card-wrap').each(function() {
    let $cardWrap = $(this);
    let rate = $cardWrap.find(".ratePlace").text();
      var str = rate;
      str = str.split(':')[1];
      
      var str1 = str.replace(/:/, "");
      let number = parseInt(str1 || 10);

      $cardWrap.toggleClass('notSearched', number < selectedValue );
  })
});

//streetview down below

function initialize(addressOfPlaceClicked) {

        var geocoder = new google.maps.Geocoder();
        var address = addressOfPlaceClicked;
        geocoder.geocode( { 'address': address}, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK)
      {
          var fenway = {lat:results[0].geometry.location.lat(), lng: results[0].geometry.location.lng()};
      var map = new google.maps.Map(document.getElementById('mapA'), {
        center: fenway,
        zoom: 14
      });
      var panorama = new google.maps.StreetViewPanorama(
          document.getElementById('pano'), {
            position: fenway,
            pov: {
              heading: 34,
              pitch: 10
            }
          });
      map.setStreetView(panorama);
      }
    }); 
}

//review buttons and add new review card down below

//$(".containerForm").hide();

$(".button").click(function(){
   $(".containerForm").fadeIn();
    $(".button").hide();
    $("#sendButton").unbind().click(function(){  
 
    var authorName = $('input#authName').val();
    var review = $('textarea#reviewHere').val();
        
    let card = "<div class=\"cardDetail--contentDetail\"><p class=\"authorName\">"+ authorName +"</p><p class=\"review\">" + review + "</p><p class=\"dateOfReview\">";
    
        if((authorName == "")||(authorName == null) || (review == "")||(review == null)){
      alert('Enter a valid input');
    }
    else{
      $(".cardDetail").append(card);
    }
           $(".containerForm").fadeOut();
  }); 
   $(".button").fadeIn();  
});

//add a restaurant

//cosa fare con la funzione qua sotto? devi trovare il modo di ottenere le coord con un click, successivamente apri il form dove chiedi soltato il nome del ristorante e dopo aggiungi il name al marker. 

//$(".infoAdd").hide();

$(".buttonTwo").unbind().click(function(){
    $(".InfoAdd").fadeIn();
    $(".columnsContainer").fadeIn();
});







            
          
!
999px

Console