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.


generate a new random quote
generate a random color for background
enable sharing buttons for twitter (half enabled) and tumbler
<div class="container quoteFrame">
    <div class="quote">
    <p><i class="fa fa-quote-left"></i>
			<span id="quoteText">Problems worthy of attack prove their worth by fighting back.</span></p>
			<footer class="blockquote-footer"><span id="quoteAuthor">Someone Famous</span></footer>
    <div class="buttons">
			<div class="btn btn-primary">
				<a id="shareTwitter" href="#"><i class="fa fa-twitter"></i></a>
			<div class="btn btn-primary">
				<a id="shareTumblr" href="#"><i class="fa fa-tumblr"></i></a>
      <a id="getNewQuote" class="btn btn-primary" style="float:right;">New quote</a>
<div class="footer text-center">
	<p class="smaller">by <a href="">aram</a></p>


* To change colors you target  --main-bg-color in: html

html {
  --main-bg-color: #9003fc;

body {
  background-color:  var(--main-bg-color);
  font-family: Raleway;

.quoteFrame {
  border-radius: 3px;
  position: relative;
  margin: 8% auto auto auto;
  max-width: 550px;
  padding: 40px 50px;
  display: table;
  background-color: #fff;

.quoteFrame p {
  text-align: center;
  font-weight: 500;
  font-size: 1.75em;

.quoteFrame footer {
  text-align: right;
  padding-top: 10px;

.buttons {
  padding-top: 20px;

.btn, .btn:hover {
  background-color: var(--main-bg-color);
  border-color: var(--main-bg-color);

.btn:hover {
  opacity: 0.8;

.fa {
  color: var(--main-bg-color);

.quoteFrame .buttons a, .quoteFrame .buttons a:hover  {
  color: white;

.fa-twitter, .fa-tumblr {
  color: white;
  font-size: 18px;

.smaller {
	padding-top: 1rem;
	font-size: 12px;
	color: white;

.smaller a:visited {
	color: white;


                $(document).ready(function() { 
  $("#getNewQuote").on("click", function(){    
    /* request from forismatic API */
		var source= "";
    $.getJSON(source, function(response) {
       /* Change the text inside of #currentQuote*/
			var forismaticResponse = JSON.stringify(response);
			/* convert the stringify result into an object */
			var newQuote = JSON.parse(forismaticResponse);
			$("#shareTwitter").html("<a id='shareTwitter' href='" + newQuote.quoteLink + "&text=" + newQuote.quoteText + "'" + "target='_blank'><i class='fa fa-twitter'></i></a>");
			$("#shareTumblr").html("<a id='shareTumblr' href='" + newQuote.quoteLink + "'" + "target='_blank'><i class='fa fa-tumblr'></i></a>");
				/* Random color generater code from */
			$("html").css("--main-bg-color", function(){
				var color = '#'+(Math.random()*0xFFFFFF<<0).toString(16); 
				if ( color == '#ffffff'){
					return '#f1f1f1';
				} else return color;