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

              
                <body class="bodybg">
  
  <!--Container-->
<div class="container">
  <!-- Quote Div-->
  <div align="center" class="quoteBox">
    <!--Left Quotation Mark-->
     <i class="fa fa-quote-left fa-2x" aria-hidden="true"></i>
    <!--Quote Text-->
    <p class="quoteText">Welcome to my quote generator. Lets click to see quotes.</p>
    <!--Right Quotation Mark-->
    <i class="fa fa-quote-right fa-2x" aria-hidden="true"></i>
    <div>
    <p class="quoteAuthor"><em> -hasan S</em></p>
    </div>
    <!--Buttons Div-->   
  <div class="divButtons">
        <a id="tweetMe" target="_blank"><i class="fa fa-twitter fa-4x link_tweet" aria-hidden="true"></i></a>
    <button id="nextQuote" type="button" class="btn btn-primary btn-responsive">MORE</button>
    </div>    
  </div> 
</body>
              
            
!

CSS

              
                .bodybg{
 background-color: #2E5909;
}
.fa-quote-left{
  color:#2E5909;  
  margin-top:10px;
  float:left;
}
.fa-quote-right{
  color:#2E5909;
  float:right;  
  margin-top:50px;
}

.quoteBox{      
    background-color:#FCF9F9;   
    margin-bottom: 20px;
    margin-top:70px;
    box-shadow: 0px 30px 10px -20px #1e1e1e;
    overflow: hidden;
    border-radius: 1%;
    max-width: 450px;
    margin: 150px auto;
    margin-bottom: 0;
    padding: 30px 50px 50px 30px;  
    border-radius:35px;
}
.centered{
    text-align:center;}
.btn-primary{
  color:silver;
  background-color:#2E5909;
   margin-top:100px;  
   font-size:20px;  
  font-family:arial;
   float:right;   
}

.link_tweet{ 
  color:#2E5909;
  margin-top:80px;
  padding-left:5px;
  float:left;
}

.quoteText{
  color:"#2E5909"
  margin-top:20px;
  margin-left:2px;
}
p{
  font-family:verdana;
  font-color:black;
  font-size:20pt;
}
              
            
!

JS

              
                           //fade in/fade out//
$(document).ready(function(){
        $("#nextQuote").click(function(){           
            $(".quoteText").fadeOut(1000);
           $(".quoteText").fadeIn(1000);
           $(".quoteAuthor").fadeOut(1000);
           $(".quoteAuthor").fadeIn(1000);
        });
    });

    //setting random colors//
$('#nextQuote').on("click",function() {
  var colors = ["#16A085","#2980b9","#34495e","#9b59b6","#e67e22","#2c3e50","#3498db","#c0392b","#bdc3c7","#f1c40f","#8E0C0C","#10EC17","#D610EC"]  
  var rand = Math.floor(Math.random()*colors.length);           
  $(".btn-primary").css("background-color", colors[rand]);
  $("body").css("background-color",colors[rand]);
  $(".link_tweet").css("color",colors[rand]);
  $(".fa-quote-left").css("color",colors[rand]);
  $(".fa-quote-right").css("color",colors[rand]);
  $(".quoteText").css("color",colors[rand]);
  $(".quoteAuthor").css("color",colors[rand]);
  
 
});
/*Getting quote data using JSON*/
$(document).ready(function(){
$("#nextQuote").on("click",function getData(quote,author){
$.getJSON("https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?", function(json) {
   quote = json.quoteText; 
   author = json.quoteAuthor; 
  if(author!==""){
  $(".quoteText").html("<p>" + quote + "</p>");  
  $(".quoteAuthor").html("<em>-" + author + "</em>");}
  else{
     $(".quoteAuthor").html("<em>-" + "Unknown" + "</em>");
  } 
  });   
 });   
});
  /* send quote tweeter*/
$(document).ready(function() {
   $("#tweetMe").click(function(){
     var textToTweet=$(".quoteText").text()+ ' -' + $(".quoteAuthor").text();
    
     if(textToTweet.length>140){
       alert('Tweet should be less than 140 Chars');
     }
       else {
 var tweetLink = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(textToTweet);
 window.open(tweetLink,'_blank');
       }
})
});
              
            
!
999px

Console