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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                  <title>Quotesy</title>
</header>

<body class="main">
     
  <a class="myTwitterButton" href="http://twitter.com/share?text=test" target="_blank">
      <img class='myTwitterButton' src="https://www.freeiconspng.com/uploads/-van-nederland-elgie-gaat-haar-ontwikkeling-posten-op-twitter-24.png"</img>
    </a>

  
  <h1 class="center" style="margin-bottom: 0px"><strong>Quotesy</strong></h1>
  
  <p class="center" style="margin-top: 0px"><em>A quote generator</em></p>
  
  <p class="center" style="font-family: 'Gill sans'">Welcome to Quotesy! Whether you're looking for inspiration, are feeling down, or are literally just bored out of your mind, click that GENREATE button and have yourself a good ol' time!
  </p>  

  <button id="generate" class = "center btn btn-primary">GENERATE</button>

  </br>

  <div class="quoteBox center container-fluid">
    <p>A quote will appear here.</p>
  </div>
</body>
  
              
            
!

CSS

              
                

p{
  font-size: 18px;
  font-family: 'Gill Sans';
}

h1 {
  font-family: "Gill sans";
  font-size: 100px;
  color: rgb(0,0,0)
}

.center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  display: block
}

.myTwitterButton{
  height: auto;
  width: 5%
}

.quoteBox {
  margin-left: auto;
  margin-right: auto;
  display: block;
  width: 60%;
  background-color: rgba(0,0,0,.6);
  color: white;
  font-family: "Gill sans"
}

.main {
  background-size: cover;
  background-image: url('http://res.cloudinary.com/daxueqsh4/image/upload/v1526881194/untitled_1_of_1_-2.jpg');
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    background-width: 100% auto
}
              
            
!

JS

              
                var quote = [
  {text: '“It is not the mountain we conquer but ourselves.”', author: "-Sir Edmund Hillary"}, 
  {text: '"Go to heaven for the climate, hell for the company."', author: "-Mark Twain"},
  {text: '“Life begins at the end of your comfort zone”', author: "-Neal Donald Walsch"},
  {text: '“The ultimate measure of a man is not where he stands in moments of comfort, but where he stands at times of challenge and controversy.”', author:"-Martin Luther King"},
  {text:'"Manners maketh man"', author: "-Kingsman"},
  {text: '"Move and the way will open"', author: "-Zen Proverb"},
  {text: '"Always choose both"', author: "-Steven Jacobs"},
  {text: '"Get action!"', author: "-Theodore Roosevelt Sr."},
  {text: '"Love never dies"', author: "-unknown"},
  {text: '"I remember the first time I had sex - I kept the receipt."', author: "-Groucho Marx"},
  {text: '"It is ok to look out for number 1 so long as you don\'t step in number 2!"', author: "-unknown"},
  {text: '"What doesn\'t kill you makes you stronger"', author: "-Friedrich Nietzsche"},
  {text: '"I am Groot"', author: "-Groot, Guardians of the Galaxy"},
  {text: '"Kicking names and taking ass"', author: "-The Waterboy"},
  {text: '"You\'re good enough right now. Don\'t wait until tomorrow or three weeks or three years god forbid to put your work out there. Do not compare the place you are at right now to someone else who has been at this game for a long time or to someone else\'s highlight reel. You need to know, the world needs to see and get your work right now."', author: "-Chase Jarvis"},
  {text: '"Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering."', author: "-Yoda, Star Wars"},
  {text: '"Most people are other people. Their thoughts are someone else\'s opinions, their lives a mimicry, their passions a quotation."', author: '-Oscar Wilde'},
  {text: '"Wonders never cease if you never cease to wonder."', author: '-Ziggy'},
  {text: '"Get busy livin\' or get busy dying."', author: "-Andy, The Shawshank Redemption"},
  {text: '"When you change the way you look at things, the things you look at change."', author: '-Wayne Dyer'},
  {text: '"Always remember that you are absolutely unique. Just like everyone else."', author: '-Margaret Mead'},
  {text: '“The world is like a ride in an amusement park, and when you choose to go on it you think it\'s real because that\'s how powerful our minds are. The ride goes up and down, around and around, it has thrills and chills, and it\'s very brightly colored, and it\'s very loud, and it\'s fun for a while. Many people have been on the ride a long time, and they begin to wonder, "Hey, is this real, or is this just a ride?" And other people have remembered, and they come back to us and say, "Hey, don\'t worry; don\'t be afraid, ever, because this is just a ride." And we … kill those people.”', author: '-Bill Hicks'},
  {text: '"Challenges are what make life interesting; overcoming them is what makes life meaningful"', author: "-Joshua J Marine"}
];

function generate(){
  var x = Math.floor(Math.random()*quote.length);
  return quote[x];
}

function updateTweet(quote,author){
	$('.myTwitterButton').attr("href", "http://twitter.com/share?text=" + quote + " " + author);
}

$(document).ready(function(){

  $('#generate').on("click", function(){
    var quote = generate();
    $('.quoteBox').html('<strong>' + quote.text  + '<br/><br/>'+ quote.author + '</strong>');
    updateTweet(quote.text, quote.author);
  });
});
              
            
!
999px

Console