css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

            
              <link href="https://fonts.googleapis.com/css?family=Courgette" rel="stylesheet"> 

  <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=Courgette" rel="stylesheet"> 

<h2>Quotenator</h2>

<h1>Quote Machine</h1>

<div id = "Quotes" class = "background"><p>Click "Next!" button for a quote :).</p></div>

<button id ="button" onclick="newQuote()" class = "buttons">Next!</button>

<button id = "tweet" class="TwittButton"><i class="fa fa-twitter"></i></button>

<h3 class ="p-sign">Written and code by Verónica Almeneiro</h3>
            
          
!
            
              body {background-color: #c2e1ff}

h1  {text-align: center; font-family: 'Courgette', cursive; font-size: 45px; margin-top: 10px;}

h2 {text-align: center; font-family: 'Courgette', cursive; font-size: 55px; margin-top: 30px; margin-bottom: 10px;}

.background{
  color: black;
  font-family: 'Oswald', sans-serif;
  background-color: white;
  width: 50vw;
  margin: auto;
  padding: 20px;
  border-radius: 50px;
  font-size: 25px;
}
.buttons{background-color:#3678b8;
	-moz-border-radius:28px;
	-webkit-border-radius:28px;
	border-radius:28px;
	border:1px solid #3678b8;
	display:block;
	cursor:pointer;
	color: white;
	font-family:Arial;
	font-size:25px;
	padding:16px 31px;
	text-decoration:none;
	text-shadow:0px 1px 0px #2f6627;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10px;}
  
.TwittButton {background-color:#3678b8;
	-moz-border-radius:28px;
	-webkit-border-radius:28px;
	border-radius:28px;
	border:1px solid #3678b8;
	display:block;
	cursor:pointer;
	color: white;
	font-family:Arial;
	font-size:25px;
	padding:16px 45px;
	text-decoration:none;
	text-shadow:0px 1px 0px #2f6627;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10px;}

.p-sign {font-family: Arial; font-size: 15px; margin: 150px 10px 20px 10px; color: grey; align: center}
            
          
!
            
                 
//Here the random button text code
var randomText = [];
randomText[0] = 'More!';
randomText[1] = 'One more';
randomText[2] = 'More please';
randomText[3] = 'Other';
var shuffleTitle = function() {
  var id = Math.round(Math.random() * (randomText.length - 1));
  document.getElementById('randTitle').innerHTML = randomText[id];
}


//Here the random quotes code
    var quotesArr = ["Life is 10% what happens to you and 90% how you react to it.    -Charles R. Swindoll",
	"Always do your best. What you plant now, you will harvest later.    -Og Mandino",
	"The past cannot be changed. The future is yet in your power.    -Unknown",
	"It does not matter how slowly you go as long as you do not stop.   -Confucius",
	"Keep your eyes on the stars, and your feet on the ground.    -Theodore Roosevelt",
	"When something is important enough, you do it even if the odds are not in your favor.  -Elon Musk",
	"He who sows the wind shall reap the whirlwind     -Arthur Bomber Harris",
	"It's OK to have your eggs in one basket as long as you control what happens to that basket.    -H. G. Wells",
	"Knowing is not enough; we must apply. Willing is not enough; we must do.   -Johann Wolfgang von Goethe",
	"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.    -Terry Pratchett",
	"Real stupidity beats artificial intelligence every time.    -Terry Pratchett",
	"Sometimes it is better to light a flamethrower than curse the darkness    -Terry Pratchett",
	"The pen is mightier than the sword if the sword is very short, and the pen is very sharp.    -Terry Pratchett",
	"Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH', the paint wouldn't even have time to dry.    -Terry Pratchett",
	"The entire universe has been neatly divided into things to a mate with, b eat, c run away from, and d rocks.  -Terry Pratchett",
	"Evil begins when you begin to treat people as things.    -Terry Pratchett",
	"It is well known that a vital ingredient of success is not knowing that what you're attempting can't be done.    -Terry Pratchett",
	"Taxation is just a sophisticated way of demanding money with menaces.    -Terry Pratchett",
	"Most of the great triumphs and tragedies of history are caused not by people being fundamentally good or fundamentally evil, but by people being fundamentally people    -Terry Pratchett."];

var randomQuote;
var currentQuote;

function newQuote() {
  randomQuote = Math.floor(Math.random() * (quotesArr.length));
  currentQuote = quotesArr[randomQuote];
  document.getElementById("Quotes").innerHTML = quotesArr[randomQuote];
  
  $("#tweet").click(function() {
     window.open('https://twitter.com/intent/tweet?&text=' + currentQuote);
   });   
};
            
          
!
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.
Loading ..................

Console