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="quote-box">
  <div class="quote-text">
    <a href=# class="get-quote" title="click for quote">
      <i class="fa fa-quote-left fa-pull-left fa-border"> </i>
      <span class="text"></span> 
    </a></div>
  <div class="quote-author">
    <a>-- </a><span class="author"> Quote Machine</span>
  </div>
  <div class="share">
  <!--<a target="_blank"><i class="fa fa-facebook"></i></a>-->
    <a target="_blank"><i class="fa fa-tumblr tumblr"></i></a>
    <a target="_blank"><i class="fa fa-twitter twitter"></i></a>
  </div>
</div>
<div class="footer"> code and design by <a>Jiarui Zhou</a></div> 





              
            
!

CSS

              
                
body {
  background-color: rgb(43,45,56);
  color: rgb(210,193,179);
}
a {
  text-decoration: ;
  color: rgb(210,193,179);
}
a:hover {
  color: rgb(215,119,95);
}
title{
  color:blue;
}
i {
  margin-right: 0.4em;
  margin-left: 0.4em;
}
.footer {
  width:250px;
  text-align:center;
  display:block;
  margin: 500px auto auto auto;
  color: rgb(210,193,179);
}

.quote-box {
  position: relative;
  margin:8% auto auto auto;
  width:450px;
  padding: 40px 50px;
  display: table;
}
.quote-text {
   text-align:center;
   width:450px;
   height:auto;
   clear:both;    
   font-weight:500;
   font-size:1.75em;
   font-color: rgb(210,193,179);
}

.quote-author {
    width:450px;
    height:auto;
    clear:both;
    padding-top:50px;
    font-size:1em;
    text-align:right;
}
.share {
  size: 500px;
  margin-left: 0%;
  margin-top:-20px;
  padding-right: 25%;
  margin-right: 0.4em;
}

  

              
            
!

JS

              
                $(document).ready(function() { 
  var randomQuote; 
  var randomAuthor;
  //var randomNumber;
  function getQuote(){  
      //Initial Experiment with quotes array
    /*var quotes = ["The four most beautiful words in our common language: I told you so.","Don’t regret doing things, regret getting caught","In The only way to deal with an unfree world is to become so absolutely free that your very existence is an act of rebellion.","Autumn is a second spring when every leaf is a flower.","Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."];
    var authors = ["- Gore Vidal","- Your Dog","- Albert Camus","- Albert Camus","- Albert Camus","- Albert Einstein"];
    randomNumber = Math.floor(Math.random() * quotes.length);
    randomQuote = quotes[randomNumber];
    randomAuthor = authors[randomNumber];
    $(".text").text(randomQuote);
    $(".author").text(randomAuthor);*/
    $.ajax({
      url: "https://got-quotes.herokuapp.com/quotes",
      success: function(response){
      randomQuote = response.quote;
      randomAuthor = response.character;
      $(".text").text(randomQuote);
      $(".author").text(randomAuthor);
       } 
    });
    
   };   


$(".get-quote").on("click", function(){getQuote()});
$(".twitter").on("click", function(){
  window.open("https://twitter.com/intent/tweet?text=" + randomQuote + " " + randomAuthor);
});
$(".tumblr").on("click", function(){
  window.open('https://www.tumblr.com/widgets/share/tool?   posttype=quote&tags=quotes,freecodecamp&caption='+encodeURIComponent(randomAuthor)+'&content=' + encodeURIComponent(randomQuote)+'&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button');
});
/*$(".facebook").on("click", function(){
  window.open("https://www.facebook.com/dialog/share?share=quote" + randomQuote +" " + randomAuthor)
}) */ 

});





              
            
!
999px

Console