css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <html lang="en">
<body id="myDIV">
<div class="container-fluid">
<table>
<tr>
  <!--<div class = "title row text-center">-->
    <th><h1>Random Quote Machine</h1></th>
  <!--</div>-->
</tr>
</table>
<div class = "jumbotron jumbo row text-center quote">
  <h2>Click the button for a quote.</h2>
</div>
<div class="row text-center">
  <button id = "getRandomQuote" class = "btn btn-primary">
    Get Quote
  </button>
</div>
<div class = "row text-center">
  <div id="container" class = "col-xs-12 tweet">
  </div>
</div>
  </body>


</html>
    
     
            
          
!
            
              #myDIV {
 background-color: #ffbf00;
 -webkit-animation: mymove 20s infinite;
 animation: mymove 20s infinite;
}
@-webkit-keyframes mymove {
40% {background-color: #cc0000;}
30% {background-color: #990033;}
30% {background-color: #ffbf00;}
}
@keyframes mymove {
 40% {background-color: #cc0000;}
 30% {background-color: #990033;}
 30% {background-color: #ffbf00;}
}
@keyframes fadein
{
  0%{opacity: 0}
  100%{opacity:1}
}
q {
  quotes: "“" "”" "‘" "’";
}
q:before {
    content: open-quote;
}
q:after {
    content: close-quote;
} 
h1 {
font-size: calc(0.5rem + 5.5vmin);
}
h2, h3 {
  opacity: 0;
  animation-name: fadein;
  animation-duration: 2s;
  animation-timing-function: ease;
  animation-fill-mode:forwards;
  font-size: calc(0.5rem + 3.5vmin);
}
.title {
height: 200px;
vertical-align: middle;
}
.jumbo {
height: 300px;
vertical-align: middle;
background-color: rgba(255,255,255,.80);
} 
table {
table-layout: auto;
width: 100%;
}
tr {
border: none;
text-align: center;
} 
th {
border: none;
text-align: center;
padding: 50px;
}
            
          
!
            
                window.twttr = (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    t = window.twttr || {};
  if (d.getElementById(id)) return t;
  js = d.createElement(s);
  js.id = id;
  js.src = "https://platform.twitter.com/widgets.js";
  fjs.parentNode.insertBefore(js, fjs);

  t._e = [];
  t.ready = function(f) {
    t._e.push(f);
  };

  return t;
}(document, "script", "twitter-wjs"));

  $(document).ready(function() {
    $("#getRandomQuote").on("click", function(){
var array = [
  {
    "wiseQuote": "I think I am, therefore I am. I think.",
    "whoSaidIt": "George Carlin"
  },
  {
    "wiseQuote": "People who see life as anything more than pure entertainment are missing the point.",
    "whoSaidIt": "George Carlin"
  },
  {
    "wiseQuote": "A learning experience is one of those things that say, You know that thing you just did? Don't do that.",
    "whoSaidIt": "Douglas Adams"
  },
  {
    "wiseQuote": "We are stuck with technology when what we really want is just stuff that works.",
    "whoSaidIt": "Douglas Adams"
  },
  {
    "wiseQuote": "Women who seek to be equal with men lack ambition.",
    "whoSaidIt": "Timothy Leary"
  },
  {
    "wiseQuote": "Think for yourself and question authority.",
    "whoSaidIt": "Timothy Leary"
  },
  {
    "wiseQuote": "Each religion has got their own way of making you feel like a victim.",
    "whoSaidIt": "Timothy Leary"
  },
  {
    "wiseQuote": "You're only as young as the last time you changed your mind.",
    "whoSaidIt": "Timothy Leary"
  },
  {
    "wiseQuote": "Why not?",
    "whoSaidIt": "Timothy Leary"
  },
  {
    "wiseQuote": "You must do the thing you think you cannot do.",
    "whoSaidIt": "Eleanor Roosevelt"
  },
  {
    "wiseQuote": "Where knowledge is a duty, ignorance is a crime.",
    "whoSaidIt": "Thomas Paine"
  },
  {
    "wiseQuote": "It is from the Bible that man has learned cruelty, rape, and murder; for the belief of a cruel God makes a cruel man.",
    "whoSaidIt": "Thomas Paine"
  },
  {
    "wiseQuote": "Reason obeys itself; and Ignorance submits to whatever is dictated to it.",
    "whoSaidIt": "Thomas Paine"
  },
  {
    "wiseQuote": "My whole religion is this: Do every duty, and expect no reward for it, either here or hereafter.",
    "whoSaidIt": "Bertrand Russell"
  },
  {
    "wiseQuote": "Sex alleviates tension. Love causes it.",
    "whoSaidIt": "Woody Allen"
  },
  {
    "wiseQuote": "I don't believe in an afterlife, although I am bringing a change of underwear.",
    "whoSaidIt": "Woody Allen"
  },
  {
    "wiseQuote": "I don't work out. If God had wanted us to bend over, he would have put diamonds on the floor.",
    "whoSaidIt": "Joan Rivers"
  },
  {
    "wiseQuote": "A man can sleep around, no questions asked, but if a woman makes nineteen or twenty mistakes she's a tramp.",
    "whoSaidIt": "Joan Rivers"
  }

];

function shuffle(array) {
  var m = array.length, t, i;

  // While there remain elements to shuffle…
  while (m) {

    // Pick a remaining element…
    i = Math.floor(Math.random() * m--);

    // And swap it with the current element.
    t = array[m];
    array[m] = array[i];
    array[i] = t;
  }

  return array;
};
var array2 = shuffle(array);

var printOut = "<div class=\"row text-center quote\"><h2><q>" + array2[0].wiseQuote + "</q></h2></div>";
printOut += "<footer><cite><h3>" + " -" + array2[0].whoSaidIt + "</h3></cite></footer>";
printOut += "<div class=\"row text-center\"></div> <a href=\"https://twitter.com/intent/tweet?text=" + "%22" + encodeURIComponent(array2[0].wiseQuote) + "%22";
printOut += " -" + array2[0].whoSaidIt + "\" class=\"twitter-share-button\" data-size=\"large\"></a>";

$(".quote").html(printOut);
twttr.widgets.load($(".quote"));

});
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console