Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <html>
  <head>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <title>van Gogh Quotes</title>
  </head>
  <body>

  <img id="BG" src="https://upload.wikimedia.org/wikipedia/commons/0/01/Vincent_van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg" >
    
    <h1>Vincent van Gogh Quotes</h1>
  
    <div class="well" id="quoteDisplay">Click the brush for a quote!
</div>
  
    <div class="bwi">
 <button id="randomQuote"onclick="newQuote()" type="button" class="btn" value="Random quote"><i class="fa fa-paint-brush fa-md"></i></button>
  
<button id="tweetThis" type="submit" class="btn"><i class="fa fa-twitter fa-lg"></i>
</button>
   </div> 
    
  </body>
</html>

            
          
!
            
              html{
  position: relative;
  min-height: 100%;
}

.btn{
  margin-left: 4px;
}

.btn{
  background-color: rgb(105,125,88);
  border: 1px solid rgb(68,82,46);  
}

.bwi{
  text-align: center; 
  color: rgb(231,238,227);
}

body {
  background-color: rgb(69,83,89);
}

div#quoteDisplay{
  color: rgb(235,238,226);
  text-align: center;
  font-size: 15px;
  margin-top: 50px;
  margin-left: 30%;
  margin-right: 30%;
  padding: 40px;
  background-color: rgba(23,29,33,.9);
  border-color: black;
}



button {
	display:block;
	text-align: center;
}

#BG {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: -1;
} 



h1 {
  color: rgb(235,238,226);
  text-shadow: 1px 2px 1px black;
  text-align: center;
  font-size: 40px;
  font-family: serif;
  margin: 70px;
  
}
            
          
!
            
              var currentQuote = '';
var randomNum;
var quotes = [
'Great things are done by a series of small things brought together.','Love many things, for therein lies the true strength, and whosoever loves much performs much, and can accomplish much, and what is done in love is done well.','if you hear a voice within you say \'you cannot paint,\' then by all means paint, and that voice will be silenced.','For my part I know nothing with any certainty, but the sight of the stars makes me dream.','I dream of painting and then I paint my dream. ','I feel that there is nothing more truly artistic than to love people.','The best way to know God is to love many things.','I often think that the night is more alive and more richly colored than the day.','What would life be if we had no courage to attempt anything?','If you truly love Nature, you will find beauty everywhere.'
]


function newQuote() {
  var randomNum = Math.floor(Math.random() * (quotes.length));
  document.getElementById('quoteDisplay').innerHTML = quotes[randomNum];
  currentQuote = quotes[randomNum];
 }


$("#tweetThis").click(function() {     window.open('https://twitter.com/intent/tweet?&text=' + currentQuote + " -Vincent van Gogh");
   });
  


            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console