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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML

              
                

   
  <body>             
    <div class="wrapper">      
      <!-- Encabezado  --> 
      <header class="header">
        <nav>
          <a class="logo" href="#">ATLAS R.B</a>
        </nav>
      </header>    
      <!--Fin Encabezado  -->
      <!--Centro de página --> 
      <div class="middle">    
        <div class="container">
          <main class="content">
						
            <div id="map">
              <script>
                mapboxgl.accessToken = 'pk.eyJ1IjoibWFiZWxpbmUiLCJhIjoiY2twcTF4dGlpMGx0OTJvcWp1Mmh3N2ppYSJ9.ObIvKPSIMpmRdjZUWrOq_A';
                  var map = new mapboxgl.Map({
                  container: 'map',
                  style: 'mapbox://styles/mapbox/satellite-v9',
                  center: [-71.594, -32.992],
                  zoom: 7.87 });
              </script>
                <div id="left" class="sidebar flex-center left collapsed">
									<div class="sidebar-content rounded-rect flex-center">            <h3>Atlas Colaborativo de la Reserva de la Biosfera</h3>
										<p>Este Atlas es parte de las iniciativas de Biogeoart y pretende poner el valor el territorio que habitamos por medio de mapeos colectivos.</p>
                    <div class="sidebar-toggle rounded-rect left" onclick="toggleSidebar('left')" >&rarr;</div>
                    </div>
                </div>
                  <div id="right" class="sidebar flex-center right collapsed">
                    <div class="sidebar-content rounded-rect flex-center">
               <h3 class="h3-right">Colabora con Nosotros</h3>
										<p class="p-right">
											Se parte de Nuestro Atlas, colabora con nosotros por medio de los siguientes formularios: 
											<a href="#" class="button">Form 1</a>
											<a href="#" class="button">Form 2</a>
											<a href="#" class="button">Form 3</a></p>
											
	<div class="sidebar-toggle rounded-rect right" onclick="toggleSidebar('right')" >&larr;</div>
                    </div>            
                  </div>
            </div>
          </main>
        </div>                
      </div>      
      <!--Fin centro página  -->  
      <!--Pie de página  -->  
      <footer class="footer"> 
      </footer>
      <!--Fin Pie de página  -->             
    </div>
  </body> 
</html>          
              
            
!

CSS

              
                html, body{
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}
/*navegación*/
nav{
    overflow: hidden;
    background-color: #161925;
    -webkit-box-shadow: 0px 2px 5px 0px rgba(100, 100, 100, 1);
    -moz-box-shadow: 0px 2px 5px 0px rgba(100, 100, 100, 1);
    box-shadow: 0px 2px 5px 0px rgba(100, 100, 100, 1);
}
nav a {
    float: left;
    color: #f2f2f2;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
}
nav a:hover {
    background-color: #8EA8C3;
    color: black;
}

/*left sidebar*/
.rounded-rect {
    background: white;
    border-radius: 4px;
    box-shadow: 0 0 50px -25px black;
}  
.flex-center {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
} 
h3{
	margin-right: 10px;
	margin-left: 15px;
	margin-bottom: 340px;
}
p{
	font-size: 14px;
	margin-left: -130px;
	margin-right: 10px;
	margin-bottom: 100px;
}
.p-right{
	font-size: 14px;
	margin-left: -90px;
	margin-right: 10px;
	margin-bottom: 0px;
}
.h3-right{
	margin-right: 10px;
	margin-left: 15px;
	margin-bottom: 360px;
}

.button{
	display:block;
	border-radius:5px;
	text-decoration:none;
	text-align:center;
	background-color: #161925;
  color: white;
  padding: 15px;
	margin:10px;
}
.button:hover {
    background-color: #8EA8C3;
    color: black;
}
.flex-center.left {
    left: 0px;
}
.flex-center.right {
    right: 0px;
}
.sidebar-content {
    position: absolute;
    width: 95%;
    height: 95%;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
	  color: gray;
}
.sidebar-toggle {
    position: absolute;
    width: 1.3em;
    height: 1.3em;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}
.sidebar-toggle.left {
    right: -1.5em;
}
.sidebar-toggle.right {
    left: -1.5em;
}
.sidebar-toggle:hover {
    color: #0aa1cf;
    cursor: pointer;
}
.sidebar {
    transition: transform 1s;
    z-index: 1;
    width: 300px;
    height: 100%;
}
.left.collapsed {
    transform: translateX(-295px);
}
.right.collapsed {
    transform: translateX(295px);
}
/*mapa*/
#map {
    width: 100%;
    height: calc(100vh - 48px);
}
/*Footer*/
footer{
background-color: #161925;
}
              
            
!

JS

              
                //sidebar
function toggleSidebar(id) {
    var elem = document.getElementById(id);
    var classes = elem.className.split(' ');
    var collapsed = classes.indexOf('collapsed') !== -1;
  
    var padding = {};
  
        if ( collapsed ){
			classes.splice(classes.indexOf('collapsed'), 1);
            // In px, matches the width of the sidebars set in .sidebar CSS class
            padding[id] = 300; 
            map.easeTo({
            padding: padding,
            duration: 1000 
            // In ms, CSS transition duration property for the sidebar matches this value
            });
        } 

        else {
            padding[id] = 0;
           // Add the 'collapsed' class to the class list of the element
            classes.push('collapsed');

            map.easeTo({
                padding: padding,
                duration: 1000
                });
        }
    // Update the class list on the element
    elem.className = classes.join(' ');
} 
map.on( 'load', function () {
    toggleSidebar('left');
});
//data
              
            
!
999px

Console