Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <html lang="en">

<head>
  <meta charset="utf-8">
  <!-- <link rel="canonical" href="https://dev.twitter.com/web/tweet-button"> -->
  <link href="https://fonts.googleapis.com/css?family=Baloo+Bhaina|Merriweather" rel="stylesheet" type='text/css'>
  <title>Random Quote Machine</title>
</head>
<body>
  <div class="container-fluid text-center">
    <h2>Quote of the day
    <a href="#" class="fa fa-twitter" id="tweet-button" title="Tweet this quote!"></a>
      <!--https://twitter.com/intent/tweet/?text=  -->
      </h2>
    <div id="quoteContainer">
      <span id="quote"></span>
      <br/>
      <span id="author"></span>
    </div>
    <!-- end quoteContainer-->
    <a href="#" id="quoteButton">Quote Me</a>
  </div>
  <!-- end Container-->
</body>
  <footer>@tourdejord</footer>
</html>
              
            
!

CSS

              
                /* font-family: Baloo Bhaina;*/
body {
	position: relative;
	width: 100%;
	height: 100%;
  color: #3b5998;
}
.container-fluid {
  margin-bottom: 100px;
}

h2 {
	font-family: Merriweather;
	font-variant: small-caps;
	font-size: 4em;
}

#quoteContainer {
  padding: 2% 3% 2% 3%;
	text-align: center;
	margin: auto;
  margin-top: 30px;
  margin-bottom: 40px;
  max-width: 650px;
  height: 400px;
	max-height: 200px;
	font-family: Baloo Bhaina;;
  font-size: 1.85em;
  box-shadow: 0px 0px 20px black;
	overflow: auto;
}

#tweet-button {
  margin: auto;
  font-size: 1em;
  cursor: pointer;
  }

#quoteButton {
  position: relative;
	background-color: #09c;
	color: #f7f7f7;
	font-family: Baloo Bhaina;
  font-size: 2em;
	text-decoration: none;
  margin: 40px 0px 0px 0px;
  padding: 0.2% 1.5% 0% 1.5%;  
	box-shadow: 0px 0px 20px black;
  width: 100%;
  height: 100%;

}
#quoteButton:hover {
  background-color: #3b5998;
  cursor: pointer;
  color: #fff;
}
#quoteButton:active {
  cursor: pointer;
  background-color: red;
}

footer {
  font-size: 1.3em;
  padding-left: 10%;
}
              
            
!

JS

              
                $(document).ready(function() {
   var randomNumber, randomQuote, randomAuthor;
  /*a fn for a fn.  Thanks S.H.*/  function getQuote(){
    var quotes =  ["Life is really simple, but we insist on making it complicated.", "The most important thing is to enjoy your life - to be happy - it's all that matters.", "Action may not always bring happiness; but there is no happiness without action.", "It is not how much we have, but how much we enjoy, that makes happiness.", "Coming together is a beginning; keeping together is progress; working together is success.", "Success is not final, failure is not fatal: it is the courage to continue that counts.", "Defeat is not the worst of failures. Not to have tried is the true failure.", "Defeat is not the worst of failures. Not to have tried is the true failure.", "The starting point of all achievements is desire.", "Success is simple.  Do what's right, the right way, at the right time.", "Do not dwell in the past, do not dream of the future, concentrate the mind on the present moment.", "In the end, it's not the years in your life that count.  It's the life in your years.", "I have found the paradox, that if you love until it hurts, there can be no more hurt, only more love.", "Walking with a friend in the dark is better than walking alone in the light.", "Stay hungry, stay foolish.", "The secret of getting ahead is getting started.", "All you need in life is ignorance and confidence, and then success is sure.", "However difficult life may seem, there is always something you can do and succeed at.", "The way to get started is to quit talking and begin doing.", "The trust of the innocent is the liar's most useful tool."
      ];
    var authors = ["Confucious", "Audrey Hepburn", "Benjamin Disraeli", "Charles Spurgeon", "Henry Ford", "Winston Churchill", "George Edward Woodberry", "Napoleon Hill", "Arnold H. Glasow", "Buddha", "Abraham Lincoln", "Mother Teresa", "Helen Keller", "Steve Jobs", "Mark Twain", "Mark Twain", "Stephen Hawking", "Walt Disney", "Stephen King"];
      
    randomNumber =  Math.floor((Math.random()*quotes.length));
    randomQuote = quotes[randomNumber];
    randomAuthor = "-" + authors[randomNumber];
    
    $("#quote").text(randomQuote);
    $("#author").text(randomAuthor);
                    } //end getQuote fn 0     
        $("#quoteButton").click(function(){
        var timeAnimation = 500;    
        $("#quoteContainer").fadeOut(timeAnimation/1.5, getQuote);
        $("#quoteContainer").fadeIn(timeAnimation*1.5);     
      
        }); //end quotebutton fn 1
  
            $('#tweet-button').click(function() {
            window.open("https://twitter.com/intent/tweet/?text=" + randomQuote + " " + randomAuthor);
                   
            });  //end tweet-button fn 2

}); //document.ready fn !== (n);
                  
                  
              
            
!
999px

Console