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

              
                <div class="menu">
  <h1> Pushki's Cafe </h1>
  <h2 class="menuType"> Breakfast Menu </h2>
  <div class="closed">
    <h2> Sorry, the kitchen is currently closed  </h2>
  </div>
  <div class="options">
    <article>
      <div class="title">
        <span class="menuItem">Item One</span>
        <span class="price">£17.99</span>
      </div>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem rerum ratione illo tempore veritatis earum fuga, explicabo, nulla sunt, expedita libero. Eveniet porro ea labore, non excepturi quaerat totam impedit.
      </p>
    </article>
    <article>
      <div class="title">
        <span class="menuItem">Item One</span>
        <span class="price">£17.99</span>
      </div>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem rerum ratione illo tempore veritatis earum fuga, explicabo, nulla sunt, expedita libero. Eveniet porro ea labore, non excepturi quaerat totam impedit.
      </p>
    </article>
    <article>
      <div class="title">
        <span class="menuItem">Item One</span>
        <span class="price">£17.99</span>
      </div>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem rerum ratione illo tempore veritatis earum fuga, explicabo, nulla sunt, expedita libero. Eveniet porro ea labore, non excepturi quaerat totam impedit.
      </p>
    </article>
    <article>
      <div class="title">
        <span class="menuItem">Item One</span>
        <span class="price">£17.99</span>
      </div>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem rerum ratione illo tempore veritatis earum fuga, explicabo, nulla sunt, expedita libero. Eveniet porro ea labore, non excepturi quaerat totam impedit.
      </p>
    </article>
    <article>
      <div class="title">
        <span class="menuItem">Item One</span>
        <span class="price">£17.99</span>
      </div>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem rerum ratione illo tempore veritatis earum fuga, explicabo, nulla sunt, expedita libero. Eveniet porro ea labore, non excepturi quaerat totam impedit.
      </p>
    </article>
    <article>
      <div class="title">
        <span class="menuItem">Item One</span>
        <span class="price">£17.99</span>
      </div>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem rerum ratione illo tempore veritatis earum fuga, explicabo, nulla sunt, expedita libero. Eveniet porro ea labore, non excepturi quaerat totam impedit.
      </p>
    </article>
  </div>
</div>
              
            
!

CSS

              
                body {
  font-family:'Source Sans Pro';
}

h1{
  font-size: 40px; 
  text-align: center;
  font-weight: bold; 
  padding-bottom: 3%;
}
h2{
  text-align: center;
  font-weight: bold; 
  padding-bottom: 2%;
}
.closed{
  visibility:hidden;
}
.options{
  visibility: visible;
}
.menu {
  position:relative;
  margin:100px auto;
  width:90%;
  max-width:1024px;
}
.title {
  position:relative;
  padding:10px;
  font-size:19px;
  font-weight:700;
}
.title span {
  position:relative;
  background:#fff;
  padding:0 15px 0 0;
}
.title .price {
  float:right;
  padding:0 0 0 15px;
}
.title:before {
  position:absolute;
  top:50%;
  left:10px;
  right:10px;
  height:1px;
  border-top:2px dotted rgba(0,0,0,0.3);
  display:block;
  content:'';
}
@media (min-width:420px) {
  article {
    width:50%;
    float:left;
  }
}
article p {
  margin:0;
  padding:0 10px 10px;
}
              
            
!

JS

              
                // In this project, you will update the menu of the restaraunt Pushki's Cafe depending on the time of day

// The restaurant serves customers breakfast, lunch, and dinner, and the kitchen takes breaks in between to clean and prepare the food options for the next meal

// Breakfast is served from 6:00 AM to 10:00 AM, and then the kitchen closes for 1 hour to prepare for lunch

// Lunch is served from 11:00 AM to 3:00 PM and then the kitchen closes for 1 hour to prepare for dinner

// Dinner is served from 4:00 PM to 10:00 PM, then the kitchen closes for the day.

// You can see the menu for Pushki's Cafe in the result pane. The menu name under the title Pushki's Cafe will change with the menu items

// Depending on the current time, display the correct menu by replacing the h2 indicating which meal is currently being served, and which dishes are available

// Implement a series of conditional statements to check the time, and adjust the menu accordingly

// For example, if the current time is between 4:30 and 10:30 PM, the page should display "Dinner Menu" and the items should be replaced with the elements of the dinner menu array instead of "item one"

// If the kitchen is closed, remove the menu from the page by disabling the view of the "options" div and displaying the div with the class "closed"

// When the kitchen opens again, disable the display of the "closed" div and redisplay the "options" div

// Below are the arrays containing the dishes offered for each meal:

let breakfastMenu = ["Chicken and Waffles","Pancake Platter","Breakfast Feast","Garden Omelette and Fruit","French Toast","Shrimp & Grits"];
let lunchMenu = ["Shrimp Mac & Cheese","Steak Quesadilla","Smoked Turkey & Brie Panini","Walnut Spinach Cranberry Salad","Chicken Pot Pie","Rueben Croissant"];
let dinnerMenu = ["Muffaletta: Half or Whole","Crawfish Etoufée","Stuffed Shrimp","Blackened Salmon","Jalepeño Bacon Burger","Red Beans & Rice w/ Sausage"];

// First store all of the HTML elements you will need to access to complete the project (hint: 4 variables needed)
// (hint: you only need 1 variable to store all 6 HTML menu items that will be replaced. Think about which method selects all of the elements matching the class)
// Note: only the spans containing the text 'Item One' will be replaced with the names of the dishes; don't worry about the lorem ipsum item description or the item's price



// Next create a time object representing the current time, and implement conditional statements for the times given
// Remember that during the time the kitchen is cleaning and prepping for the next meal, the menu should not be displayed on the site,
// instead the div stating "Sorry, the kitchen is currently closed" should be displayed, and then removed when the kitchen reopens and replaced with the next menu

// Within the conditional statements for the different meal's time windows, replace the menu items with the appropritate array's elements
	
// Note that you'll probably only edit this codepen during certain hours, so whichever function is currently executing depending on the current time can be used to test that your other functions work by replacing the code temporarily to make the function execute since it will only execute at a specific time otherwise

              
            
!
999px

Console