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.

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

              
                <!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="utf-8">
<title>Natural Pasta</title>
<link rel="stylesheet" type="text/css" href="css/style-index.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Google CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- JQuery source file-->
<script language="JavaScript" type="text/javascript" src=js/jquery-index.js></script>
<script
  src="https://code.jquery.com/jquery-3.3.1.js"
  integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
  crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>

</head>
<!--
font-family: 'Lobster', cursive;
font-family: 'Shadows Into Light', cursive;
font-family: 'Varela Round', sans-serif;
font-family: 'Gloria Hallelujah', cursive;
font-family: 'Nunito', sans-serif;
font-family: 'Amatic SC', cursive;
font-family: 'Gorditas', cursive;
-->
<link href="https://fonts.googleapis.com/css?family=Amatic+SC|Gloria+Hallelujah|Gorditas|Lobster|Nunito|Shadows+Into+Light|Varela+Round" rel="stylesheet">
<body>
  <div class="wrapper">

  <!-- Top Menu-->
<a class="burger-nav"></a>
<div class="nav">
  <ul class="navbar-1">
    <li><a href="index.html" target="_self">Home</a></li>
    <li><a href="about-us.html" target="_self">About Us</a></li>
  </ul>
  <img class="top-logo" src="img/np-logo-title-original.png" alt="NP full logo" width="220px" height="220px">

  <ul class="navbar-2" id="menu-dropdown">
    <li><a href="#">Menus</a>
      <ul class="menu">
        <li><a href="#">Pastas To Go</a></li>
        <li><a href="#">Sauces To Go</a></li>
        <li>
          <a href="#">Ready Meals...</a>
              <ul class="sub-menu">
                <li><a href="#">Arancinis</a></li>
                <li><a href="#">Garlic Bread</a></li>
              </ul>
        </li>
      </ul>
    </li>
    <li><a href="#">Find Us</a></li>
  </ul>
</div>
<div class="dropdown"></div>
</div>

<img class="main-banner" src="img/pasta-food-wallpaper-4.jpg" alt="main banner">

<div class="grid-template">
  <div class="box-1"><h2>- SPECIALISING IN -</h2></div>
  <div class="box-2"><img class="specials-img" src="img/freshlyhandmadepastas-1.jpg"></div>
  <div class="box-3"><div class="specials-text"><h3 style="width:280px;">Freshly Hand Made Pastas</h3></div>
  </div>
  <div class="box-4"><div class="specials-text"><h3 style="width:230px;">Gourmet Pasta Meals</h3></div></div>
  <div class="box-5"><img class="specials-img" src="img/gourmetpastameals-3.jpg">
    </div>
  <div class="box-6"><img class="specials-img" src="img/traditionalhomemadesauces.jpg"></div>
  <div class="box-7"><div class="specials-text" id="long-text"><h3 style="width:320px;">Traditional Home Made Sauces</h3></div>
  </div>
  <div class="box-8"><div class="specials-text"><h3 style="width:260px;">Variety of Filled Pastas</h3></div></div>
  <div class="box-9"><img class="specials-img" src="img/varietyoffilledpastas-1.jpeg">
    </div>
  <div class="box-10"><img class="specials-img" src="img/homemadesoups-2.jpg"></div>
  <div class="box-11"><div class="specials-text"><h3 style="width:190px;">Home Made Soups</h3></div>
  </div>
  <div class="box-12"><div class="specials-text"><h3 style="width:150px;">Gourmet Rolls</h3></div></div>
  <div class="box-13"><img class="specials-img" src="img/gourmetroles-1.jpg">
    </div>

</div>

<div class="footer">
  <!--<div class="grid">-->
  <div class="upper-footer-container">

  <div class="footer-container-1">
    <h4 style="font-family: 'Gloria Hallelujah', 'cursive';">Follow Us</h4>
    <ul class="social-networks">
      <li class="flex-items"><a href="#"><img src="img/fb-icon.png"></img></a></li>
  <li class="flex-items"><a href="https://www.instagram.com/naturalpastasydney/?hl=en" target="_blank"><img src="img/instagram-icon.png"></img></a></div></li>
</ul>

  <div class="footer-container-1">
    <h4 style="font-family: 'Gloria Hallelujah', 'cursive';">Opening Hours</h4> <br>
