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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <script>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"));</script>
<div class='text-center'>
  <h1>Random Quote Machine</h1></div>
<div class='quoteInhere '>
  <div class='quote'>
    <p></p>
  </div>
  <div class='author text-right'>
    <p><span class='change_author'><p></p></span></p>
  </div><div class = 'text-left'><a class="twitter-share-button"
  href="https://twitter.com/intent/tweet?text=">
Tweet</a></div>
  <div class='btn btn-default  text-center change'>Change</div>
</div>
              
            
!

CSS

              
                h1{
   color:white;
  font-weight:bold;
  font-family:Century Gothic;
}
body{
  background-color:#9E7A7A;
}
.quoteInhere{
  background-color:white;
  margin:10% 30% auto 30%;
  padding:20px 60px 20px 40px;
  border-radius: 15px 50px;
}
.quote{
  color:#9E7A7A;
  margin-bottom : 20px;
}
.change{
  margin : 6% auto auto 90%;
  font-fanily:Helvetica;
  font-weight:bold;
  background-color:#9E7A7A;
  color:white;
  border-radius:20px;
}
p{
  font-size:30px;
  font-fanily:Helvetica;
  font-weight:bold;
}
.author{
  color:#9E7A7A;
}
              
            
!

JS

              
                $(document).ready(function() {
  var quote = ['“There is only one Lord of the Ring, only one who can bend it to his will. And he does not share power.”', '“That there’s some good in this world, Mr. Frodo… and it’s worth fighting for.”', '“Even the smallest person can change the course of the future.”', '“The time of the Elves… is over. Do we leave Middle-Earth to its fate? Do we let them stand alone?”', '“We swears, to serve the master of the Precious. We will swear on… on the Precious!”', '“I am Gandalf the White. And I come back to you now… at the turn of the tide.”', '“Oh, it’s quite simple. If you are a friend, you speak the password, and the doors will open.”', '“Well, what can I tell you? Life in the wide world goes on much as it has this past Age, full of its own comings and goings, scarcely aware of the existence of Hobbits, for which I am very thankful.”', '“For the time will soon come when Hobbits will shape the fortunes of all.”', '“There is no curse in Elvish, Entish, or the tongues of Men for this treachery.”'];
  var author = ['Gandalf', 'Sam', 'Galadriel', 'Lady of the Wood', 'Gollum', 'Gandalf', 'Gandalf', 'Gandalf', 'Galadriel', 'Treebeard'];
  var a = Math.round(Math.random() * 10);
  $('.quote p').animate({opacity:0},500,function(){
    $('.quote p').animate({opacity:1},500);
    $('.quote p').html(quote[a]);
  });
  $('.change_author').animate({opacity:0},500,function(){
    $('.change_author').animate({opacity:1},500);
      $('.change_author').html(author[a]);
  });
  $('.twitter-share-button').attr('href','https://twitter.com/intent/tweet?text='+ quote[a]);
  $('.btn').click(function() {
    var c = Math.round(Math.random() * 10);
    $('.quote p').animate({opacity:0},500,function(){
    $('.quote p').animate({opacity:1},500);
    $('.quote p').html(quote[c]);
  });
  $('.change_author').animate({opacity:0},500,function(){
    $('.change_author').animate({opacity:1},500);
      $('.change_author').html(author[c]);
  });
  $('.twitter-share-button').attr('href','https://twitter.com/intent/tweet?text='+ quote[c]);
  });
})
              
            
!
999px

Console