Tutorial Store Locator - Structure

by woosmap

HTML

<div id="main">
  <div id="my-map-container">
    <div id="my-map" style="padding:40px">MAP</div>
  </div>
  <div id="sidebar-container">
    <div id="sidebar" style="padding:40px">SIDEBAR</div>
  </div>
</div>

CSS

#main {
  display: flex;
  position: absolute;
  flex-direction: column;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#my-map-container {
  display: flex;
  flex-grow: 0;
  height: 55vh;
  position: relative;
}

#my-map {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #CCC;
}

#sidebar-container {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  flex-grow: 1;
  flex-basis: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 -2px 4px 0 rgba(0, 0, 0, 0.12);
}

#sidebar {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

@media (min-width: 650px) {
  #main {
    flex-direction: row;
    height: 100%;
  }

  #my-map-container {
    flex-basis: 70vw;
    order: 2;
    position: relative;
    height: 100%;
  }

  #sidebar-container {
    flex-basis: 30vw;
    min-width: 300px !important;
    max-width: 500px !important;
    order: 1;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    -webkit-box-flex: 0;
    flex-grow: 0;
    height: 100%;
  }
}