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

              
                <div class="container-fluid">
  <div>
    <div class="text-center">
      <h1> Shane's Quote Machine</h1>
      <br/>
      <p> Some of the best tech quotes from influential people!</p>
      <img src="http://quotes.lifehack.org/media/quotes/quote-Tim-OReilly-what-new-technology-does-is-create-new-27910.png" id="image"/>
      <br/>
      <!--Add ID now that more than one btn -->
      <button class="btn btn-default" type="submit" id='new'>Get Quote</button>
      <a href ="#" id="tweet" class="btn btn-default" >Tweet Quote</a>
      <!--Changes Start-->
      

          <!--Changes End-->
    </div>
    <div class="quotes text-center">

      <span class = "quote">"Got to catch them all!"</span>
      <br/>
      <span class = "author">-Ash Kethchum</span>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body{
  background-color:black;
}
h1{
color: white;
  font-family: Sans-serif;
  font-size: 60px;
}
#tweet {
  background-color: navy;
 color: white;
}
#tweet:hover {
  background-color: blue;
}
#new {
  background-color: blue;
  color: white;
}
#new:hover {
  background-color: navy;
}
p {
  font-size: 25px;
}


.quote{
  font-size:30px;
}

p{
  color:white;
  font-size:20px;
  font-style: italic;
}
.author{
  font-style:italic;
  font-size: 20px;
  
}
#image {
  height: 250px;
  cursor: pointer;
  padding: 20px;
}
.quotes{
  background-color:black;
  width:33%;
  margin-right:auto;
  margin-left:auto;
  border:5px solid lightblue;
  border-radius: 10px;
  margin-top: 20px;
  padding: 20px;
  height:auto;
  color:white;
  margin-bottom: 10px;
}

              
            
!

JS

              
                //Beginning jQuery
$(document).ready(function(){
  findQuote();
  //Declaring  variables
var randomNum;
  var randomQuote;
  var author;
  //Starting the function
function findQuote(){
  //Creating the array
  var quotes = ["Success is a lousy teacher", "Sometimes when you innovate, you make mistakes", "By giving people the power to share, we're making the world more transparent.", "Wherever smart people work, doors are unlocked.", "I think Twitter is the future of communications and Square will be the payment network.", "Our industry does not respect tradition - it only respects innovation."];
  var author = ["-Bill Gates", "-Steve Jobs", "-Mark Zuckerberg", "-Steve Wozniak", 
              "-Jack Dorsey", "-Satya Nadella"];
   randomNum = Math.floor(Math.random()*quotes.length);
  randomQuote = quotes[randomNum];
   author = author[randomNum];
  $(".quote").text(randomQuote);
    $(".author").text(author);

  
  //Tweeting a new quote and opening twitter
   $("#tweet").on("click", function(){
window.open("https://twitter.com/intent/tweet?text=" + randomQuote);
  });
}
  //Calling the function to find a new quote
  $("#new").on("click", function(){
    findQuote();
  });
    
});


              
            
!
999px

Console