Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="container">

  <h1>Hello. This is a conference website.</h1>
  <p>On the day of the conference, <strong>schedule</strong> is the most important thing on the site. Oh, and party location. ;) Read full article about <a href="http://polarnorth.org/blog/improving-conference-schedules">improving conference websites</a> on my blog.</p>
  
  <!-- Only visible if the conditions in the table are met -->
  <a class="button-schedule" href="#on-schedule">Take me to the schedule!</a>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <h2>Great Speakers</h2>
    
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
    
  <h2>Fancy Venue</h2>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <h2>Schedule</h2>

  <table>
    <thead>
      <tr>
        <th>Time</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr data-start-time="2016/09/08 8:00:00" data-end-time="2016/09/08 09:00:00"  class="is-highlight">
        <td>08:00–09:00</td>
        <td>Welcome</td>
      </tr>
      <tr data-start-time="2016/09/08 9:00:00" data-end-time="2016/09/08 10:00:00">
        <td>09:00–10:00</td>
        <td>Talk 1</td>
      </tr>
      <tr data-start-time="2016/09/08 10:00:00" data-end-time="2016/09/08 11:00:00">
        <td>10:00–11:00</td>
        <td>Talk 2</td>
      </tr>
      <tr data-start-time="2016/09/08 11:00:00" data-end-time="2016/09/08 12:00:00">
        <td>11:00–12:00</td>
        <td>Talk 3</td>
      </tr>
      <tr data-start-time="2016/09/08 12:00:00" data-end-time="2016/09/08 13:00:00" class="is-highlight">
        <td>12:00–13:00</td>
        <td>Lunch</td>
      </tr>
      <tr data-start-time="2016/09/08 13:00:00" data-end-time="2016/09/08 14:00:00">
        <td>13:00–14:00</td>
        <td>Talk 4</td>
      </tr>
      <tr data-start-time="2016/09/08 14:00:00" data-end-time="2016/09/08 15:00:00">
        <td>14:00–15:00</td>
        <td>Talk 5</td>
      </tr>
      <tr data-start-time="2016/09/08 15:00:00" data-end-time="2016/09/08 15:30:00" class="is-highlight">
        <td>15:00–15:30</td>
        <td>Coffee break</td>
      </tr>
      <tr data-start-time="2016/09/08 15:30:00" data-end-time="2016/09/08 16:30:00">
        <td>15:30–16:30</td>
        <td>Talk 6</td>
      </tr>
      <tr data-start-time="2016/09/08 16:30:00" data-end-time="2016/09/08 17:30:00">
        <td>16:30–17:30</td>
        <td>Talk 7</td>
      </tr>
      <tr data-start-time="2016/09/08 17:30:00" data-end-time="2016/09/08 18:30:00">
        <td>17:30–18:30</td>
        <td>Talk 8</td>
      </tr>
      <tr data-start-time="2016/09/08 18:30:00" data-end-time="2016/09/08 19:00:00" class="is-highlight">
        <td>18:30–19:00</td>
        <td>Closing remarks</td>
      </tr>
      <tr data-start-time="2016/09/08 19:00:00" data-end-time="2016/09/09 03:00:00" class="is-highlight">
        <td>19:00–03:00</td>
        <td>Parteeey</td>
      </tr>
    </tbody>
  </table>
    
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <h2>Registration</h2>
    
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
   
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <h2>Organizers</h2>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
    
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <h2>Sponsors</h2>
   
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
    
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio ad deserunt consequuntur libero voluptatem accusantium laborum ratione tempora, quae nemo delectus impedit atque similique ab, asperiores, facilis dolor cumque veniam.</p>
  
</div>
              
            
!

CSS

              
                /* Highlights */

.is-highlight {
  
  td,
  th {
    font-weight: bold;
  }
  
}

.on-schedule {
  
  td,
  th {
    
    background: yellow;
    
  }
  
}

/* Make it look good */
.container {
  
  padding: 20px;
  max-width: 40em;
  
}

p {
  font-size: 18px;
  line-height: 1.6;
}

table {
  width: 100%;
  border: none;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  
  padding: 10px;
  border-bottom: 1px solid #ddd;
  
}

thead th {
  background-color: #eee;
}

.button-schedule {
  color: #fff;
  background-color: red;
  padding: .5em 1em;
}
              
            
!

JS

              
                Number.prototype.between  = function (a, b) {
    var min = Math.min.apply(Math, [a,b]),
        max = Math.max.apply(Math, [a,b]);
    return this > min && this < max;
};

$(document).ready(function() {
  
  /* Calculate */
	var current_time = Math.round((new Date()).getTime() / 1000),
		element_identificator = 'on-schedule', // Add class when item in a row is current
		$schedule_button = $('.button-schedule'); // Button for linking to the schedule
		$table_element = $('tbody tr'); // Where is data-start/end placed

	$schedule_button.hide();

	$table_element.each(function(index, value) {
    
    start_time = Math.round((new Date($(this).data('start-time'))).getTime() / 1000);
    end_time = Math.round((new Date($(this).data('end-time'))).getTime() / 1000);

		if(current_time.between(start_time, end_time )){
			$(this).addClass(element_identificator).attr('id', element_identificator);
			$schedule_button.show();
			return;
		}

	});
  
  /* Smooth Scrolling */
  $('a[href*="#"]:not([href="#"])').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html, body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
  
});
              
            
!
999px

Console