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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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

  <div id="quote-box">
    <div id="quote">
      Hold on tight...
    <div class="pull-right" id="author">
      Who said that?
    <div class="col-xs-12" id="options">
      <div id="social">
          <a id="twitter" title="Tweet this quote!" target="_blank" class='btn'>
           <i class="fa fa-twitter"></i>
          <a id="facebook" title="Share on Facebook" target="_blank" class='btn'>
             <i class="fa fa-facebook"></i>
      <button id="newQuote" class="pull-right btn btn-primary">New Quote</button>
<footer class="text-center small">
  made by <a href='/kode29' target="_blank">Kyle M. Perkins


                body, .btn{
  -webkit-transition: all .5s ease-in-out;
    -moz-transition: all .5s ease-in-out;
    -ms-transition: all .5s ease-in-out;
    -o-transition: all .5s ease-in-out;
    transition: all .5s ease-in-out;
  line-height: 1.5em;
  margin: 8% auto auto auto;
  width: 700px;
  border: 20px transparent solid;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,.5);
  background-color: #fff;
  overflow: auto;
  padding: 15px;
  font-size: 200%;
  line-height: 2em;
.btn a{
  display: block;
  height: 100%;
  width: 100%;
  line-height: 50px;
#social .btn{
  float: left;
  margin-right: 5px;
  border: 0;
  cursor: pointer;
  opacity: 1;
  color: #fff;
  opacity: 0.9;
  margin-top: 15px;
  color: #000 !important;
  margin: 20px;


                function rand255(){
  var newColor = Math.floor(Math.random() * 256);
  //console.log("New: "+newColor);
  return newColor;
function newRGB(){
  var r = rand255();
  var g = rand255();
  var b = rand255();
  var newColor = "rgb("+r+","+g+","+b+")";
  $('body').css('background-color', newColor);
  $('body').css('color', newColor);
  $('.btn').css('background-color', newColor);

var allQuotes;
  function getNewQuote(aQ=null){
    // Store our intial data in a global variable
    if (aQ != null){
      if (aQ.length > 0)
        allQuotes = aQ;
    var randNum = Math.floor(Math.random() * allQuotes.length) + 1;

    var quote = allQuotes[randNum].quote;
    var author = allQuotes[randNum].author;
    // Update the fields
    $('#author').html("- "+author);

    // Get new color
    var thisURL = encodeURIComponent("");
    var webSafeQuote = encodeURIComponent('"'+quote+'"');
    var twitterLink = ""+thisURL+"&related=freecodecamp%2Ctwitter&hashtags=quotes%2Cfreecodecamp&text="+webSafeQuote+" - "+author;
    var facebookLink = ""+thisURL+"&quote="+webSafeQuote+" - "+author;
    $('#twitter').attr('href', twitterLink);
    $('#facebook').attr('href', facebookLink);

  var quotes;
  $.getJSON("", function(json){