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=Poiret+One' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Arima+Madurai:700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Dancing+Script' rel='stylesheet' type='text/css'>

<!--Quote container-->
<div>
  <div class="col-xs-3 "id="info">
  </div>
  <!--Quote container-->
  <div class="col-xs-6">
    <div class="well col-xs-12 quotecontainer text-center">
      <!--Quote-->
      <h2 id="quote1"></h2>
      <!--Author-->
      <h4 id="saidBy" align="right"></h4>
      <div class="col-xs-4 share">
        <!--Tweet button-->
        <a href = "#"><i id = "tweet-quote" class = "fa fa-twitter button ls" title = "tweet this!"></i></a>
        <!--Facebook button-->
        <a href = "#"><i id = "share-quote" class = "fa fa-facebook button ls" title = "Share on facebook!"></i></a>
      </div>
      <div class="col-xs-5">
      </div>
      <div class="col-xs-3">
        <!--Random quote button-->
      <button class="button btn btn-danger" id="getQuote" title="Get a new quote!">Get quote</buttom>
      </div>
    </div>
    
    
    <!--contact info-->
    <div class="col-xs-9">
       <h4 class="owners_page text-center foteer"  >Random quote machine project,<strong style="font-family: 'Dancing Script', cursive;"> Designed by </strong><strong ><a href="https://codepen.io/Danielcv_93/" class="foteer" title="Daniel's codepen page">Daniel Cartín</a></strong></h4> 
    </div>
    <dilv class="col-xs-3">
    <a href="https://twitter.com/danielcv_93"><!--Twitter-->
        <img title="Twitter" alt="Twitter" src="https://socialmediawidgets.files.wordpress.com/2014/03/01_twitter1.png" width="35" height="35" />
      </a>
      <a href="https://cr.linkedin.com/in/daniel-cartin-a53aa1121"><!--Linked in-->
        <img title="LinkedIn" alt="LinkedIn" src="https://socialmediawidgets.files.wordpress.com/2014/03/07_linkedin1.png" width="35" height="35" />
      </a>
      <a href="https://www.facebook.com/daniel.cartin93"><!--Facebook-->
        <img title="Facebook" alt="Facebook" src="https://socialmediawidgets.files.wordpress.com/2014/03/02_facebook1.png" width="35" height="35" />
      </a>
      <a href="https://www.pinterest.com/danielcv93/"><!--Pinterest-->
        <img title="Pinterest" alt="Pinterest" src="https://socialmediawidgets.files.wordpress.com/2014/03/13_pinterest1.png" width="35" height="35" />
      </a> 
      </div>
 </div>
 
            
          
!
            
              body {
  background-color: #2d2d2d;
}

.quotecontainer {
  background: #fff;
  margin-top: 25%;

}

#quote1{
  font-family: 'Arima Madurai', cursive;
  font-size: 250%;
}

#saidBy{
  font-family: 'Poiret One', cursive;
  font-size: 200%;
}

.ls{
  font-size: 30px;
  color: white;
  width: 40px;
  height: 40px;
  padding: 5px;
  margin-left: 10px;
  margin-right: 0px;
  border-radius: 50%;
}

.share{
  float:left;
}
/*FOOTER*/

.bottom-bar {
  float: right;
  padding: 10px;
}
.foteer{
  color:white;
}

            
          
!
            
              $(document).ready(function() {
  var quotes = [],
      speaker = [],
      colors = [],
      quotes1 = [],
      bckgrnd=[],
    x, lrg,lrgc,i;
  
  colors = ["#2d2d2d","#800000","#990070","#A8A8A8","#009900","#4d79ff","#000","#f44","#ff5c33","#cc6600","#99003d","#00004d","#3973ac"];
  bckgrnd=
  
  quotes = [{"quote":"You only live once, but if you do it right, once is enough.","author":"Mae West"},
            {"quote":"Whitouth a goal, you can't score.","author":"Casey Neistat"},
            {"quote":"If you're doing what everyone else is doing, you're doing it wrong.","author":"Casey Neistat"},
            {"quote":"Unless you stop trying, how can you not fail any more?","author":"Pew Die Pie"},
            {"quote":"It always seems impossible until it's done.","author":"Nelson Mandela"},
            {"quote":"In order to succeed, we must first believe that we can.","author":"Nikos Kazantzakis"},
            {"quote":"What you do today can improve all your tomorrows.","author":"Ralph Marston"},
            {"quote":"Life is 10% what happens to you and 90% how you react to it.","author":"Charles R. Swindoll"},
            {"quote":"Always do your best. What you plant now, you will harvest later.","author":"Og Mandino"},
            {"quote":"Don't count the days, make the days count.","author":"Muhammad Ali"},
            {"quote":"At the end, it's not the years in your life that count. It's the life in your years.","author":"Abraham Lincoln"},
            {"quote":"Action expresses priorities.","author":"Mahatma Gandhi"},
            {"quote":"You are never too old to set another goal or to dream a new dream.","author":"C. S. Lewis"},
            {"quote":"If you tell the truth, you don't have to remember anything.","author":"Mark Twain"},
            {"quote":"4 Love is patient, love is kind. It does not envy, it does not boast, it is not proud. 5 It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. 6 Love does not delight in evil but rejoices with the truth. 7 It always protects, always trusts, always hopes, always perseveres.","author":"1 Corinthians 13:4-7"},
            {"quote":"13 And now these three remain: faith, hope and love. But the greatest of these is love.","author":"1 Corinthians 13:13"},
            {"quote":"The people who are crazy enough to think they can change the world are the ones who do it.","author":"Steve Jobs"},
            {"quote":"A man must be big enough to admit his mistakes, smart enough to profit from them, and strong enough to correct them.","author":"John C. Maxwell"},
            {"quote":"It's better to be a lion for a day than a sheep all your life.","author":"Elizabeth Kenny"},
            {"quote":"I can do all this through him who gives me strength.","author":"Philippians 4:13"}
           ];

  function getQuote() {
    lrg = quotes.length;
    x = Math.floor(Math.random() * lrg);
    return x;
  }
  
  function getColor(){
    lrgc = colors.length;
    i = Math.floor(Math.random() * lrgc);
    return i;
  }

  function runRandom() {    
      $('#quote1').text("\""+quotes[getQuote()].quote+"\"");
      $('#saidBy').text("-"+quotes[x].author);
      $('.button').css("background-color", colors[getColor()]);
      $('.button').css("border-color", colors[i]);
      $('#quote1').css("color", colors[i]);
      $('#saidBy').css("color", colors[i]);
      $('body').css("background-color", colors[i]);    
           }
  
  function tweetQuote(){
  window.open('https://twitter.com/intent/tweet?text=' + "\""+quotes[x].quote+"\""+"-"+quotes[x].author + "..." + "https://s.codepen.io/Danielcv_93/debug/jrMJKO" ,'ventanacompartir', 'toolbar=0, status=0, width=650, height=450',"_blank"); 
  };
  
  function shareFace(){
  window.open('https://www.facebook.com/sharer.php?u=' +  encodeURIComponent('https://s.codepen.io/Danielcv_93/debug/jrMJKO'),'ventanacompartir', 'toolbar=0, status=0, width=650, height=450'); 
 // window.open("https://www.facebook.com/sharer.php?u="+"\""+quotes[x].quote+"\""+"-"+quotes[x].author + "..." + "https://s.codepen.io/Danielcv_93/debug/jrMJKO",'ventanacompartir', 'toolbar=0, status=0, width=650, height=450');
  };
  
  
  $('#share-quote').click(shareFace);
  $('#tweet-quote').click(tweetQuote);
  $('#getQuote').click(runRandom);
  window.onload = runRandom();
  
// https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&
//http://labs.bible.org/api/?passage=random&type=json
});


            
          
!
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