css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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>
   <div class="text-center">
  <h1>Random Quote Generator</h1>
     <br/>
  <!--<p>Some of my favorite gaming quotes of all time</p> -->
<img src="https://orig00.deviantart.net/8f4e/f/2016/314/2/3/made4gamez_s_small_icon_pack_by_made4gamez-danxyop.png"/>
  <br/>
  <!-- Add ID now that more than one btn -->
  <button class="btn btn-default" type="submit" id='newQuote'>New Quote</button>
  <a href= "#" id="tweet" class="btn btn-default" >Tweet Out</a>
     <!-- Changes Start -->
     
     
     <!-- Changes End -->
    </div>
  <div class = "quotes text-center">
    
    <span class = "quote"></span>
    <br/>
    <span class = "author"></span>
  </div>
</div>
</div>
            
          
!
            
              body{
  background-color:black;
  font-family:"Times New Roman";
}
h1{
  color:white;
  font-family:"Times New Roman";
  font-size:50px;
}
p{
  color:white;
  font-family:"Times New Roman";
  font-style:italic;
  font-size:20px;
}
img{
  padding:25px;
  height:350px;
}
.quotes{
  width:33%;
  margin-right:auto;
   margin-left:auto;
  border-color:white;
  border-style:solid;
  border-radius:5px;
  margin-top:20px;
  padding:20px;
  height:auto;
  color:white;
}
.quotes{
  font-size:30px;
}
.author{
  font-size:20px;
  font-style:italic;
}
            
          
!
            
              $(document).ready(function(){
  getQuote();
  
 var randomQuote;
  var author;
  function getQuote(){
   //Made quotes array to global var
 /* var quotes = ["We all make choices in life, but in the end our choices make us.","Get over here!",  "What is better? To be born good or to overcome your evil nature through great effort?","The right man in the wrong place can make all the difference in the world.", "Stand in the ashes of a trillion dead souls, and asks the ghosts if honor matters. The silence is your answer.", "Bring me a bucket, and I'll show you a bucket!", "Wanting something does not give you the right to have it.", "Even in dark times, we cannot relinquish the things that make us human.", "The healthy human mind doesn't wake up in the morning thinking this is its last day on Earth. But I think that's a luxury, not a curse. To know you're close to the end is a kind of freedom. Good time to take... inventory.", "It’s a funny thing, ambition. It can take one to sublime heights or harrowing depths. And sometimes they are one and the same.", "A hero need not speak. When he is gone, the world will speak for him.", "No gods or kings. Only man.", "Some trees flourish, others die. Some cattle grow strong, others are taken by wolves. Some men are born rich enough and dumb enough to enjoy their lives. Ain’t nothing fair.", "You can’t break a man the way you break a dog, or a horse. The harder you beat a man, the taller he stands.", "It's time to kick ass and chew bubblegum... and I'm all outta gum.", "Life is cruel. Of this I have no doubt. One can only hope that one leaves behind a lasting legacy. But so often, the legacies we leave behind...are not the ones we intended.", "...", "If our lives are already written, it would take a courageous man to change the script.", "It's easy to forget what a sin is in the middle of a battlefield.", "The courage to walk into the Darkness, but strength to return to the Light."];  
 var author = ["-Bioshock","-Mortal Kombat", "-Skyrim", "-Half-Life 2", "-Mass Effect 3", "-Borderlands 2", "-Assassin’s Creed 2", "-Metro 2033", "-Call of Duty: Modern Warfare 2", "-Dishonored", "-Halo", "-Bioshock", "-Red Dead Redemption", "-Far Cry 2", "-Duke Nukem 3D", "-Gears of War 2", "-The Legend of Zelda", "-Alan Wake", "-Metal Gear Solid", "-Destiny"];
 
 randomNum = Math.floor(Math.random()*quotes.length);
 randomQuote = quotes[randomNum];
  author = author[randomNum];*/
  var url= "https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?";
$.getJSON(url, function(data){
  randomQuote = data.quoteText;
 $(".quote").html('"'+data.quoteText+'"');
  $(".author").html("-"+data.quoteAuthor);
  randomQuote = data.quoteText;  
});
    
  
};
  $("#tweet").on("click", function(){
 window.open("https://twitter.com/intent/tweet?text=" + randomQuote);   
  });
  
    $("#newQuote").on("click", function(){
    getQuote();
    });  
});

            
          
!
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.
Loading ..................

Console