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

              
                


    <!--HERO SECTION-->
<div class="container"><!--MAIN HERO CONTAINER-->



<nav class="navigation">  <!--MAIN NAV CONTAINER-->

  <!---------HIDDEN NAV CONTAINER ---->
  <div id="navBackground" class="navClose">


   <ul id="navcontent">
     <li>HOME</li>
     <li>ABOUT</li>
     <li>FAQ</li>
     <li>CONTACT</li>
   </ul>

</div>


<nav id="navigation">
  <div class="hamburger" onclick="navFunction()">
      <div class="line"></div>
      <div class="line"></div>
      <div class="line"></div>
    </div>
</nav>


<!---------HIDDEN NAV CONTAINER END ---->

    <img id="logo" src="https://i.postimg.cc/g05mzPvB/logo.png">

<ul class="navLinks">
<li class="links">HOME</li>
<li class="links">ABOUT</li>
<li class="links">FAQ</li>
<li class="links">CONTACT</li>
</ul>


</nav> <!--MAIN NAV CONTAINER END-->




<div class="heroText">
    <h1>Solar saves<br>
         You money</h1>
    <div class="container">
    <input type="text" class="zipCode" placeholder="Zip Code">
    <button id="button">enter</button>
    
    </div> <!--CONTAINER FOR INPUT & BUTTON-->
    </div> <!--CONTAINER FOR TEXT-->
<div class="overlay"></div>
<div class="imageContainer"></div> <!--HERO IMAGE VIA CSS-->


</div> <!--MAIN HERO CONTAINER END-->
  <!--HERO SECTION END-->



  <!--CONTENT SECTION-->
<div class="container">
   <div class="contentText">
    

<hr id="bar">

<div class="slide">
<h1 id="missionStatement"> Our Mission</h1>
<p id="contentTextParagraph" class="appear">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
</p>
</div>
   </div>

    <div class="content2">
        

        <img id="contentImage" src="https://i.postimg.cc/gkPcLd1C/content-Image.jpg">
        
    </div>
    
</div>
  <!--CONTENT SECTION END-->
<!--FOOTER SECTION-->
<div class="footer">
<div class="footerBlock" id="block1"></div>
<div class="footerBlock" id="block2"></div>
<div class="footerBlock" id="block3"></div>
<div class="footerBlock" id="block4"></div>

</div>
  

    <script src="app.js"></script>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

.container {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.navigation {
  position: relative;
  background-color: rgb(16, 21, 63);
  height: 15%;
  width: 100%;
  z-index: 5;
}

#logo {
  margin-top: 1em;
  margin-left: 2em;
  width: 20vh;
  height: 10vh;
}

.navLinks {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin: auto;
  margin-left: 18em;
  margin-top: -1em;
  width: 70vw;
}

/*for hidden Navigation*/
#navcontent {
  display: none;
}
.links {
  color: white;
  text-decoration: none;
  font-size: 20px;
  list-style: none;
  cursor: pointer;
  transition: all 0.5s ease;
}

.links:hover {
  color: gold;
}

.overlay {
  position: absolute;
  background: rgba(0, 0, 0, 0.3);
  background-size: cover;
  background-position: center;
  height: 100%;
  width: 100%;
  z-index: 1;
}

.imageContainer {
  position: relative;
  background-image: url(https://i.postimg.cc/P55j1qyR/houseimage.jpg);
  background-size: cover;
  background-position: center;
  height: 100%;
  width: 100%;
  animation: scale 15s;
}

@keyframes scale {
  0% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
  }
}

.heroText {
  display: flex;
  color: white;
  font-size: 30px;
  justify-content: center;
  align-items: left;
  flex-direction: column;
  position: absolute;
  margin-left: 2em;
  margin-top: 10em;
  z-index: 5;
}

.zipCode {
  height: 25px;
  padding: 10px;
}

#button {
  height: 30px;
  width: 60px;
  font-size: 12px;
  background-color: white;
  border-radius: 10px;
  border: none;
  box-shadow: none;
  cursor: pointer;
}

.content2 {
  display: flex;
  position: relative;
  background-color: rgb(9, 10, 24);
  height: 100%;
  width: 100%;
}

#bar {
  display: static;
  position: absolute;
  margin-top: -3.6em;
  height: 10px;
  width: 70%;
  background-color: white;
}

#missionStatement {
  display: flex;
  position: absolute;
  z-index: 5;
  color: gold;
  width: 700px;
  font-size: 50px;
  margin-left: 0em;
  margin-top: -3.5em;
}

.contentText {
  display: flex;
  position: absolute;
  z-index: 5;
  color: gold;
  width: 600px;
  font-size: 30px;
  margin-left: 2em;
  margin-top: 13em;
}

.slide {
  transform: translateX(-200%);
  transition: transform 1s ease;
}

.appear {
  transform: translateX(0%);
}
#contentImage {
  position: relative;
  height: 50%;
  width: 40%;
  margin-top: 13em;
  margin-left: 52em;
  border-radius: 10px;
  z-index: 1;
}

