Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <body class="background-colors">
  <div class="wrapper">
    <div class="container">
      <div class="row">
        <div class="">
          <div class="well">
            <div class="row">
              <div class="col-sm-12">
                <blockquote>
                  <p><img src="https://i0.wp.com/cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="Loading" /> </p>
                  <small>Me</small></blockquote>
              </div>
              <div class="col-sm-12">
                <p class="new-quote"><button class="background-colors" id="loadNewQuote">New Quote</button></p>
                <ul class="list-unstyled list-inline fa-3x">
                  <li><a class="tweet-link" href="https://twitter.com/intent/tweet?hashtags=freecodecamp,quotes&text=View fancy quotes&url=https://codepen.io/virtual/pen/jqJeKb" target="_blank"><span class="fa fa-twitter-square" aria-hidden="false"><span class="sr-only">Post to Twitter</span></span></a></li>
                  <li><a class="tumblr-link" href="https://www.tumblr.com/share/link?url=http%3A%2F%2Fcodepen.io/virtual/pen/jqJeKb" target="blank_"><span class="fa fa-tumblr-square" aria-hidden="false"><span class="sr-only">Post to Tumblr</span></span></a></li>
                </ul>

              </div>
            </div>
          </div>
          <p class="attribution"><a href="http://satinflame.com" target="_blank">by satinflame design</a> | <a href="https://quotesondesign.com/api/">API</a> by Chris Coyier</p>
        </div>
      </div>
    </div>
  </div>
</body>
              
            
!

CSS

              
                body {
  font-family: "Rokkitt", "Times New Roman", serif;
  font-weight: 400;
  padding-top: 20px;
  transition: background-color 0.5s ease;
}

.background-colors {
  margin: auto;
}

blockquote {
  padding: 10px 15px;
  margin: 0;
  line-height: 1.3em;
  margin-left: 20px;
  padding-left: 0;
  border-left: 0;
  font-size: 28px;
  text-align: center;
  font-weight: 400;
}

blockquote:before {
  content: "“";
  position: relative;
  left: -10px;
  top: 28px;
  font-size: 80px;
}

blockquote small {
  text-align: right;
  clear: both;
  margin-bottom: 30px;
  font-weight: 300;
  display: none;
}

blockquote .small:before,
blockquote footer:before,
blockquote small:before {
  top: -6px;
  position: relative;
}

.well {
  padding: 10px 30px;
  max-width: 520px;
  margin: 0 auto;
}

.well > div {
  padding: 5px;
}

ul,
li {
  padding: 0;
  margin: 0;
}

a {
  color: inherit;
}

p a {
  text-decoration: underline;
}

.new-quote {
  padding: 10px;
  float: right;
  display: inline-block;
  width: 200px;
  text-align: right;
}
.attribution,
.new-quote button {
  color: #fff;
  padding: 8px 10px;
  font-size: 16px;
  text-align: center;
}
.new-quote button,
.attribution a {
  color: #fff !important;

  text-decoration: underline;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  cursor: pointer;
}

.new-quote button {
  border: 0;
  text-decoration: none;
}
.attribution {
  text-align: center;
  width: 100%;
  padding: 10px;
}

              
            
!

JS

              
                function ran_col() { 
  var letters = ['f19d2d', 'a40a60', '333'];
  var color = "#" + letters[Math.floor(Math.random() * letters.length)];
  $('.background-colors').css('background-color', color);

  $('blockquote small').css('color', color);
  $('body').css('color', color);
  $('a').css('color', color);

}

$(function() {
  ran_col();
  getQuote();
});

$("#loadNewQuote").click(function() {
  getQuote();
});

function getQuote() {
  ran_col();
  $.ajax({
    url: 'https://quotesondesign.com/wp-json/wp/v2/posts/?orderby=rand',
    success: function(data) {
      var post = data.shift();  
      $("blockquote p").replaceWith(post.content.rendered);
      $("blockquote small").html(post.title.rendered);
 
     var linktext = (post.content);
      linktext = $(linktext).text();
        
     //alert(linktext);
      var tweet = "https://twitter.com/intent/tweet?hashtags=freecodecamp,quotes&text=" + linktext+ "&url=https://codepen.io/virtual/pen/jqJeKb ";
      var tumblr = "https://www.tumblr.com/share/link?url=http%3A%2F%2Fcodepen.io/virtual/pen/jqJeKb";
      $('.tweet-link').attr("href",tweet);
      $('.tumblr-link').attr("href",tumblr);
    },
    cache: false
  });
  $('blockquote small').css('display','block');
}
              
            
!
999px

Console