css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <main>
  <div class="inner">
    
    <h2>
      Pickup
    </h2>
    
    <h1>
      Date &amp; Time
    </h1>
    
    <form
      id="date-and-time" 
		  class="date-and-time" 
		  method=""
    >
      
      <!-- Date -->
      <span 
        class="date-wrapper select-wrapper faux-select"
      >

        <!-- Pickup Date - Select -->
        <select 
          id="pickup-date-select" 
          class="pickup-date-select select faux-select" 
          data-placeholder-name="&#40; Choose your pick up date &#41;" 
          size="1" 
        >

          <!-- Dynamically populate the date options,
          adding Today, and 6 weeks into the future -->

        </select>


        <!-- Date - faux-select element, 
        can render inline or block  -->
        <a 
          id="date-rendered" 
          class="date-rendered faux-select-rendered" 
          tabindex="-1"
          href="#" 
        >
          <!-- Match the default DATE value here to the 
          default selected <option> element above -->
          Today</a
        >

      </span>
      <!-- / Date -->
      
      <br/>
      
      <!-- text -->
      <span 
        class="text" 
      >
        at
      </span>
      
      <!-- Time -->
      <span 
        class="time-wrapper select-wrapper faux-select"
      >

        <!-- Pickup Time - Select -->
        <select 
          id="time-select" 
          class="time-select select" 
          data-placeholder-name="&#40; Choose your pick up time &#41;" 
          size="1" 
        >
          
          <!-- 
            NOTE: ideal state would be 
            to populate the options  
            below dynamically with shop  
            hours for the specific date  
            the customer selects. Typically  
            this is governed by the day of 
            the week.

            Hard coding for now.

            Demo hours: 11:00 am - 11:00 pm
          -->
          

          <!-- Tool Tip, disabled option -->
          <option 
            value="" 
            disabled 
          >
            Choose your pick up time
          </option>


          <option disabled></option>


          <option 
            value="11:00 am"
          >11:00 am</option>
          <option 
            value="11:15 am"
          >11:15 am</option>
          <option 
            value="11:30 am"
          >11:30 am</option>
          <option 
            value="11:45 am"
          >11:45 am</option>


          <option disabled></option>


          <option 
            value="12:00 pm" 
          >12:00 pm</option>
          <option 
            value="12:15 pm" 
          >12:15 pm</option>
          <option 
            value="12:30 pm" 
          >12:30 pm</option>
          <option 
            value="12:45 pm" 
          >12:45 pm</option>


          <option disabled></option>


          <option 
            value="1:00 pm" 
          >1:00 pm</option>
          <option 
            value="1:15 pm" 
          >1:15 pm</option>
          <option 
            value="1:30 pm" 
          >1:30 pm</option>
          <option 
            value="1:45 pm" 
          >1:45 pm</option>


          <option disabled></option>


          <option 
            value="2:00 pm" 
          >2:00 pm</option>
          <option 
            value="2:15 pm" 
          >2:15 pm</option>
          <option 
            value="2:30 pm" 
          >2:30 pm</option>
          <option 
            value="2:45 pm" 
          >2:45 pm</option>


          <option disabled></option>


          <option 
            value="3:00 pm" 
          >3:00 pm</option>
          <option 
            value="3:15 pm" 
          >3:15 pm</option>
          <option 
            value="3:30 pm" 
          >3:30 pm</option>
          <option 
            value="3:45 pm" 
          >3:45 pm</option>


          <option disabled></option>


          <option 
            value="4:00 pm" 
          >4:00 pm</option>
          <option 
            value="4:15 pm" 
          >4:15 pm</option>
          <option 
            value="4:30 pm" 
          >4:30 pm</option>
          <option 
            value="4:45 pm" 
          >4:45 pm</option>


          <option disabled></option>


          <option 
            value="5:00 pm" 
            selected
          >5:00 pm</option>
          <option 
            value="5:15 pm" 
          >5:15 pm</option>
          <option 
            value="5:30 pm" 
          >5:30 pm</option>
          <option 
            value="5:45 pm" 
          >5:45 pm</option>
        
        
          <option disabled></option>


          <option 
            value="6:00 pm" 
          >6:00 pm</option>
          <option 
            value="6:15 pm" 
          >6:15 pm</option>
          <option 
            value="6:30 pm" 
          >6:30 pm</option>
          <option 
            value="6:45 pm" 
          >6:45 pm</option>
        
        
          <option disabled></option>


          <option 
            value="7:00 pm" 
          >7:00 pm</option>
          <option 
            value="7:15 pm" 
          >7:15 pm</option>
          <option 
            value="7:30 pm" 
          >7:30 pm</option>
          <option 
            value="7:45 pm" 
          >7:45 pm</option>
        
        
          <option disabled></option>


          <option 
            value="8:00 pm" 
          >8:00 pm</option>
          <option 
            value="8:15 pm" 
          >8:15 pm</option>
          <option 
            value="8:30 pm" 
          >8:30 pm</option>
          <option 
            value="8:45 pm" 
          >8:45 pm</option>
        
        
          <option disabled></option>


          <option 
            value="9:00 pm" 
          >9:00 pm</option>
          <option 
            value="9:15 pm" 
          >9:15 pm</option>
          <option 
            value="9:30 pm" 
          >9:30 pm</option>
          <option 
            value="9:45 pm" 
          >9:45 pm</option>
        
        
          <option disabled></option>


          <option 
            value="10:00 pm" 
          >10:00 pm</option>
          <option 
            value="10:15 pm" 
          >10:15 pm</option>
          <option 
            value="10:30 pm" 
          >10:30 pm</option>
          <option 
            value="10:45 pm" 
          >10:45 pm</option>
        
        
          <option disabled></option>
          <option disabled>Shop closes at 11:00 pm</option>


        </select>


        <!-- TIME - faux-select element, 
        can render inline or block  -->
        <a 
          id="time-rendered" 
          class="time-rendered faux-select-rendered" 
          tabindex="-1"
          href="#" 
        >
          <!-- Match the default TIME value here to the 
          default selected <option> element above -->
          5:00 pm</a
        >

      </span>
      <!-- / Time -->
      
      <div>
        <a
           href="" 
           class="bttn submit"
        >
          Next
        </a>
      </div>
      
    </form>
    
  </div>
