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

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

              
                <div class="container">
  <div class="quoteBox">
    <div class="row">
      <div class="quoteText text-center">
        <i class="fa fa-quote-left" style="font-size:25px;" aria-hidden="true"><span id="quote"></span></i>
      </div>
    </div>
    <div class="row">
      <div class="quoteAuthor pull-right">
        - <span id="person"></span>
      </div>
    </div>
    <div class="row">
      <div class="buttons">
        <a class="button" id="tweetQuote" title="Tweet this quote!" target="">
          <i class="fa fa-twitter white"></i>
        </a>
        
        <a class="button" id="tumblrQuote" title="Post this quote on tumblr!" target="">
          <i class="fa fa-tumblr white"></i>
        </a>
        <button class="button pull-right" id="newQuote">New Quote</button>
      </div>
    </div>
  </div>
  <footer class="text-center" id="foot">by Labanch</footer>
</div>
              
            
!

CSS

              
                body {
  background-color: #ffd194;
  color: #ffd194;
  margin-bottom: 20px;
}

button:focus {
  outline: none;
}

/* QUOTE CONTAINER */

.quoteBox {
  position: relative;
  font-family: 'Raleway', serif;
  border-radius: 10px;
  background-color: #fff;
  margin: 40px auto;
  padding: 40px 50px;
  width: 500px;
}

/* QUOTE AND AUTHOR */

#quote {
  font-family: 'Raleway', sans-serif;
  font-size: 27px;
  font-weight: 500;
  margin-left: 10px;
  line-height: 1.3em;
 
}
.quoteAuthor {
  font-size: 18px;
  text-align: right;
  padding-top: 20px;
  height: auto;
  clear: both;
  margin-bottom: 30px;
  width: 500px;
}

.white{
  color: #fff;
}

/* BUTTONS */

.buttons {
  width: 500px;
  display: block;
  margin: auto;
}
.button {
  height: 29px;
  background-color: #ffd194;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  border: none;
  margin-right: 50px;
}

.button:hover{
  opacity: 0.9;
}

#tweetQuote, #tumblrQuote {
  float:left;
  padding: 8px;
  text-align:center;
  font-size:1.3em;
  margin-right:5px;
  height: 40px;
  width:40px;
}

#newQuote {
  float: right;
  display: block;
  margin-right: 70px;
  height: 40px;
  font-size: 15px;
  padding: 0 18px;
}

#foot {
  margin-top: 20px;
  font-family: 'Patrick Hand SC', cursive;
  color: #fff;
  font-size: 18px;
}


              
            
!

JS

              
                var colors = ['#ffd194', '#feb091', '#fd8e8e', '#fd8bab', '#fc88ca', '#fb85ea', '#e982fa', '#c57ff9', '#a07cf8', '#7979f7', '#769af7', '#73bdf6', '#70e1f5'];
var length = colors.length;
var x      = 0;
var currentQuote;
var currentAuthor;


function getQuote() {
  $(".quoteText, .quoteAuthor").animate({
    opacity: 0
  }, 0, function(){
    $(this).animate({
      opacity: 1
    }, 1500);
  }).css("color", colors[x]);
  
  $(".button").animate({backgroundColor: colors[x]}, 1000);
  $("html body").animate({ backgroundColor: colors[x]}, 1000);
  if (x < length) {
    x++;
  } else if (x >= length) {
    x = 0;
  }
  
  $.getJSON('https://quotes.stormconsultancy.co.uk/random.json', function(data){
    currentQuote  = data.quote;
    currentAuthor = data.author;
    $('#quote').text(currentQuote);
    $('#person').text(currentAuthor);
    
  });
}

$(document).ready(function() {
  //getQuote();
  $('#newQuote').on('click', getQuote);
  $('#tweetQuote').on('click', function() {
      window.open('https://twitter.com/intent/tweet?hashtags=quotes&text=' + encodeURIComponent('"' + currentQuote + '" ' + currentAuthor));
  });
});
              
            
!
999px

Console