Pen Settings



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


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.


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.


    <meta charset="utf-8">  
<script defer src=""></script>
<body><div class="everything">
  <h1><i class = "fa fa-quote-left"></i>&nbsp;Random Quote Generator&nbsp;<i class = "fa fa-quote-right"></i></h1>
  <div id = "quoteDisplay">
  <div id = "quote">You cannot buy the revolution. You cannot make the revolution. You can only be the revolution. It is in your spirit, or it is nowhere.</div>
    <div id = "author">- Ursula K. Le Guin (from The Dispossessed)</div>
    <div class="sharing"><i class = "fab fa-twitter" id = "tweetThis" title = "Tweet this quote"></i><i class = "fa fa-bullhorn" id = "tootThis" title = "Toot this quote on your favorite Mastodon instance!"></i></div>
    <button id="quoteButton" title="new quote?"><i class = "fa fa-quote-left"></i>&nbsp;new quote?&nbsp;<i class = "fa fa-quote-right"></i></button>
  <footer>created by <a href="" target="_blank"></a></footer>   
based on Free Code Camp project:
created by:


                body {
  font-family: monospace;
  padding: 3%;
  margin: auto 0;
#quoteDisplay {
  width: 95%;
  background-color: rgba(116,119,159,0.6);
  margin-bottom: 1%;
  border: none;
#quote {
  padding: 5%;
  font-size: 1.5em;
  text-align: center;
#author {
  padding: 5%;
  font-size: 1.2em;
  text-align: right;
.sharing {
  font-size: 1.5em;
  text-align: right;
  margin-right: 0.5%;
  bottom: 0;
button {
  font-family: monospace;
  font-size: 1em;
  padding: 0.3em;
  border: dotted;
  background-color: rgba(116,119,159,0.2);
footer {
  text-align: center;
  font-size: 0.7em;
  margin-top: 2%;
  opacity: 0.7;
.everything {
  max-width: 700px;
  border: 1px black solid;
  border-radius: 1%;
  padding: 5%;
  background-color: /* gradient */ 
background: -moz-linear-gradient(-45deg, rgba(104,159,149,1) 0%, rgba(104,159,149,0) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(-45deg, rgba(104,159,149,1) 0%,rgba(104,159,149,0) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(135deg, rgba(104,159,149,1) 0%,rgba(104,159,149,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#689f95', endColorstr='#00689f95',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */

/* gradient code:
color pallette: */


                $(document).ready(function() {
  var quote = 'You cannot buy the revolution. You cannot make the revolution. You can only be the revolution. It is in your spirit, or it is nowhere.';
  var author = 'Ursula K. Le Guin (from The Dispossessed)';
  function NewQuote() {
    url: "",
    type: "GET",
    headers: {
        "X-Mashape-Key": "QIlhPCe483msh0TO6cWOP41jFxXDp1wdjKRjsnM8JfajlxVhJ1",
        "Accept": "application/json", },
    success: function(response) {
        quote = response.quote;
        author =;
        if (author) {
          $('#author').text('- ' + author);
        } else {
          $('#author').text('- Unknown');
    // close success function:
    // close ajax:
  // close NewQuote function: 
$('#quoteButton').on('click', function(event) { 
$('#tweetThis').on('click', function(event) {"" + quote + " - " + author);

$('#tootThis').on('click', function(event) {"web+mastodon://share?text=" + quote + " - " + author);
// close document.ready:
/* based on Free Code Camp project:
created by:

free random quote API:

thanks to Mark Snow for a youtube video based on this codepen: 

thanks also to Stephen Mayeux for this video: