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.

            
              <div class="jumbotron" id="banner">
  <h1 class="text-center">Random Quote Machine</h1>
</div>

<div class="container">
  <div class="row">
    <div class="col-md-8 col-md-offset-2">
      <div class="jumbotron" id="main_block">
        <p class="panel panel-body" id="mblock"></p>
      </div>
      <div class="row">
        <div class="col-md-12 col-md-offset-4">
          <button id="get_quote" class="btn btn-warning">Get New Quote</button>
        <i id="tweet" class="btn btn-primary fa fa-twitter" aria-hidden="true"></i>

        </div>
      </div>
    </div>
  </div>
</div>
            
          
!
            
              body{
  background-color:#d4d5d6 ;}
#banner{
  background-color:#d4d5d6;
  color:;
}
#main_block{
  background-color:;
}

            
          
!
            
              var x = [
 { "title" : "Milton Glaser",
  
  "quote" : `I go to work every morning with the possibility that I might learn something I don\u2019t already know&#8230; You should look at every problem and think, \u2018what can I learn by doing this?\u2019 And if you think you can learn nothing, forget about doing it.`},
  
 { "title" : "Ernest Hemingway",
  "quote" : `Write drunk; edit sober.`},
  
 { "title" : "Joshua Blankenship",
  
  "quote" : `But the web will still be full of arrogant, uninformed, polarizing, self-promoting, controversy-creating content that has ramifications no one wants to own up to. And consequently, the web will still be lacking in common courtesy, humility, and the admittance that most of us don&#8217;t know best. Which is sad, mostly because it&#8217;s true.`},
  
  {"title" : "Jonathan Ive",
   "quote" : `The word design is everything and nothing. The design and the product itself are inseparable.`
  },
  
  {"title" : "Ed Frank",
  "quote" : `I think there are two types of people in this world &#8211; people who can start things and people who can finish things. And while I place great value on the finishers, it&#8217;s the starters who are rare because they can envision what isn&#8217;t there.`},
  
  {
  "title" : "Matthew Haeck",
  "quote" : `Sometimes the best way to prove your own value is to let a client play the field.` 
  },
  
  {
  "title" : "Thomas Edison" ,
  "quote" : `Opportunity is missed by people because it is dressed in overalls and looks like work.`
  },
  
  {
  "title" : "Paul Rand" ,
  "quote" : `Art is an idea that has found its perfect visual expression. And design is the vehicle by which this expression is made possible. Art is a noun, and design is a noun and also a verb. Art is a product and design is a process. Design is the foundation of all the arts.`  
  },
 
  {
  "title" : "Henry Dreyfuss" ,
  "quote" : `[If] people are made safer, more comfortable, more eager to purchase, more efficient, or just happier, the designer has succeeded.`  
  },
  
  {
  "title" : "Jay Bradner" ,
  "quote" : `Stop downloading. Start uploading.`  
  }
];

$("#get_quote").on("click",function(){
    var y = Math.floor(Math.random()*10);
    $("#mblock").html(x[y].quote+"<h4>-"+x[y].title+"</h4>");
    $("#tweet").html(`<a href="https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=`+x[y].quote+x[y].title+`" ></a>`);

    
    /*updateDiv();
    $.getJSON("https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(a) {
    $("#mblock").html(a[0].content + "<p>— " + a[0].title + "</p>"*/
      
   });


//<a href="" ><i class="btn btn-primary fa fa-twitter" aria-hidden="true"></i></a>
            
          
!
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