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

              
                DOCT<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Random qoute engine</title>
  
  <!--agile user story, 
  User Story: I can click a button to show me a new random quote.
  User Story: I can press a button to tweet out a quote.-->
  
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
  <link href="css/style.css" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Kaushan+Script" rel="stylesheet">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>

<body>

  <div class="container-fluid full">
    <div class="row">
      <div class="row" id="heading">
        <div class="col-xs-12">
          <h1>Random Quote Generator</h1></div>
      </div>
      <div class="row" id="text">
        <textarea disabled class="col-xs-8 col-xs-offset-2" id="display" rows="2" cols="80"></textarea>
      </div>
      <div class="row">
        <div class="col-xs-12 buttons">
          <button type="button" class="btn btn-primary randomed">Generate quote</button>
          <button type="button" class="btn btn-info twitter-share-button"><i class="fa fa-twitter" aria-hidden="true"></i>Tweet quote</button>
        </div>
      </div>
      <div class="row">
        <div class="col-xs-12 sig">
          <h3>Aldon Delport</h3>
          <h4>Pen By</h4>
        </div>
      </div>
    </div>
  </div>
  <script src="quote.js"></script>
</body>
</html>

              
            
!

CSS

              
                .full{
  padding: 10px;
  text-align: center;
  font-family: 'Kaushan Script', cursive;
  height: 100%;
  color: white;
}

.sig {
  padding-bottom: 100px;
}

body {
  background: url("http://niami.co/wp-content/uploads/2016/08/modern-dark-hardwood-floor-background-hd-dark-wood-floor-wallpaper.jpg") no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

.buttons {
  padding:30px
}

#display {
color: black;
text-align: center;
padding-top: 20px;
padding-bottom: 20px;
opacity: .50;
font-size: 20px;
}

#text {
  padding-left: 50px;
  padding-right: 50px;
}

#heading {
  padding-top: 50px;
  padding-bottom: 50px;
}

              
            
!

JS

              
                $(document).ready(function() {
  //array containing quotes
  var quotes = [
    "Life is about making an impact, not making an income. –Kevin Kruse",
    "Whatever the mind of man can conceive and believe, it can achieve. –Napoleon Hill",
    "Strive not to be a success, but rather to be of value. –Albert Einstein",
    "Two roads diverged in a wood, and I—I took the one less traveled by, And that has made all the difference.  –Robert Frost",
    "I attribute my success to this: I never gave or took any excuse. –Florence Nightingale",
    "You miss 100% of the shots you don’t take. –Wayne Gretzky",
    "The most difficult thing is the decision to act, the rest is merely tenacity. –Amelia Earhart",
    "Every strike brings me closer to the next home run. –Babe Ruth",
    "Definiteness of purpose is the starting point of all achievement. –W. Clement Stone",
    "Life isn’t about getting and having, it’s about giving and being. –Kevin Kruse",
    "Life is what happens to you while you’re busy making other plans. –John Lennon",
    "We become what we think about. –Earl Nightingale",
    "Life is 10% what happens to me and 90% of how I react to it. –Charles Swindoll",
    "The most common way people give up their power is by thinking they don’t have any. –Alice Walker",
    "The mind is everything. What you think you become.  –Buddha",
    "The best time to plant a tree was 20 years ago. The second best time is now. –Chinese Proverb",
    "An unexamined life is not worth living. –Socrates",
    "Eighty percent of success is showing up. –Woody Allen",
    "Your time is limited, so don’t waste it living someone else’s life. –Steve Jobs",
    "Winning isn’t everything, but wanting to win is. –Vince Lombardi",
    "I am not a product of my circumstances. I am a product of my decisions. –Stephen Covey",
    "Every child is an artist.  The problem is how to remain an artist once he grows up. –Pablo Picasso",
    "You can never cross the ocean until you have the courage to lose sight of the shore. –Christopher Columbus",
    "I’ve learned that people will forget what you said, people will forget what you did, but people will never forget how you made them feel. –Maya Angelou",
    "Either you run the day, or the day runs you. –Jim Rohn",
    "Whether you think you can or you think you can’t, you’re right. –Henry Ford",
    "The two most important days in your life are the day you are born and the day you find out why. –Mark Twain",
    "Whatever you can do, or dream you can, begin it.  Boldness has genius, power and magic in it. –Johann Wolfgang von Goethe",
    "The best revenge is massive success. –Frank Sinatra",
    "People often say that motivation doesn’t last. Well, neither does bathing.  That’s why we recommend it daily. –Zig Ziglar",
    "Life shrinks or expands in proportion to one’s courage. –Anais Nin"
  ];
  
  //function that generates a whole random number to index quote array 
  function random() {
    var finalNum = Math.floor((Math.random() * (quotes.length)));
    var finalQoute = quotes[finalNum];
    return finalQoute;
  }
  random();
  
  //click returns random quote and displays to appropriate html tag
  $(".randomed").on("click", function() {
    $("#display").html(random());
  })
  
  //on twitter button click shares quote 
  $(".twitter-share-button").click(function() {
    var text = $("#display").text() 
    var tweetLink = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(text);
    window.open(tweetLink, '_blank');
  });
});
              
            
!
999px

Console