/*BOTTOM FOOTER BLOCKS*/
.footer {
  display: flex;
  position: relative;
  height: 5vh;
  width: 100%;
  overflow: hidden;
}

.footerBlock {
  display: flex;
  flex-direction: row;
  position: relative;
  width: 100%;
  height: 100%;
}

#block1 {
  background-color: gold;
}

#block2 {
  background-color: rgb(219, 44, 132);
}

#block3 {
  background-color: rgb(56, 41, 83);
}

#block4 {
  background-color: rgb(86, 143, 140);
}

/*-------------MEDIA QUERIES-------------*/

@media screen and (max-width: 600px) {
  /*---------HIDDEN NAVIGATION----*/

  .hamburger {
    
    display: flex;
    position: absolute;
    flex-direction: column;
    cursor: pointer;
    width: 50px;
    margin-top: 20px;
    margin-left: 85vw;
    padding-top: 10px;
    z-index: 20;
  }

  .line {
    display: flex;
    width: 35px;
    height: 6px;
    background-color: white;
    margin: 5px;
    border-radius: 10px;
    z-index: 5;
    transition: all 0.5s ease;
  }

  #navBackground {
    position: fixed;
    display: flex;
    align-content: center;
    justify-content: center;
    color: white;
    font-family: sans-serif;
    font-size: 20px;
    background-color: rgb(16, 21, 63);
    width: 600px;
    height: 100%;
    
    z-index: 10;
    transition: all 1s ease;
  }

  .navClose {
    position: fixed;
    display: flex;
    align-content: center;
    justify-content: center;
    color: white;
    font-family: sans-serif;
    font-size: 20px;
    background-color: rgb(16, 21, 63);
    width: 600px;
    height: 100%;
    margin-left: 70em;
    z-index: 10;
    transition: all 1s ease;
  }

  #navcontent {
    display: flex;
    height: 50%;
    align-items: center;
    align-content: center;
    justify-content: center;
    margin-top: 10em;
    flex-direction: column;
    justify-content: space-between;
    list-style: none;
    cursor: pointer;
  }

  /*---------HIDDEN NAVIGATION END----*/

  .navLinks {
    display: none;
    flex-direction: row;
    justify-content: space-between;
    margin: auto;
    margin-left: 18em;
    margin-top: -1em;
    width: 70vw;
  }

  .heroText {
    display: flex;
    color: white;
    font-size: 40px;
    justify-content: center;
    align-items: left;
    flex-direction: column;
    position: absolute;
    margin-left: 1em;
    margin-top: 2em;
    z-index: 3;
  }

  .zipCode {
    margin-left: 1em;
    height: 25px;
    padding: 10px;
  }

  #button {
    height: 30px;
    width: 60px;
    font-size: 12px;
    background-color: white;
    border-radius: 10px;
    border: none;
    box-shadow: none;
    cursor: pointer;
  }

  #bar {
    display: static;
    position: absolute;
    margin-top: -3.6em;
    height: 10px;
    width: 80%;
    background-color: white;
  }

  .contentText {
    display: flex;
    position: absolute;
    z-index: 5;
    color: gold;
    width: 300px;
    font-size: 25px;
    margin-left: 2em;
    margin-top: 10em;
  }

  #contentImage {
    display: none;
    position: relative;
    height: 50%;
    width: 40%;
    margin-top: 13em;
    margin-left: 52em;
    border-radius: 10px;
    z-index: 1;
  }
}

/*-------------MEDIA QUERIES END-------------*/
              
            
!

JS

              
                
let navCounter = 0;


const navBackground = document.getElementById("navBackground");

const hamburgerLines = document.getElementsByClassName("line");
const contentText = document.querySelector(".slide");

/*-----HIDDEN NavFunction*/


function navFunction (){
  
navCounter ++;

navBackground.classList.toggle("navClose");

/* Prevent scroll */

function disableScrolling(){
  var x=window.scrollX;
  var y=window.scrollY;
  window.onscroll=function(){window.scrollTo(x, y);};
}

disableScrolling();

function enableScrolling(){
  window.onscroll=function(){};
}

if(navCounter % 2 == 0){

  enableScrolling();
}

    
  

   /* if (document.getElementById("navBackground").style.marginLeft="0em") {

        document.getElementById("navBackground").style.marginLeft="30em";
    };*/
  /*const hamburger = document.getElementsByClassName("hamburger");


  hamburger.classlist.toggle("navClose");*/
  
}





//Sliding Text Functionality 
window.addEventListener("scroll",easeContent);

easeContent();

function easeContent(){
const bottomOfPage = window.innerHeight * 0.9;


    const topOfContent= contentText.getBoundingClientRect().top
    if(topOfContent> bottomOfPage){

       contentText.classList.remove("appear")
    }else{

        contentText.classList.add("appear")
    }
}


              
            
!
999px

Console