Pen Settings



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


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.


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.


                <!DOCTYPE html>
    <title>Wisdom Generator</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <section class="container text-center">
      <h1>Wisdom Generator</h1>
      <div class="row">
        <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-xs-12">
          <div class="panel panel-default">
            <h3 id="quote" class="colored"></h3>
            <h4 id="author" class="colored"></h4>
            <div class="btn-toolbar" >
              <div class="btn-group">
                <button id="twitterButton" class="btn btn-default btn-social"><i class="fa fa-twitter"></i></button>
                <button id="newQuoteButton" class="btn btn-default btn-social">New Wisdom</button>
    <script src=""></script>    


                  /* pacifico font */
@import url(;
  -webkit-transition: background-color 1.5s;
  -moz-transition: background-color 1.5s;
  -o-transition: background-color 1.5s;
  transition: background-color 1.5s;
h1 {
    font-family: 'Pacifico', serif;
    font-size: 4em;
    color: white;
    text-shadow:2px 2px #222;
  color: white;
  -webkit-transition: background-color 1.5s;
  -moz-transition: background-color 1.5s;
  -ms-transition: background-color 1.5s;
  -o-transition: background-color 1.5s;
  transition: background-color 1.5s;
    -webkit-transition: color 1.5s;
    -moz-transition: color 1.5s;
    -ms-transition: color 1.5s;
    -o-transition: color 1.5s;
    transition: color 1.5s;
  color: white;
  border-color: white;
#quote, #author{
  padding: 0.25em;
button:focus, button:active{
  outline: 0 !important;


                // Color array for sorting background colors
var colors = ["#ffcc66","#ff6666","#666699","#999966","#009999","#cc00ff"];
var currentColor = colors[0];

// API URLs initialization:
// Quotes are retrieved from ...
var forismaticURL = "";

// And can be sent to Twitter
var twitterURL = "";

// Variables to keep tracking of the current Quote and Author
var currentQuote;
var currentAuthor;

// As soon as the page loads, generate new quote
$(document).ready( function(){ NewQuote(); });

// Whenever the "New Quote" button is pressed, generate new quote
$("#newQuoteButton").on("click",function(){ NewQuote(); });
// When "Twitter" button is pressed, open new window with the current quote and author.
$("#twitterButton").on("click",function(){ + '"' + currentQuote + '"- '+ currentAuthor); });

// To generate a new quote ...
function NewQuote(){
  // retrieve a quote from into a JSON
  $.getJSON(forismaticURL, function(JSON){
    // and set the current quote and author to our variables
    currentQuote = JSON.quoteText; 
    currentAuthor = JSON.quoteAuthor;
    // if the author is unknown (empty string returned) then we'll display "Unknown Author"
    if(currentAuthor == "") currentAuthor= "Unknown Author";

// to animate the elements in the page ...
function Animate(){
    // add the "Fade In Down" animation class from Animation.css to them ...
    $("#quote").addClass("animated fadeInDown");
    $("#author").addClass("animated fadeInDown");
    // wait for the animation to be over ...
      // and remove them
      $("#quote").removeClass("animated fadeInDown");
      $("#author").removeClass("animated fadeInDown");
    }, 800);

// to change the color of the elements
function ChangeColor(){
  // choose randomly a color from the colors array.
  currentColor = colors[Math.floor(Math.random() * colors.length)];
    // set the choosen color to the body, button and colored elements

// to set (show) the quote to the user ...
function SetQuote (){
  // change the html inside the quote and author elements to the current quote (inside brackets - Awesome Font) and author variables
  $("#quote").html( '<i class="fa fa-quote-left"></i> '+ currentQuote + ' <i class="fa fa-quote-right"></i>')
  $("#author").html('- ' + currentAuthor);