123

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>
  <title>Best Random Quotes </title>
  <head></head>
  <div class="container-fluid">
    <body>
  <div class="full text-center">
<p id="demo">Don't cry because it's over, smile because it happened. By Dr. Seuss</p>
<div class="btnList">
  <a class="btn btn-default" id="quote">new Quote</a>

  <a class="twitter-share-button">
Tweet</button>
    </div>
    </div>
  
    </body>
      </div>
  </html>
            
          
!
            
              body{
background-color:tomato;
height:800px;
}
.full{
  
  border-shadow:30%;
  height:800px;
  padding:20%;
 }
a{
  font-size:2.0em;
}


            
          
!
            
              $(document).ready(function(){
var randomQuote;
var randomNum;
function getQuote(){
  var quotes=[
    "When she stopped conforming to the conventional picture of femininity she finally began to enjoy being a woman.",
    "I do not confer praise or blame: I accept. I am the measure of all things. I am the centre of the world.",
    "Nature has been for me, for as long as I remember, a source of solace, inspiration, adventure, and delight; a home, a teacher, a companion. By Lorraine Anderson",
    "Only passions, great passions, can elevate the soul to great things.By Denis Diderot ",
    "It is a good morning exercise for a research scientist to discard a pet hypothesis every day before breakfast. It keeps him young. By Konrad Lorenz ",
    "I was brought up to believe that how I saw myself was more important than how others saw me. By Anwar el-Sadat ",
    "When someone wants to lose weight, they will do whatever it takes. They can’t do it for anyone else but themselves. It has to be for them alone. Without that understanding, they will fail. By Jennifer Hudson",
    "Those who agree with us may not be right, but we admire their astuteness. By Cullen Hightower",
    "Accomplishing the impossible means only that the boss will add it to your regular duties.",
  ];
  randomNum=Math.floor(Math.random()*quotes.length);
  randomQuote=quotes[randomNum];
  $("#demo").text(randomQuote);
  console.log(randomQuote);
}
 $("#quote").on("click",function(){
   getQuote();
   
 });
$(".twitter-share-button").on("click",function(){
  window.open("https://twitter.com/intent/tweet?text="+ randomQuote);
});

});
                                                


            
          
!
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