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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div class="container-fluid">
  <div class="jumbotron text-center">
  Random Movie Quote Generator
</div>
  <div class="row">
    <div id="quoteArea" class="col-xs-6 col-xs-offset-3">
      <div class="row" id='q'>
        <i class="fa fa-quote-left pull-left"></i>
        <span class="q ">Humankind cannot gain anything without first giving something in return. To obtain, something of equal value must be lost.</span>
        <i class="fa fa-quote-right pull-right"></i>
      </div>
      <div class='author text-right row'>
        - Fullmetal Alchemist
      </div>
      <div class="row">
        <div class="col-xs-6 text-center">
          <button class="btn btn-default" id="button">New quote</button>
        </div>
        <div class="col-xs-6 text-center">
          <div id="tweetBtn">
            <a class="twitter-share-button" href="https://twitter.com/share" data-url=" " data-text="Humankind cannot gain anything without first giving something in return. To obtain, something of equal value must be lost. - Fullmetal Alchemist" data-size="large">Tweet</a>
            <script>
              ! function(d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (!d.getElementById(id)) {
                  js = d.createElement(s);
                  js.id = id;
                  js.src = "//platform.twitter.com/widgets.js";
                  fjs.parentNode.insertBefore(js, fjs);
                }
              }(document, "script", "twitter-wjs");
            </script>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="footer text-center">
    <p> Random Quote Machine - Developed by <a href="">Nao</a></p>
    <p class="small"> part of Free Code Camp learning path<p>
    <div class="credits col-xs-6 col-xs-offset-3">
      <h5> CREDITS :</h5>
      <div class="col-xs-6 small" id="left-div">
      <p><a href="https://market.mashape.com/andruxnet/random-famous-quotes">Andrux</a> - Quote api</p>
      <p><a href="https://dev.twitter.com/overview/api"> Twitter</a> - Twitter api</p>
      <p><a href="https://getbootstrap.com/"> Boostrap</a> - CSS Framework</p>
      </div>
      <div class="col-xs-6 small" id="right-div">
      <p><a href="https://jquery.com/"> jQuery</a> - JavaScript Framework</p>
      <p><a href="http://fontawesome.io/"> Font Awesome</a> - Font Icon </p>
      <p><a href="https://fonts.google.com/"> Google Fonts</a> - Font library</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background: #32ACB2;
}

.jumbotron {
  background: #67989A;
  color: #092424;
  font-family: 'Shrikhand', cursive;
  font-size: 50px;
  padding: 1px;
}

#quoteArea {
  background: #67989A;
  color: #092424;
  border-radius: 20px;
  min-height: 200px;
  font-size: 30px;
}

#q {
  margin-top: 15px;
  padding-left: 10px;
  padding-right: 10px;
}

.q {
  font-family: 'Sacramento', cursive;
  font-size: 40px;
  margin-bottom: 0px;
}

.fa-quote-left {
  margin-top: -5px;
  padding-left: 0px;
  margin-right: 0px;
  padding-right: 0px;
  color: b4242f;
  font-size: 45px;
}

.fa-quote-right {
  margin: 0px;
  padding: 0px;
  padding-top: 5%;
  color: b4242f;
  font-size: 45px;
}

.author {
  font-family: 'Amatic SC', cursive;
  font-size: 25px;
  padding: 5px;
  margin-right: 25px;
  padding-bottom: 25px;
}

.btn {
  height: 28px;
  margin-bottom: 10px;
  padding-top: 3px;
}

.footer {
  color: #3C7878;
  line-height: 50%;
  margin-top: 40px;
}

.credits {
  line-height: 45%;
  padding-bottom: 10px;
}

a {
  color: #3C7878;
}
a:hover {
  color: #3C7878;
  text-decoration: underline;
}
#left-div {
  text-align: right;
}
#right-div {
  text-align: left;
}
              
            
!

JS

              
                $(document).ready(function() {
  var getQuote = function() {
    return $.ajax({
      url: 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies',
      headers: {
        'X-Mashape-Key': 'O7iTZLDUmYmshesEET9FNisKTATLp1o1RWdjsnVv0D9SKqXw9w'
      },
      method: 'GET',
      dataType: 'json',
      contentType: 'application/x-www-form-urlencoded',
    });
  };
  var setQuote = function(data) {
    $('.q').html(data.quote);
    $('.author').html("- " + data.author);
  };
  $('button').on('click', function(ev) {
    getQuote().done(function(data) {
      setQuote(data);
      var quote = '"' + data.quote + '" - ' + data.author;
      ev.preventDefault();
    // Remove existing iframe
    $('#tweetBtn iframe').remove();
    // Generate new markup
    var tweetBtn = $('<a></a>')
      .addClass('twitter-share-button')
      .attr('href', 'https://twitter.com/share')
      .attr('data-url', ' ')
      .attr('data-text', quote)
      .attr('data-size', 'large');
    $('#tweetBtn').append(tweetBtn);
    twttr.widgets.load();
    });
  });
});
              
            
!
999px

Console