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 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.

HTML

              
                <body>
  <div id="wrapper" class="wrapper col-lg-10 col-lg-offset-1 col-xs-12">
  </div>
</body>

              
            
!

CSS

              
                $primary-text: #ffffff;
$secondary-text: #000000;
$primary-background: #337ab7;
$secondary-background: #ffffff;
$tertiary-background: #333333;

.default-padding {
  padding: 15px;
}
.default-border {
  border-width: 2px;
  border-style: solid;
}

.default-shadow {
	box-shadow: 5px 5px 15px #000000;
}

body {
  background-color: $tertiary-background;
  font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif !important;
	font-size: 14px;
	font-style: normal;
	font-variant: small-caps;
	font-weight: 500;
}
.wrapper {
}

.content-area-wrapper {
  margin-top: 20px;
  color: $secondary-text;
}

.content-area-header {
  @extend .default-shadow;
  background-color: $primary-background;
  color: $primary-text;
  padding: 20px;
}

.content-area-content {
  @extend .default-shadow;
  border-style: solid;
  border-width: 2px 0px 2px 0px;
  border-color: $primary-background * 0.5;
  background-color: $secondary-background;
  margin-left: 5px;
}

.user-headers {
  @extend .default-shadow;
  margin-left: 5px;
  background-color: $secondary-background;
}

.user-element {
  @extend .default-padding;
  background-color: $secondary-background;
  border-style: solid;
  border-width: 0px 0px 2px 0px;
  border-color: $tertiary-background;
  margin: 0px;
  img {
  }
}

.user-position {
  padding-top: 10px;
  font-size: 50px !important;
}

.user-name {
    font-size: 20px;
    margin-top: 28px;
  }

.recent-points { 
  @extend .user-name;
  }

.all-points {
  @extend .user-name;
  }

.content-area-footer{
  @extend .default-shadow;
  @extend .default-padding;
  background-color: $primary-background;
  color: $primary-text;
  margin-bottom: 20px;
}
              
            
!

JS

              
                var topRecent = [];
var topAllTime = [];
getData();

function getData(){
  console.log('getTopRecent');
  $.ajax({
    url: 'https://fcctop100.herokuapp.com/api/fccusers/top/recent',
    type: 'GET',
    success: function(data){
      console.log('success - data length: ' + data.length);
      var i=0;
      while(i<data.length){
        topRecent.push([data[i].username, data[i].img, data[i].recent, data[i].alltime]);
        i++;
      }
      ReactDOM.render(<UserRender />, document.getElementById('user-content-area'));
    },
    error: function(err){
      console.log('error');
    } 
  });
  $.ajax({
    url: 'https://fcctop100.herokuapp.com/api/fccusers/top/alltime',
    type: 'GET',
    success: function(data){
      console.log('success - data length: ' + data.length);
      var i=0;
      while(i<data.length){
        topAllTime.push([data[i].username, data[i].img, data[i].recent, data[i].alltime]);
        i++;
      }
      ReactDOM.render(<UserRender />, document.getElementById('user-content-area'));
    },
    error: function(err){
      console.log('error');
    } 
  });
}

var UserRender = React.createClass({
  render: function(){
    if(this.props.sort === 'all-time'){
            var recentMap = topAllTime.map(function(user, i){
        return(
          <div className='row user-element'>
            <div className='user-position col-lg-2 col-xs-1 text-center'>{i+1}</div>
            <div><img src={user[1]} className='col-lg-1 col-xs-1' alt={user[0]} /></div>
            <div className='user-name text-center col-lg-5 col-xs-4'>{user[0]}</div>
            <div className='recent-points text-center col-lg-2 col-xs-1'>{user[2]}</div>
            <div className='all-points text-center col-lg-2 col-xs-2'>{user[3]}</div>
          </div>
        );
      });
    } else {
      var recentMap = topRecent.map(function(user, i){
        return(
          <div className='row user-element'>
            <div className='user-position col-lg-2 col-sm-1 text-center'>{i+1}</div>
            <div><img src={user[1]} className='col-lg-1 col-sm-1' alt={user[0]} /></div>
            <div className='user-name text-center col-lg-5 col-sm-4'>{user[0]}</div>
            <div className='recent-points text-center col-lg-2 col-sm-1'>{user[2]}</div>
            <div className='all-points text-center col-lg-2 col-sm-2'>{user[3]}</div>
          </div>
        );
     });
    }
    return <div>{recentMap}</div>;
  }
});

var DefaultScreen = React.createClass({
  render:function(){
    return (
    <div>
      <div className='row'>
        <div className='content-area-wrapper col-lg-10 col-lg-offset-1 col-sm-12'>
          <div className='row content-area-header'><h2>Free Code Camp - Camper Leaderboard</h2></div>
          <div className='row user-headers'>
            <div className='col-lg-2 text-center col-sm-2'>&nbsp;#</div>
            <div className='col-lg-5 col-lg-offset-1  col-sm-4 text-center'>Camper</div>
            <div id='past-thirty' className='col-lg-2 text-center'>Past 30 Days</div>
            <div id='all-time' className='col-lg-1 text-center'>All Time</div>
          </div>
          <div id='user-content-area' className='row content-area-content'>      
          </div>
          <div className='row content-area-footer'><span className='pull-right'><a href='http://www.raymondrizzo.com/Portfolio' target='_blank'>Raymond Rizzo</a></span></div>
        </div>
      </div>
    </div>
      )
  }
});


ReactDOM.render(<DefaultScreen />, document.getElementById('wrapper'));

document.getElementById('past-thirty').addEventListener('mouseover', function(){
  $('#past-thirty').toggleClass('btn-primary');
});

document.getElementById('past-thirty').addEventListener('click', function(){
  ReactDOM.render(<UserRender />, document.getElementById('user-content-area'));
});

document.getElementById('past-thirty').addEventListener('mouseout', function(){
  $('#past-thirty').toggleClass('btn-primary');
});

document.getElementById('all-time').addEventListener('mouseover', function(){
  $('#all-time').toggleClass('btn-primary');
});
  
document.getElementById('all-time').addEventListener('mouseout', function(){
  $('#all-time').toggleClass('btn-primary');
});

document.getElementById('all-time').addEventListener('click', function(){
  ReactDOM.render(<UserRender sort='all-time'/>, document.getElementById('user-content-area'));
});


              
            
!
999px

Console