<ul class="contact-details">
  <li>Monday: 9am-5:30pm</li>
  <li>Tuesday: 9am-5:30pm</li>
  <li>Wednesday: 9am-5:30pm</li>
  <li>Thursday: 9am-9pm</li>
  <li>Friday: 9am-5:30pm</li>
  <li>Saturday: 9am-5pm</li>
  <li>Sunday: 10am-5pm</li>
</ul>
  </div>

  <div class="footer-container-1">
    <h4 style="font-family: 'Gloria Hallelujah', 'cursive';">Contact Us</h4> <br>
<ul class="contact-details">
  <li>Add.: 152 Bunnerong Rd, Eastgardens NSW 2036</li>
  <li>No.: (02) 8347 1988</li>
  <li>Email</li>
  <br>
  <li>Catering Available!</li>
</ul>
  </div>
</div>
<div class="lower-footer-container">NaturalPasta &copy; 2018</div>
<!--/div>-->
</div>
</body>
</html>

              
            
!

CSS

              
                * {

}

html {
  height: 100%;
}

body {
  min-height: 100%;
  min-width: 100%;
  margin: 0;
  padding: 0;
}

.wrapper {
  min-height: 190px;
  width: 100%;
  position: relative;
  background-color: #000;
  z-index: 10;
  /* tbc-- decorated bg wbnth (would be nice to have!)
  background-image: url("img/large-bg-rotated.jpg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  */
  display: flex;
  text-align: center;
}

.main-banner {
  z-index: 0;
}

.top-logo {
  position: relative;
  display: inline;
  top: 75px;
}

.nav {
  width: 100%;
  padding: 0 0 31px;
  position: relative;
  font-family: 'Gloria Hallelujah', 'cursive';
  color: #ee6f20;
  font-size: 13pt;
}

.nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  position: relative;
  display: inline;
}

.nav ul li {
  margin: 0.5em 2%;
  display: inline-block;
}

.nav ul li a {
  display: block;
  padding: 5px;
  text-decoration: none;
  color: #ddd;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: dotted;
  border-width: thick;
  border-color: rgb(207,158,65);
}

/* drop-down menu */

#menu-dropdown li ul{
	/*display: none; */
  position: absolute;
  visibility: hidden;
  opacity: 0;
  filter: alpha(opacity=0);
  transition:100ms ease;
  left: 0;
  width: 100px;
}


/*
makes list line up vertically, if not inline
.nav ul ul li {
  display: block;
  background-color: #000;
  min-width: 190px;
}
*/

.main-banner {
  position: relative;
  display: block;
  width: 100%;
  height: 670px;
}

/* GRID CONTENT */

.grid-template {
  margin: 0;
  padding: 0;
  background-color: #000;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-column-gap: 0;
  grid-row-gap: 0;
}

.box-1 {
  height: 550px;
  grid-column-start: 1;
  grid-column-end: 4;
}

h2 {
  text-align: center;
  font-family: 'Gloria Hallelujah', 'cursive';
  letter-spacing: 3px;
  color: #eee;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  border-top: none; /*border */
  border-left: none;
  border-right: none;
  border-bottom: dotted;
  border-width: thick;
  border-color: rgb(207,158,65);
  padding: 0;
  margin: 0 auto;
  width: 70%;
}

.specials-img {
  width: 100%;
  height: 100%;
}

.specials-text {
  text-align: center;
  font-family: 'Gloria Hallelujah', 'cursive';
  color: #eee;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

.specials-text h3 {
  border-top: none; /*border */
  border-left: none;
  border-right: none;
  border-bottom: dotted;
  border-width: thick;
  border-color: rgb(207,158,65);
  width: auto;
  margin: 0 auto;
}

.box-5, .box-9, .box-13 {
  grid-column-start: 2;
  grid-column-end: 4;
}

.box-2, .box-6, .box-10 {
  grid-column-start: 1;
  grid-column-end: 3;
}

/* FOOTER */

.footer {
  bottom: 280px;
  width: 100%;
  text-align: center;
  background: rgb(0,0,0);
  color: white;
  font-family: sans-serif;
  display: flex;
  flex-flow: wrap;
}

.upper-footer-container {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  display: flex;
  flex-wrap: wrap;
}

.footer-container-1 {
  width: 250px;
  display: block;
  margin: 25px;
}

.social-networks {
  list-style: none;
  display: flex;
  flex-direction: row;
  position: relative;
  right: 15px;

}

.flex-items a img {
  width: 50px;
  height: 50px;
  border-radius: 25px;
  margin: 25px;
}

.contact-details {
  list-style: none;
  font-family: 'ubuntu', sans-serif;
}

.contact-details li {
  position: relative;
  right: 10%;
}

.lower-footer-container {
  width: 100%;
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  margin-top: 45px;
}

.dropdown {
  margin: 0;
  padding: 0;
  position: static;
  display: none;
}

/* EFFECTS ABOVE SPECIFIC WIDTH */
@media screen and (min-width:768px) {
  .nav ul li a:hover {
    color: #ee6f20;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: dotted;
    border-width: thick;
    border-color: rgb(207,158,65);
  }

  #menu-dropdown li:hover>ul{
  		/*display: block; */
      visibility:visible;
      opacity:1;
      filter:alpha(opacity=100);
  		position: absolute;
      min-width: 180px;
      background-color: #000;
      border-radius: 10px;
      transition: all 0.5s ease;
  	}

    .sub-menu {
      position: absolute;
      left: 175px !important;
      top: 140px;
    }
}

