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.

            
              <div class="container-fluid">
  <div id="quote-box">
    <div class = "row">
      <div class = "col-xs-12 col-md-offset-4 col-sm-6 col-md-offset-4 col-md-4  col-lg-offset-4 col-lg-4 box">
        <div class = "row">
          <div id="quote" class="col-xs-12 col-md-12 col-lg-12">"<div id="replacequote"></div> </div>
          <div id="author" class="col-xs-12 col-md-offset-4 col-md-6  col-lg-offset-4 col-lg-6"><div id="replaceauth"></div></div>
        </div>
        <div class = "col-xs-6 col-sm-6 col-md-offset-1 col-md-2  col-lg-offset-1 col-lg-2"><a class="btn" id="tweet-quote" title="Tweet this quote!" target="_blank">
         <i class="fa fa-twitter font-aws" aria-hidden="true"></i>
        </a></div>
        <div class = "col-xs-6 col-sm-6 col-md-offset-5 col-md-4 col-lg-offset-5 col-lg-4">
          <button id = "getMessage" class = "btn btn-green">
            Generate
          </button>
        </div>
      </div>
    </div>
  </div>
</div>
            
          
!
            
              body{
  background:#8a8a5c;
}
#quote-box{
  margin: 40px 0px 40px 0px;
}
.box{
  background-color:#FFF;
  border-radius: 5%;
  min-height:320px;
  max-height:500px;
}
h4
{
  color:#6600cc;
  font-family: 'Cinzel', serif;
  font-size: 35px;
}
#quote{
  margin: 10px 0px 0px 0px;
  color:#6600cc;
  font-family: 'Cinzel', serif;
  font-size: 25px;
}
#author{
  color:#6600cc;
  font-family: 'Tangerine', serif;
  font-size: 30px;
  height 30px;
}
.btn-green{
  background-color: #8a8a5c;
  color:#FFF;
  font-family: 'Tangerine', serif;
  font-size: 30px;
  margin: 0px 0px 20px 0px;
}
#tweet-quote{
  float: left;
  padding: 0px;
  padding-top: 4px;
  text-align: center;
  font-size: 1.2em;
  margin-right: 5px;
  height: 30px;
  width: 40px;
  background-color: #8a8a5c;
}
.font-aws
{
  color:#FFF;
}
            
          
!
            
              function getRandom(){
    var myQuotes = [{
          quote: "I know where I'm going and I know the truth, and I don't have to be what you want me to be. I'm free to be what I want." ,
          author: "Muhammad Ali",
      }, {
          quote: "Good, better, best. Never let it rest. 'Til your good is better and your better is best.",
          author: "St. Jerome",
      }, {
          quote: "However difficult life may seem, there is always something you can do and succeed at.",
          author: "Stephen Hawking",
      }, {
          quote: "If your actions inspire others to dream more, learn more, do more and become more, you are a leader.",
          author: "John Quincy Adams",
      }, {
          quote: "I am not afraid of an army of lions led by a sheep; I am afraid of an army of sheep led by a lion.",
          author: "Alexander the Great",
      }, {
          quote: "There is no substitute for hard work.",
          author: "Thomas A. Edison",
      }, {
          quote: "The best preparation for good work tomorrow is to do good work today.",
          author: "Elbert Hubbard",
      }, {
          quote: "The truth is you don't know what is going to happen tomorrow. Life is a crazy ride, and nothing is guaranteed.",
          author: "Eminem",
      }, {
          quote: "Yesterday is not ours to recover, but tomorrow is ours to win or lose.",
          author: "Lyndon B. Johnson",
      }, {
          quote: "I'd rather attempt to do something great and fail than to attempt to do nothing and succeed.",
          author: "Robert H. Schuller",
      }];
      var randomQuote = Math.floor(Math.random() * myQuotes.length);
      $('#replacequote').text(myQuotes[randomQuote].quote); 
      $('#replaceauth').text(myQuotes[randomQuote].author);
  }
$(document).ready(function(){
  $("#getMessage").on("click", function() {
      getRandom();
  });
  $("#tweet-quote").on('click',function(){
    var quote = $('#replacequote').html();
    var author = $('#replaceauth').html();
    var tweet = 'https://twitter.com/intent/tweet?text=' + quote + ' - ' + author;
    $('#tweet-quote').attr('href', tweet);
  });
  getRandom();
});
            
          
!
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