</main>



            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Nunito:600,900|Shrikhand');

/*
font-family: 'Nunito', sans-serif;
font-family: 'Shrikhand', cursive;
*/

html, 
body {
  background: #1D3245;
  
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: #DDF9FC;
}
body {
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

h1,
h2 {
  margin: 0;
  font-weight: normal;
}

a {
  text-decoration: none;
}


main {
  
  min-height: 100vh;
  
  /* Vertical Centering main layout w/ Flexbox */
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  
  -webkit-flex-wrap: nowrap;
  -ms-flex-wrap: nowrap;
  flex-wrap: nowrap;
  
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  
  -webkit-align-content: center;
  -ms-flex-line-pack: center;
  align-content: center;
  
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  
  
}
main > .inner {
  max-width: 320px;
  margin: 0 auto;
  padding: 40px 16px;
  
  text-align: center;
}


main h1 {
  font-family: 'Shrikhand', cursive;
  font-size: 28px;
  line-height: 28px;
  color: #DDF9FC;
}
main h2 {
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 10px;
  line-height: 16px;
  color: #DDF9FC;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  
  margin-bottom: 12px;
  
  padding: 0 16px;
  background: #0CB893;
  border-radius: 500px;
}




form {
  margin: 40px 0 0 0;
  line-height: 44px;
}
form .text {
  display: inline-block;
  font-family: 'Shrikhand', cursive;
  font-size: 28px;
  font-weight: normal;
  
  line-height: inherit;
  
  color: #DDF9FC;
}


select,
input,
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  -o-appearance: none;
  -ms-appearance: none;
  appearance: none;
}

.select-wrapper.faux-select {
  display: inline-block;
  vertical-align: bottom;
  width: auto;
  overflow: hidden;
  
  line-height: inherit;
  
  margin-left: 6px;
  margin-bottom: -1px; /* nudge for baseline alignment with these fonts */
  
  position: relative;
}

.select-wrapper select {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  
  cursor: pointer;
  
  opacity: 0.001;
  /* opacity: 0.5; */
}

.faux-select-rendered {
  position: relative;
  z-index: 1;
  pointer-events: none;
  
  font-family: 'Nunito', sans-serif;
  font-weight: 200;
  font-size: 32px;
  line-height: inherit;
  color: #10F4C4;
}

.faux-select-rendered:after {
  display: inline-block;
  content: '▾';
  text-indent: -9999em;
  
  margin-left: 10px;
  
  width: 11px;
  line-height: inherit;
  
  background: url(#) no-repeat center center transparent;
  background-size: 11px 16px;
  
  /* converting the custom arrow BG image into a data URI for this demo */
  background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIxLjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImxheWVyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTEgMTYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDExIDE2OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6I0RDRjlGQzt9Cjwvc3R5bGU+CjxwYXRoIGlkPSJzZWxlY3QtYXJyb3dzIiBjbGFzcz0ic3QwIiBkPSJNNC44LDE1LjFMMC4zLDExYy0wLjQtMC40LTAuNC0xLDAtMS4zYzAuNC0wLjQsMS4xLTAuNCwxLjUsMGwzLjcsMy40bDMuNy0zLjQKCWMwLjQtMC40LDEuMS0wLjQsMS41LDBjMC40LDAuNCwwLjQsMSwwLDEuM2wtNC41LDQuMWMtMC4yLDAuMi0wLjUsMC4zLTAuNywwLjNTNSwxNS4zLDQuOCwxNS4xeiBNNC44LDAuNkwwLjMsNC43CgljLTAuNCwwLjQtMC40LDEsMCwxLjNjMC40LDAuNCwxLjEsMC40LDEuNSwwbDMuNy0zLjRsMy43LDMuNGMwLjQsMC40LDEuMSwwLjQsMS41LDBjMC40LTAuNCwwLjQtMSwwLTEuM0w2LjIsMC42CglDNiwwLjUsNS44LDAuNCw1LjUsMC40UzUsMC41LDQuOCwwLjZ6Ii8+Cjwvc3ZnPgo=);
  
  /*border: 1px solid red;*/
}