/* TABLET VIEW */
@media screen and (max-width:768px) {
.top-logo {
  top: 0;
}
.navbar-1 {
  left: 15%;
}
.navbar-2 {
  right: 15%;
}
.main-banner {
  height: 500px;
}
/*Adjustments done to .specials-text */
.box-3 h3 {
  width: 230px !important;
}
.box-4 h3 {
  width: 200px !important;
}
.box-7 h3 {
  width: 250px !important;
}
.box-7 {
  padding: 15px;
}
.box-8 h3 {
  width: 200px !important;
}
}

/* MOBILE VIEW */
@media screen and (max-width:480px) {

/*GRID TEMPLATE */
  .wrapper {
    min-height: 350px; /*350px*/
    float: left;
    margin: 0;
    padding: 0;
    background-color: #000;
    display: grid;
    grid-template-columns: repeat(1,1fr);
    grid-template-rows: repeat(1,1fr);
    grid-column-gap: 0;
    grid-row-gap: 0;
    z-index: 0;
    text-align: none;
  }

  .burger-nav {
    margin: 0;
    padding: 0;
    position: relative;
    display: block;
    height: 40px;
    width: 100%;
    background: url("img/burgernav.png") no-repeat right;
    background-size: 2.5em 2.5em;
    cursor: pointer;
    grid-row-start: 5;
    grid-row-end: 6;
  }
  /* CONSIDER removing .nav ? */
  .nav {
    position: none;
    display: block;
    width: 100%;
    text-align: left;
    padding: 0;
    float: left;
    grid-row-start: 1;
    grid-row-end: 3;
  }
  .top-logo {
    position: relative;
    display: block;
    width: 10em;
    height: 10em;
    margin: 0 auto;
    grid-row-start: 2;
    grid-row-end: 3;
  }

  .nav {
    width: 100%;
    position: absolute;
    font-family: 'Gloria Hallelujah', 'cursive';
    color: #ee6f20;
    font-size: 13pt;
  }

  .nav ul {
    float: left;
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: absolute;
    display: block;
    grid-row-end: 6;
    z-index: 200;
  }

  .nav ul li {
    float: left;
    margin: 0.5em 2%;
    display: block;
  }

/* DISPLAY FOR MOBILE */

#menu-dropdown li ul {
  display: none;
  opacity: 1;
  width: 100%;
  left: auto;
  position: relative;
  padding: 0;
}

.sub-menu {
  position: relative;
  top: auto;
  left: auto !important;
}
/*END*/

  .navbar-1, .navbar-2 {
    padding: 0;
    margin: 0 0 0.3em;
  }

.dropdown li a {
  text-align: center !important;
  font-family: 'Gloria Hallelujah', 'cursive';
}

  .nav ul li a {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: solid;
    border-width: thin;
    border-color: rgb(207,158,65);
  }

  .dropdown ul li a {
    float: none;
    text-decoration: none;
    text-align: left;
    display: block;
    text-decoration: none;
    color: #ddd;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: solid;
    border-width: thin;
    border-color: rgb(207,158,65);
  }

  .dropdown {
    display: block;
    grid-row-start: 6;
    grid-row-end: 7;
  }

