123

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

<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>
            
          
!
            
              /* 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%;
}
            
          
!
            
              $(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
🕑 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.

Console