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

              
                <link href='https://fonts.googleapis.com/css?family=Lobster+Two' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<div id = "whole">
  <div id = "quotebox" class="text-center">
    <i class="fa fa-quote-left"></i>
    <span id="quote-text"></span>
    <i class="fa fa-quote-right"></i>
    <br>
    <div id="quote-author"></div>
    <br>
    <div id="quote-source"></div>
    </div>
  <a title="Tweet this quote" id="twitter" target="_blank" class="btn  button btn-default"><i class="fa fa-twitter" id="twitter2"></i>
  </a>
  <button class="btn button btn-default" id="quotebutton">New Quote</button>
</div>
              
            
!

CSS

              
                
body {
  background-color: #C63D0F;
}
#note{
  color:white;
  margin-top: 50px;
  font-size: 20px;
  font-family: 'Inconsolata';
}
#whole {
  width: 600px;
  margin: 20px auto auto auto;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
}
#quotebox {
  width: 500px;
  padding: 20px;
  margin: 0 auto;
  margin-top: 30px;
}
#twitter{
  margin: 10px 30px auto auto;
  width: 80px;
  display: block;
  float:left;
}
#quotebutton{
  color: white;
  margin: 10px auto auto 30px;
  display: block;
  float:right;
  font-family: 'Inconsolata';
}
#quote-author{
  margin-top: 20px;
  font-family: 'Lobster Two', cursive;
  font-size: 20px
}
#twitter2{
  color:white;
}
.button{
  margin-bottom: 10px;
}
#quote-text{
  font-family: 'Lobster Two',cursive;
  font-size: 20px;
}
              
            
!

JS

              
                var colors = ['#16a085', '#27ae60', '#2c3e50', '#f39c12', '#e74c3c', '#9b59b6', '#FB6964', '#342224', "#472E32", "#BDBB99", "#77B1A9", "#73A857"];
$('#quotebutton').on('click', function(e) {
  e.preventDefault();
  $.ajax({
    url: 'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1',
    success: function(data) {
     var tweet = $('#quote-text').html(data[0].content).text();
      $("#quote-text").text(tweet);
      $('#quote-author').html("<p>- "+ data[0].title + "<p>");
      //Check to see if there's source
      if (typeof data[0].custom_meta !== "undefined" && typeof data[0].custom_meta.Source !=="undefined"){
        $("#quote-source").html("Source: "+ data[0].custom_meta.Source);
      } else{
        $("#quote-source").text('');
      }
      $("#twitter").attr("href", 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(tweet + data[0].title));
    },
    cache: false
  });
  var color = Math.floor(Math.random() * colors.length);
    $("html body").animate({
      backgroundColor: colors[color],
      color: colors[color]
    }, 1000);
    $(".button").animate({
      backgroundColor: colors[color]
    }, 1000);
});
$("#quotebutton").click();
 

              
            
!
999px

Console