/* tbc
img .top-logo {
  position: absolute;
  display: block;
  width: 2em !important;
  height: 2em !important;
}



.wrapper {
  width: 100%;
  padding: 0;
}
.nav {
  position: absolute;
  overflow: hidden;
}
.navbar-1 ul, .navbar-2 ul {
  position: absolute;
  display: hidden;
}
.navbar-1, .navbar-2 {
  height: auto;
}
.navbar-1 ul li, .navbar-2 ul li {
  float: none;
  text-align: left;
  width: 100%;
  margin: 0;
}
.navbar-1 ul li a, .navbar-2 ul li a {
  padding: 10px;
  border-bottom: 1px solid #ee6f20;
  display: block;
  margin: 0;
} */

  /* GRID CONTENT */

.grid-template {
  margin: 0;
  padding: 0;
  background-color: #000;
  display: grid;
  grid-template-columns: repeat(1,1fr) !important;
  grid-column-gap: 0;
  grid-row-gap: 0;
}
.main-banner {
  height: 370px;
}
.box-1 {
  height: 455px;
}
.box-1, .box-2, .box-3, .box-4, .box-5, .box-6,
.box-7, .box-8, .box-9, .box-10, .box-11, .box-12, .box-13 {
  grid-column-start: 1;
  grid-column-end: 4;
}
.specials-text h3 {
  padding: 0 0.5em;
  margin: 0 0.5em;
}
h2 {
  width: 80%;
  font-size: 14pt;
}
.specials-text {
  position: relative;
  justify-content: center;
  height: 300px;
}
.specials-text h3 {
  position: relative;
  text-align: center;
  justify-content: center;
  top: 50%;
  width: 15%;
}
#long-text {
  top: 25% !important;
}

  .box-3 h3 {
    width: auto !important;
    margin: 0 auto;
  }
  .box-4 h3 {
    width: auto !important;
  }
  .box-7 h3 {
    width: auto !important;
  }
  .box-8 h3 {
    width: auto !important;
  }
  .box-11 h3 {
    width: auto !important;
  }
  .box-12 h3 {
    width: auto !important;
  }
}

              
            
!

JS

              
                
//if (window.matchMedia("(max-width: 480px)").matches) {
  /* the viewport is at least 480 pixels wide */
//$( '<div class="specials-text"><h3 style="width:230px;">Gourmet Pasta Meals</h3></div>' ).insertAfter( ".box-5" );
//};

//var windowWidth = $(window).width();
//if(windowWidth > 480){
    // Do stuff here
  //$('<div class="specials-text"><h3 style="width:230px;">Gourmet Pasta Meals</h3></div>' ).insertAfter( ".box-5" );
  //}

// OPTIONS
// ( $(window).width() < 480 )

  $(window).resize(function(){

       if ($(window).width() <= 480) {

              // is mobile device
              $('.box-4' ).insertAfter( ".box-5" );
              // $('.box-4').css('background-color', 'red');
              $(".box-8").insertAfter(".box-9");
              //$(".top-logo").insertBefore(".burger-nav");
              $(".navbar-1, .navbar-2").appendTo(".dropdown");

       }

});

$(window).resize(function(){

     if ($(window).width() <= 480) {

            // is mobile device
            // DROPDOWN MENU
            $("#menu-dropdown li ul").click(function() {
              $(this).toggle();
            })
     }
});

// DROPDOWN MENU
//$(document).on('click', function(){
  //$(".menu").click(function() {
    //$(".sub-c ul:not(.sub-c-c ul)").toggle();
  //});
  //$('body').click(function(e) {
    //  if ($(e.target).closest('.sub-c').length === 0)
      //    $(".sub-c ul").hide();
  //});
//});

//$(document).on('click', function(){
  //$(".sub-c-c").click(function() {
    //$(".sub-c-c ul").toggle();
  //});
  //$('body').click(function(e) {
    //  if ($(e.target).closest('.sub-c').length === 0)
      //    $(".sub-c ul").hide();
  //});
//});

//$('.menu').toggle(
  //  function(){
    //    $(this).css('background-color', '#FFA500');
    //},
    //function(){
      //  $(this).css('background-color', '#000');
    //});
//});

//$(document).on("click", '.menu', function(){
    //$('.menu').removeClass('active');
  //  $(this).addClass('active');
//});

//$(".menu-toggle:not(.sub-c-c ul)").click(function(){
//$(".main").toggleClass("menu.selected");
//})

//function myfunc(button) {
  //var className = div.getAttribute("class");
  //if(className=="menu-toggle") {
    //div.className = "activated";
  //}
  //else{
    //div.className = "menu-toggle";
  //}
//}

function myFunction() {
    var element = document.getElementsByClassName("menu-toggle");
    element.classList.toggle("activated");
}

              
            
!
999px

Console