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

              
                <link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<div class="jumbotron">
  <h1 class="primary-text text-center">Random Quote Generator </h1>
  <div class="well" id="quote">~click generate for a random quote~</div>
   <input type="button" value="TWEET IT!" class="button-add btn tweet" onclick="tweetIt()"/>
  <p><a class="btn btn-primary btn-lg" href="#" role="button" id="buttonclick">Generate</a></p>
  
</div>
<div footer>
  <p class="text-center">Made by Urketadic</p>
</div>
              
            
!

CSS

              
                .btn,
.btn-lg,
.btn-primary {
  margin: 0 auto;
  margin: -10px -50px;
  position: relative;
  top: 50%;
  left: 50%;
}

.tweet {
  margin-bottom: 20px;
  margin-top: 20px;
}

#quote {
  margin-top: 50px;
  margin-left: 200px;
  margin-right: 200px;
  text-align: center;
  font-family: 'Indie Flower', cursive;
  background-color: darkgray;
  border: 1px solid darkgray;
}
@media screen and (max-width: 700px) {
  #quote {
    margin: 50px 100px 0;
  }
}

@media screen and (max-width: 460px) {
  #quote {
    margin: 50px 20px 0;
  }
}

html,
body {
  height: 100%;
  width: 100%
}

.jumbotron {
  height: 100%;
  width: 100%;
  position:relative;
  background-color: black;
}

.primary-text,
text-center {
  font-family: 'Oswald', sans-serif;
}

.gray {
  background-color: blue;
}

input.button-add {
  background-image: url(https://waqasaday.files.wordpress.com/2012/10/twitter-bird.png);
  /* 16px x 16px */
  background-repeat: no-repeat;
  background-position: 0px 8px;
  /* equivalent to 'top left' */
  border: none;
  padding-left: 20px;
  vertical-align: center;
}
              
            
!

JS

              
                var quotes = {
  1: "Eckhart Tolle: 'Realize deeply that the present moment is all you ever have.  '",
  2: "Eckhart Tolle: 'What a liberation to realize that the “voice in my head” is not who I am. Who am I then? The one who sees that.' ",
  3: "Eckhart Tolle: 'Where there is anger, there is always pain underneath.' ",
  4: "Eckhart Tolle: 'Whatever you think the world is withholding from you, you are withholding from the world.'",
  5: "Eckhart Tolle: 'If you are not living this moment, you are not really living.'",
  6: "Eckhart Tolle: 'You are the universe, you aren't in the universe.'",
  7: "Albert Einstein: 'Look deep into nature, and then you will understand everything better'.",
  8: "Milisav Tadic: 'Ajnstajn lupeta gluposti - 2016'",
  9: "Michio Kaku: 'If a Martian came down to Earth and watched television, he'd come to conclusion that all the world's society is based on Britney Spears and Paris Hilton. He'd be amazed that our society hasn't collapsed.'",
  10:"Albert Einstein: 'Peace cannot be kept by force; it can only be achieved by understanding.'",
  11:"Mahatma Gandhi: 'Be the change that you wish to see in the world.'",
  12:"Robert Frost: 'In three words I can sum up everything I've learned about life: it goes on.'",
  13:"Ralph Waldo Emerson: 'To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.'",
  14:"Ralph Waldo Emerson: 'For every minute you are angry you lose sixty seconds of happiness.'",
  15:"Anaïs Nin: 'We don't see things as they are, we see them as we are.'",
  16:"Theodore Roosevelt: 'Do what you can, with what you have, where you are.'",
  17:"Aristotle: 'Knowing yourself is the beginning of all wisdom.'",
  18:"Mahatma Gandhi: 'An eye for an eye will only make the whole world blind.'",
  19:"Mahatma Gandhi: 'Happiness is when what you think, what you say, and what you do are in harmony.'",
  20:"Terry Pratchett: 'Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life.'",
  21:"Kosta Mitrovic: 'Ziveo Staljin'"
};

function getQuote() {
  return Math.floor(Math.random() * Object.keys(quotes).length + 1);
}

$(document).ready(function() {
  $('#buttonclick').click(function() {
    $('#quote').text(quotes[getQuote()]);
  });
});

function tweetIt () {
  var phrase = document.getElementById('quote').innerText;
  var tweetUrl = 'https://twitter.com/share?text=' +
    encodeURIComponent(phrase) +
    '&url=' +
 'https://codepen.io/urketadic/pen/zBKppa';
    
  window.open(tweetUrl);
}
              
            
!
999px

Console