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 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


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.


                <div class="container">
  <h1 class="text-center">Random Quote Machine</h1>
  <div class="container-fluid quote-display" id="quote-display">
    <!--   quote will display here -->
  <div class="container text-center ">
    <button class="btn btn-primary" id="quote-button">New Quote</button>
    <i id="tweet-button" class="fa fa-twitter fa-2x"> </i>
  <div id="log"></div>
  <footer class="footer fixed-bottom">
    <div class="container text-center">

        <a href="" target="_blank"><i class="fa fa-codepen fa-3x" aria-hidden="true"></i></a>
        <a href="" target="_blank"><i class="fa fa-facebook-official fa-3x" aria-hidden="true"></i></a>
        <a href="" target="_blank"><i class="fa fa-twitter-square fa-3x" aria-hidden="true"></i></a>
        <a href="" target="_blank"><i class="fa fa-github-square fa-3x" aria-hidden="true"></i></a>
        <a href="" target="_blank"><i class="fa fa-linkedin-square fa-3x" aria-hidden="true"></i></a>
        <a href="" target="_blank"><i class="fa fa-google-plus-square fa-3x" aria-hidden="true"></i></a>
        <a href="" target="_blank"><i class="fa fa-youtube-square fa-3x" aria-hidden="true"></i></a>
        <a href="" target="_blank"><i class="fa fa-free-code-camp fa-3x" aria-hidden="true"></i></a>

      <p>Copyright &copy; 2017 Steven Taveras for <a href=""></a></p>
      <a href=""></a>



                @import url('|Righteous|Archivo+Black|Cormorant+Garamond');
html {
  min-height: 100%;
body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
  background: url('')
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  .container {
    height: 100%;
  h1 {
    font-family: 'Tangerine', serif;
    text-shadow: 4px 4px 4px #000;
    color: #fff;
    font-size: 4em;
    padding: .5em;
  button {
    font-family: 'Cormorant Garamond', serif;
    background-color: #fff;
    font-size: 1em;
    border-radius: 10px;
    width: 25%;
  .quote-display {
    font-family: cursive;
    //text-shadow: 4px 4px 4px #38423a;
    background-color: rgba(0, 0, 0, .3);
    color: #fff;
    width: 80%;
    height: 100%;
    margin: 1em auto;
    border-radius: 15px;
    box-shadow: 0 2px 2px -2px #aaa;
    p {
      font-family: 'Righteous', sans-serif;
      font-size: 1.2em;
      padding: .5em;
  footer {
    color: #fff;
    margin: 1em auto 1em auto;
    a {
      color: #ADD8E6;
      margin: 0 auto;
  i {
    color: #fff;
    margin: 0 auto;
    &:hover {
      color: #f00;



var quoteButton;
var quoteBox;
var currentQuote;
var randomNumber;
var html;
// var quotes = [
//   {
//     author: "Princess Diana",
//     quote:
//       "Carry out a random act of kindness, with no expectation of reward, safe in the knowledge that one day someone might do the same for you.",
//     source: ""
//   },
//   {
//     author: "Helen Mirren",
//     quote:
//       "I don't believe that if you do good, good things will happen. Everything is completely accidental and random. Sometimes bad things happen to very good people and sometimes good things happen to bad people. But at least if you try to do good things, then you're spending your time doing something worthwhile.",
//     source: ""
//   },
//   {
//     author: "Steve Jobs",
//     quote: "I believe life is an intelligent thing: that things aren't random.",
//     source: ""
//   },
//   {
//     author: "Albert Camus",
//     quote:
//       "It is necessary to fall in love... if only to provide an alibi for all the random despair you are going to feel anyway.",
//     source: ""
//   }
// ];

// quoteButton = document.getElementById("quote-button");
// quoteButton.addEventListener("click", changeQuote, false);
// quoteBox = document.getElementById("quote-display");

// function changeQuote(){
//   'use strict';

//   html = "";
//   randomNumber = Math.floor(Math.random() *quotes.length);
//   html += '<p>"' + quotes[randomNumber].quote + '"</p>';
//   html += '<p> - ' + quotes[randomNumber].author + '</p>';
//   html += '<p>' + quotes[randomNumber].source + '</p>';
//   quoteBox.innerHTML = html;
//   currentQuote = quotes[randomNumber].quote + " -" + quotes[randomNumber].author;
// }

//uodates quoteBox
function update(response) {
  'use strict';
  html = "";
  html += '<p>"' + response.quoteText + '"</p>';
  html += "<p> - " + response.quoteAuthor + "</p>";
  html += "<a href='" + response.quoteLink + "' target = '_blank'>" + response.quoteLink + "</a>";
  currentQuote = response.quoteText + " -" + response.quoteAuthor;

//incase of error
function error(jqxhr, textStatus, err) {
  console.log("Request Failed: " + textStatus + ", " + err);

//tweet button pressed function
$("#tweet-button").click(function() {"" + currentQuote);

//gets json from web and performs function
$("#quote-button").click(function() {
  //using forismatic api