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

              
                
<div class = "row">
  <div class = "col-xl-3 col-lg-3">
  </div>
  <div class = "col-xl-6 col-lg-6">
    <div id = "quoteBox" class = "jumbotron">
      <div id = "content">
        <div id = "quote">
      </div>
      <br>
        <div id = "source">

        </div>
      </div>
      <br>
      <br>
      
            <div class = "container buttons">
              <a id = "tweet" href = "#"><i id = "twit" class = "fa fa-twitter-square"></i></a>
   <!-- <i id = "fab" class = "fa fa-facebook-square"></i> -->
    <button id = "quoteMaker" class = "newquote">New Quote</button>

      </div>
    </div>
  </div>
  <div class = "col-xl-3 col-lg-3">
  </div>
</div>
<div id = "name">
By Ross Scarborough
</div>

  
    
              
            
!

CSS

              
                body {
  background-color: ;
  margin-top: 120px;
}
#quotebox {
  text-align: center;
}

#quote {
  padding: 40px 100px 0px 100px;
}
#quote p {
  font-size: 42px;
}
#quote p ul li {
  font-size 26px;
}
#source {
  font-family: monospace;
  float: right;
  padding: 0px 100px;
  font-size: 24px;
}
.buttons {
overflow: hidden;
  padding: 50px 100px 0px 100px;
}
.buttons i {
  position: relative;
  font-size: 48px;
  margin: 0px 10px;
}
.newquote{
  float: right;
  border: none;
  border-radius: 7px;
  outline: none;
  padding: 0px 10px;
  font-size: 28px;
  font-family: monospace;
}
#quoteMaker{
  color: white;
}
#name {
  text-align: center;
  color: white;
  padding-bottom: 50px;
}
@media screen and (max-width: 660px) {
  body {
    margin-top: 50px;
  }
  #quote {
  padding: 10px 20px 0px 20px;
  }
  #quote p {
  font-size: 24px;
}
  .buttons {
overflow: hidden;
  padding: 10px 20px 10px 20px;
}
  .buttons i {
  position: relative;
  font-size: 30px;
  margin: 0px 10px;
}
  .newquote{
  float: right;
  border: none;
  border-radius: 7px;
  outline: none;
  padding: 0px 10px;
  font-size: 18px;
  font-family: monospace;
}
  #source {
  font-family: monospace;
  float: right;
  padding: 0px 20px;
  font-size: 16px;
}
  #quote p ul li {
  font-size 12px;
}

}
              
            
!

JS

              
                
$(document).ready(function() {
firstQuote();

function firstQuote() {
$.getJSON("https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
var rand = Math.floor(Math.random() * colors.length);
var quote = a[0].content;
var quoteString = quote.replace(/<\/?[^>]+(>|$)/g, "").replace(/&#8217;/g, "\'").replace(/&#8211;/g, "–").replace(/&#8220;/g, "\“").replace(/&#8221;/g, "\”").replace(/&#8230;/g, "\…");
$('#tweet').attr('href', 'https://twitter.com/intent/tweet?text=' + '“' + quoteString + '”' + ' -' + a[0].title);
$("#quote").html(a[0].content).css('font-family', fonts[rand]);
$("#source").text('- ' + a[0].title);
$('body').css('background-color', colors[rand]);
$('#content, #twit, #fab').css('color', colors[rand]);
$('#quoteMaker').css('background-color', colors[rand]);
})
}
var fonts = ['Abril Fatface', 'Advent Pro', 'Amatic SC', 'Bad Script', 'Bellefair', 'Dosis', 'EB Garamond', 'IM Fell English SC', 'Indie Flower', 'Josefin Sans', 'Nixie One', 'Poiret One']
var colors = ['#5a0000', '#5a0046', '#3d005a', '#0b005a', '#003d5a', '#005a28', '#375a00', '#5a2600', '#5a263e', '#4a4e2a', '#6f1614', '#410d66'];
jQuery(function($) {
$("#quoteMaker").on("click", function(e) {
  var rand = Math.floor(Math.random() * colors.length);
   e.preventDefault();
    $.ajax( {
      url: 'https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1',
      success: function(data) {
        var post = data.shift();
        var quote = post.content;
        var quoteString = quote.replace(/<\/?[^>]+(>|$)/g, "").replace(/&#8217;/g, "\'").replace(/&#8211;/g, "–").replace(/&#8220;/g, "\“").replace(/&#8221;/g, "\”").replace(/&#8230;/g, "\…");
        $('#quote').fadeOut( 500, function() {
          $('#quote').html(post.content).css('font-family', fonts[rand]);
            $('#quote').fadeIn( 500, function() {
              
            })})
       
        $('#source').fadeOut( 500, function() {
          $('#source').html('- ' + post.title);
            $('#source').fadeIn( 500, function() {
              
            })})
           $('body, #quoteMaker').animate({backgroundColor: colors[rand]}, 1000);
           $('#content, #twit, #fab').animate({color: colors[rand]}, 1000);
           $('#tweet').attr('href', 'https://twitter.com/intent/tweet?text=' + '“' + quoteString + '”' + ' -' + post.title);
           
      },
      cache: false
    });
  });

});

  
  
  
  
  
});
              
            
!
999px

Console