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 data-provide="calendar"></div>
              
            
!

CSS

              
                body
{
  margin:0;
}

#banner
{
  font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif;
  background-color:#207BBC;
  line-height:60px;
  overflow:auto;
}

#banner,
#banner a,
#banner a:hover,
#banner a:active 
{
  color:white;
  text-decoration:none;
}

#banner .logo
{
  font-size:18px;
  float:left;
  font-weight:100;
}

#banner .logo span.fa
{
  font-size:26px;
  margin-right:10px;
  vertical-align: text-bottom;
}

#banner .menu
{
  float:right;
}

#banner .menu-button
{
  display:none;
  float:right;
}

#banner ul.menu {
  padding:0;
  margin:0;
}

#banner ul.menu  li
{
  display:inline-block;
  list-style:none;
  padding:0 15px;
  cursor:pointer;
  font-size:14px;
  position:relative;
}

#banner ul.menu  li:hover
{
  background-color:#2180C4;
}

#banner ul.menu  li.selected {
  box-shadow: inset 0 -3px 0 white;
}

#banner ul.menu  li span {
  margin-top: 21px;
  margin-bottom: 21px;
  font-size: 17px;
}

#title
{
  background-color:#303030;
  height:200px;
  color:#ccc;
  text-align:center;
}

#main > .site-content > span.fa-spinner
{
  font-size:60px;
  margin: 40px auto;
  display:block;
  width: 60px;
  height: 60px;
}

#main .site-content img {
  width:100%;
}

#footer
{
  background-color:#E5E5E5;
  clear:both;
}

.site-content
{
  width:800px;
  margin:auto;
}

#main > .site-content.full
{
  padding-top:0;
  width:100%;
  display:table-row;
}

.left-menu {
  display:table-cell;
  background-color: #eee;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  box-shadow: 0px 0px 5px rgba(0, 0, 0, .2);
  min-height:400px;
}

.site-content.full > .left-menu {
  border-left:0;
}

.left-menu ul {
  margin:0;
  padding:0;
  min-height: 200px;
}

.left-menu ul li {
  list-style: none;
  padding: 6px 25px 6px 15px;
  cursor: pointer;
  white-space:nowrap;
}

.left-menu ul li:hover {
  background-color:#ddd;
}

.left-menu ul li.selected {
  border-right:3px solid #aaa;
}

.sub-content-container 
{
  display:table-cell;
  padding-left:20px;
  width:100%;
}

.sub-content  > span.fa-spinner
{
  font-size:40px;
  margin: 40px auto;
  display:block;
  width: 40px;
  height: 40px;
}

.center {
  text-align:center;
}

.underline-title {
  border-bottom:1px solid #ccc;
}

.new-version {
  display:inline-block;
  position: absolute;
  font-size: 12px;
  padding: 5px;
  background-color: green;
  color: white;
  border-radius: 4px;
  box-shadow: #222 0 0 10px;
  margin-top:20px;
  margin-left:5px;
}

.parameter,
.default-value,
.returns,
.related-methods {
  font-size: 15px;
  font-family: consolas;
}

.parameter {
  color: #006696;
}

.default-value,
.returns {
  color: #3C7202;
}

.related-methods {
  color:#7C0000;
}

span.link {
  font-family: consolas;
  font-size:13px;
  color: blue;
}

.parameter > ul > li{
  font-size: 12px;
}

code {
  display:block;
  margin:5px 0;
  padding: 12px;
}

code.inline {
  display:inline;
  padding: 0;
  background-color: none;
}

h1,
h2,
h3,
h4,
h5
{
  font-family:'Segoe UI','Helvetica Neue',Helvetica,Arial,sans-serif;

}

h1,
h2
{
  font-weight:100;
}

h1
{
  padding: 30px 0 15px 0;
  margin: 0;
  font-size:60px;
  display:inline-block;
}

h4 {
  font-size:16px;
  font-weight:bold;
}

p {
  margin: 15px 0;
}

li {
  list-style-type:square;
}

hr {
  margin:20px 80px;
}

@media (min-width: 1024px) {
  .site-content
  {
    width:800px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .site-content
  {
    width:650px;
  }

  #banner ul.menu  li
  {
    padding:0 7px;
  }

  #title {
    height:160px;
  }

  h1 {
    padding: 20px 0 10px 0;
    font-size:50px;
  }

  h2 {
    font-size:25px;
  }
}


@media (max-width: 768px) {
  .site-content
  {
    width:100%;
    min-width:200px;
    padding:0 5px;
  }

  #banner .menu-button
  {
    display:inline-block;
    cursor:pointer;
    font-size:21px;
    padding:18px;
  }

  #banner ul.menu  {
    display:none;
    float:none;
    clear:both;
    left:0;
  }

  #banner ul.menu  li {
    display:block;
    width:100%;
  }

  #banner ul.menu  li.selected {
    box-shadow: inset 3px 0 0 white;
  }

  #title {
    height:120px;
  }

  h1 {
    padding: 15px 0 0 0;
    font-size:30px;
  }

  h2 {
    font-size:17px;
  }

  .new-version {
    right:5px;
    margin-top: -10px;
  }
}
              
            
!

