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


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


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.


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.


<div id="page">
  <div class="page-header">
    <h1>Reservation System (<a class="text-primary" href="" target="_blank">interactive demo</a>)</h1>
  <div id="calendar"></div>

<div class="bubble">
  <div class="arrow"></div>


#page {
  max-width: 960px; padding: 0 15px; margin: 40px auto;
  @media (max-height: 790px) {
    margin-top: 0;
.page-header h1 { .text-center; font-weight: 100; }

.input, select {
  padding: 2px 5px;
.btn {
  padding: .2em .8em;
  border-radius: 4px;
  border: 1px solid #bcbcbc;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12);
	background-image: linear-gradient(180deg, rgba(255,255,255,1) 0%,rgba(239,239,239,1) 60%,rgba(225,223,226,1) 100%);
  background-repeat: no-repeat; // fix for firefox

.bubble {
  box-shadow: 0 2px 4px rgba(0,0,0,.2); border-radius: 2px;
  background: #fff; padding: 15px;
  width: 420px;
  z-index: 99;
  position: absolute;

  .close {
    position: absolute; font-size: 24px; line-height: 1;
    padding: 0 5px;
    right: 5px; top: 5px;

.bubble {
  @border-color: #ccc;
  border: 1px solid @border-color;
  .arrow, .arrow:after {
    position: absolute; height: 0; width: 0; font-size: 0; .horizontal-border(transparent, 10px);
  &-top, &-bottom {
    .arrow {
      left: 50%; margin-left: -10px;
    .arrow:after {
      content: ''; left: -10px;
  &-top {
    .arrow {
      border-top: @border-color 10px solid; top: 100%;
    .arrow:after {
      border-top: #FFF  10px solid; bottom: 1px;
  &-bottom {
    .arrow {
      border-bottom: @border-color 10px solid; bottom: 100%;
    .arrow:after {
      border-bottom: #FFF  10px solid; top: 1px;

.form-group {
  .clearfix; padding-bottom: 8px;
  &>label {
    float: left; width: 4em; text-align: right; padding-right: 5px;
  &>input, &>.input-wrapper {
    margin-left: 4em;
    display: block;

.btn-delete {
  margin-top: 5px;
  display: none;
  &:hover {
    text-decoration: underline;

.usage { margin-top: 10px; }



                $(function() { // document ready

  var calendar = $('#calendar').fullCalendar({
    header: {
      left: 'prev,next today',
      center: 'title',
      right: 'agendaWeek,agendaDay'
    defaultView: 'agendaWeek',
    defaultTimedEventDuration: '01:00',
    allDaySlot: false,
    scrollTime: '08:00',
    businessHours: {
      start: '9:00',
      end: '18:00',
    lang: /^en-/.test(navigator.language) ? 'en' : 'zh-cn',
    eventOverlap: function(stillEvent, movingEvent) {
      return true;
    events: [{
      title: '技术部周例会',
      start: '2015-05-22T15:00+08:00'
    }, {
      title: '运营部',
      start: '2015-05-22T12:00+08:00'
    editable: true,
    selectable: true,
    selectHelper: true,
    select: function(start, end) {
      var duration = (end - start) /1000;
      if(duration == 1800) {
        // set default duration to 1 hr.
      	end = start.add(30, 'mins');
        return calendar.fullCalendar('select', start, end);
      var title = prompt('Event Title:');
      var eventData;
      if (title && title.trim()) {
        eventData = {
          title: title,
          start: start,
          end: end
        calendar.fullCalendar('renderEvent', eventData);
    eventRender: function(event, element) {
      var start = moment(event.start).fromNow();
      element.attr('title', start);
    loading: function() {