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 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

              
                <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Aduma+Madurai" rel="stylesheet" type="text/css">

<body>
  
  <!-- header -->
   <div class = "header col-xs-12">
     <h1 id = "heading"> <i class = "fa fa-quote-left"></i> Quotes <small class="heading">  -   Gain a new perspective on life. <small> <h1>
      <hr id="line-break">
  </div>
       <div id="clear"></div>    
       <!-- Quote Display Area -->
       <div id = "quote-area" >
         <p id = "quote-text">Gain a new perspective on life by pressing space.</p>
       </div> <!-- End of Quote Display Area -->
       
   <!-- Random Button -->
       <div>
         <input id="random-quote" type = "button" value = "Random Quotes - Press Space for Random Quote" onClick="rQFunction()" class = "col-md-4 ."  />
       </div> <!-- End of Random Button -->
       
<!-- Twitter Button -->
       <div>
        <input id="twitter-button"  type = "button" value = "Tweet!" onClick="tweet()"/>
       </div>
     
       
</body>
              
            
!

CSS

              
                @keyframes fadeIn {
    from {
        opacity: 0;
           }
    to {
        opacity: 1;
            }
}
.header{
 position: relative;
 margin: -100px 0px 0px 30px;
 font-family: Georgia;
 }
#line-break{
 width: 450px;
 float: left;
 border-color: grey;
 margin: -12px 10px 0px 0px;
}
#clear{
  clear:all;
}
#random-quote {
  font-family: Georgia;
  color: #000000;
  font-size: 15px;
  background-color: #ffffff;
  padding: 10px 20px 10px 25px;
  border: solid #000000 1px;
  text-decoration: none;
  margin: 20px 250px 0px 200px; 
  width: 400px;  
}

#random-quote:hover {
  background-color: #e8eaeb;
  text-decoration: none;
}
#quote-area{
  margin: 100px 300px 0px 200px;
  border: solid grey 1px;
  height: 17 0px;
  width: 600px;

 }
#twitter-button{
  font-family: Georgia;
  color: #000000;
  font-size: 15px;
  background: #ffffff;
  padding: 10px 20px 10px 25px;
  border: solid #000000 1px;
  text-decoration: none;
  width: 100px;
  margin-left: -220px;
  margin-top: 21px;
}
#twitter-button:hover {
  background-color: #e8eaeb;
  text-decoration: none;
}
#quote-text{
  animation: fadeIn 1s;
  font-size: 22px;
  font-family: Arima Mardurai, Georgia;
  padding:  25px;
}
              
            
!

JS

              
                
// Declare Global Variables
var quotes;
// Quotes Container
quotes =[
    {
     quote: "Don't call it a dream. Call it a plan",
     author: "unknown",
      id: "1"
  },
  {
    quote: "How beautiful is it to find someone who asks for nothing but your company.",
    author: "Brigitte Nicole",
    id: "2"
     },
  {
    quote: "Be Yourself. Everybody else is already taken.",
    author: "Oscar Wilde",
    id: "3"
  },
  {
    quote: "In 20 years you will regret the chances you didn't take, the things you didn't try out when you had the time.",
    author: "unknown",
    id: "4"
  },
  {
    quote: "Focus on being productive instead of busy.",
    author: "Tim Ferris",
    id: "5"
  },
  {
    quote: "A river cuts through rock not because of its power but its persistence.",
    author: "unknown",
    id: "6"
  },
  {
    quote: "Look in the mirror. That's your competition.",
    author: "unknown",
    id: "7"
  },
  {
    quote: "Success isn't about how much money your make. It's about the difference you make in peoples lives.",
    author: "Michelle Obama",
    id: "8"
  },
  {
    quote: "We are what we repeatedly do. Excellence, then is not an act, but a habit ",
    author: "Aristotle",
    id:"9"
  },
  {
    quote: "If you are on the right path it will always be uphill.",
    author: "Henry B. Eyring",
    id: "10"
  },
  {
    quote: "You can easily judge the character of a man by how he treats those who can do nothing for him.",
    author: "James D. Miles",
    id: "11"
  },
  {
    quote: "Care about what other people think and you will always be their prisoner.",
    author: "Lao Tzu",
    id:"12"
  },
  {
    quote: "Everything in your life is a reflection of a choice you have made. If you want a different result, make a different choice.",
    author: "unknown",
    id: "13"
  },
  {
    quote: "Talk more about your blessings than your problems.",
    author: "unknown",
    id: "14"
  },
  {
    quote: "Confidence is silent. Insecurities are loud.",
    author: "Don Corleone",
    id: "15"
  },
  {
    quote: "The best investment you will ever make is in yourself.",
    author: "unknown",
    id: "16"
  },
  {
    quote: "Beauty attracts the eye but personality captures the heart.",
    author: "unknown",
    id: "17"
  },
  {
    quote: "Your attitude not your aptitude determines your altitude.", 
    author: "Zig Ziglar",
    id: "18"
  },
  {
    quote: "Success occurs when opportunity meets preparation.",
    author: "Zig Ziglar",
    id: "19"
  },
  {
    quote: "You never know when a moment of silence and a few sincere words can have an impact on a life.",
    author: "Zig Ziglar",
    id: "20"
  },
  {
    quote: "Abilty can take you to the top, but your character keeps you there.",
    author: "Zig Ziglar",
    id: "21"
  },
  {
    quote:"The greatest glory in living lies not in never falling, but rising every time we fall.",
    author: "Nelson Mandela",
    id: "22"
  },
  {
    quote: "Success is the ability to go from failure to failure without losing enthusiasm.",
    author: "Winston Churchill",
    id: "23"
  },
  {
    quote: "You will never reach your destination and throw a stone at every dog that barks.",
    author: "Winston Churchill",
    id: "24"
  },
  {
    quote: "The best things in life are for free. The second best are expensive.",
    author: "Coco Chanel",
    id: "25"
  },
  {
    quote: "When you look back you will realize that the small moments were those which truly mattered.",
    author: "unknown",
    id: "26"
  }
   ];

$(window).keydown(function (e) {
      if (e.keyCode === 0 || e.keyCode === 32) {
        e.preventDefault(); // don't scroll down
        rQFunction(quotes);
      }
    });    
//creating a random number
// generate a random quote and display it
var output = document.getElementById('quote-text');
function rQFunction(){  
  window.x = Math.floor(Math.random()*26)+1;
  output.innerHTML = quotes[x].quote + " ~ " + quotes[x].author;
  $("#quote-text").fadeOut(1);
  $( "#quote-text" ).fadeIn( 300 , function() {
    // Animation complete
  });
}
// Twitter Button
function tweet(){
 
  $.getScript('https://platform.twitter.com/widgets.js');
  window.open("https://twitter.com/home/?status=" + "\"" + quotes[x].quote + "\"" + " - " + quotes[x].author, '_blank');
};
      


              
            
!
999px

Console