JS

              
                function editEvent(event) {
    $('#event-modal input[name="event-index"]').val(event ? event.id : '');
    $('#event-modal input[name="event-name"]').val(event ? event.name : '');
    $('#event-modal input[name="event-location"]').val(event ? event.location : '');
    $('#event-modal input[name="event-start-date"]').datepicker('update', event ? event.startDate : '');
    $('#event-modal input[name="event-end-date"]').datepicker('update', event ? event.endDate : '');
    $('#event-modal').modal();
}

function deleteEvent(event) {
    var dataSource = $('#calendar').data('calendar').getDataSource();

    for(var i in dataSource) {
        if(dataSource[i].id == event.id) {
            dataSource.splice(i, 1);
            break;
        }
    }
    
    $('#calendar').data('calendar').setDataSource(dataSource);
}

function saveEvent() {
    var event = {
        id: $('#event-modal input[name="event-index"]').val(),
        name: $('#event-modal input[name="event-name"]').val(),
        location: $('#event-modal input[name="event-location"]').val(),
        startDate: $('#event-modal input[name="event-start-date"]').datepicker('getDate'),
        endDate: $('#event-modal input[name="event-end-date"]').datepicker('getDate')
    }
    
    var dataSource = $('#calendar').data('calendar').getDataSource();

    if(event.id) {
        for(var i in dataSource) {
            if(dataSource[i].id == event.id) {
                dataSource[i].name = event.name;
                dataSource[i].location = event.location;
                dataSource[i].startDate = event.startDate;
                dataSource[i].endDate = event.endDate;
            }
        }
    }
    else
    {
        var newId = 0;
        for(var i in dataSource) {
            if(dataSource[i].id > newId) {
                newId = dataSource[i].id;
            }
        }
        
        newId++;
        event.id = newId;
    
        dataSource.push(event);
    }
    
    $('#calendar').data('calendar').setDataSource(dataSource);
    $('#event-modal').modal('hide');
}

$(function() {
    var currentYear = new Date().getFullYear();

    $('#calendar').calendar({ 
        enableContextMenu: true,
        enableRangeSelection: true,
        contextMenuItems:[
            {
                text: 'Update',
                click: editEvent
            },
            {
                text: 'Delete',
                click: deleteEvent
            }
        ],
        selectRange: function(e) {
            editEvent({ startDate: e.startDate, endDate: e.endDate });
        },
        mouseOnDay: function(e) {
            if(e.events.length > 0) {
                var content = '';
                
                for(var i in e.events) {
                    content += '<div class="event-tooltip-content">'
                                    + '<div class="event-name" style="color:' + e.events[i].color + '">' + e.events[i].name + '</div>'
                                    + '<div class="event-location">' + e.events[i].location + '</div>'
                                + '</div>';
                }
            
                $(e.element).popover({ 
                    trigger: 'manual',
                    container: 'body',
                    html:true,
                    content: content
                });
                
                $(e.element).popover('show');
            }
        },
        mouseOutDay: function(e) {
            if(e.events.length > 0) {
                $(e.element).popover('hide');
            }
        },
        dayContextMenu: function(e) {
            $(e.element).popover('hide');
        },
        dataSource: [
            {
                id: 0,
                name: 'Google I/O',
                location: 'San Francisco, CA',
                startDate: new Date(currentYear, 4, 28),
                endDate: new Date(currentYear, 4, 29)
            },
            {
                id: 1,
                name: 'Microsoft Convergence',
                location: 'New Orleans, LA',
                startDate: new Date(currentYear, 2, 16),
                endDate: new Date(currentYear, 2, 19)
            },
            {
                id: 2,
                name: 'Microsoft Build Developer Conference',
                location: 'San Francisco, CA',
                startDate: new Date(currentYear, 3, 29),
                endDate: new Date(currentYear, 4, 1)
            },
            {
                id: 3,
                name: 'Apple Special Event',
                location: 'San Francisco, CA',
                startDate: new Date(currentYear, 8, 1),
                endDate: new Date(currentYear, 8, 1)
            },
            {
                id: 4,
                name: 'Apple Keynote',
                location: 'San Francisco, CA',
                startDate: new Date(currentYear, 8, 9),
                endDate: new Date(currentYear, 8, 9)
            },
            {
                id: 5,
                name: 'Chrome Developer Summit',
                location: 'Mountain View, CA',
                startDate: new Date(currentYear, 10, 17),
                endDate: new Date(currentYear, 10, 18)
            },
            {
                id: 6,
                name: 'F8 2015',
                location: 'San Francisco, CA',
                startDate: new Date(currentYear, 2, 25),
                endDate: new Date(currentYear, 2, 26)
            },
            {
                id: 7,
                name: 'Yahoo Mobile Developer Conference',
                location: 'New York',
                startDate: new Date(currentYear, 7, 25),
                endDate: new Date(currentYear, 7, 26)
            },
            {
                id: 8,
                name: 'Android Developer Conference',
                location: 'Santa Clara, CA',
                startDate: new Date(currentYear, 11, 1),
                endDate: new Date(currentYear, 11, 4)
            },
            {
                id: 9,
                name: 'LA Tech Summit',
                location: 'Los Angeles, CA',
                startDate: new Date(currentYear, 10, 17),
                endDate: new Date(currentYear, 10, 17)
            }
        ]
    });
    
    $('#save-event').click(function() {
        saveEvent();
    });
});
              
            
!
999px

Console