.bttn {
  display: inline-block;
  
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  
  background-color: transparent;
  color: #10F4C4;
  
  padding: 9px 80px;
  
  border-radius: 500px;
  border: 2px solid #10F4C4;
}
.bttn.submit {
  margin-top: 40px;
  
  text-indent: -9999em;
  
  background: url(#) no-repeat center center transparent;
  background-size: 19px 14px;
  
  /* Arrow SVG */
  background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIxLjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9ImxheWVyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTkgMTQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDE5IDE0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzEwRjRDNDt9Cjwvc3R5bGU+CjxwYXRoIGlkPSJhcnJvdy1yaWdodCIgY2xhc3M9InN0MCIgZD0iTTE4LjksN2MwLTAuMy0wLjEtMC41LTAuMy0wLjdsLTUuNi02Yy0wLjQtMC4zLTEuMS0wLjUtMS41LTAuMWMtMC40LDAuNC0wLjQsMS4xLDAsMS41CglsMy45LDQuMkgxQzAuNSw1LjksMCw2LjQsMCw3UzAuNSw4LDEsOGgxNC40bC0zLjksNC4yYy0wLjQsMC40LTAuNCwxLjEsMCwxLjVjMC40LDAuNCwxLjIsMC4zLDEuNS0wLjFsNS42LTYKCUMxOC44LDcuNSwxOC45LDcuMywxOC45LDdMMTguOSw3eiIvPgo8L3N2Zz4K);
  
}


            
          
!
            
              

// Dynamically populate the date   
// <select> with options for a range  
// of today through 6 weeks from now
function populate_date_select() {

    var pickup_date_select = $("select.pickup-date-select");

    // Using the Chicago Manual of Style 
    // abbre­vi­ations for day and month 
    // https://bit.ly/1JVilBm
    var days = ["Sun", "Mon", "Tue", "Wed", "Thurs", "Fri", "Sat"];
    var months = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."];
    var dates = ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th", "30th", "31st"];
    
    var today = new Date().getTime();
    
    var todaysDay = days[new Date().getDay()];
    var todaysMonth = months[new Date().getMonth()];
    var todaysDate = dates[new Date().getDate()] - 1;
  
    
    // Add a disabled option at the start
    $(pickup_date_select).append("<option disabled>Choose your pickup date</option><option disabled></option>");
    

    // Options for today's date,
    // using 'Today' instead of the date string
    // NOTE: need to add the current date in the value attr
    $(pickup_date_select).append("<option value='Today' selected>Today</option>");
    
    var counter = 1;
    var countUp = 24 * 60 * 60 * 1000;

    // Counting up to 6 weeks (42 days)
    for(counter; counter < 43; counter++) {
        today = new Date(new Date().getTime() + (countUp * counter)).getTime();
        todaysDay = days[new Date(new Date().getTime() + (countUp * counter)).getDay()];
        todaysMonth = months[new Date(new Date().getTime() + (countUp * counter)).getMonth()];
        todaysDate = dates[new Date(new Date().getTime() + (countUp * counter)).getDate() - 1];
        
      $(pickup_date_select).append("<option value='" + todaysMonth + " " + todaysDate + "'>" + todaysDay + ", " + todaysMonth + " " + todaysDate + "</option>");
    
    }
    
    // Add a disabled option at the end,
    // call instructions for further out
    $(pickup_date_select).append("<option disabled></option><option disabled>Call to order at a later date.</option>");
  
    // Add a break between weeks
    // to make the list more scanable
    var mondays = $( "option:contains('Mon')" );
    $(mondays).before("<option disabled></option>");


}
populate_date_select();





function faux_select_update() {

    // update the rendered value 
    // of any faux-select element when
    // its paired real select changes

    $('.faux-select select').change(function(){

        var real_select = $(this);
        var option_selected = $(this).find('option:selected').text();
        var faux_select_rendered = $(this).siblings('.faux-select-rendered');
        var faux_select_placeholder = $(this).attr("data-placeholder-name");

        if( $(this).val() == ""){
            $(faux_select_rendered).html(faux_select_placeholder);
        } else {
            $(faux_select_rendered).html(option_selected);
        }

    });


}
faux_select_update();



            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console