cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="title"><p>Random Quote Machine</p></div>
<div id="quotes-box">
  
  <p  class="txt" id="text" ></p>
  <p class="txt"  id="author"></p>
 
  <a class="btn" id="button" >New Quote</a>
  
  <a class="btn" id="tweet-me" title="Tweet this quote!" target="_blank">
      <i class="fa fa-twitter"></i>
    </a>

</div>

 <div class="footer">
          <div class="row">
            
             <div >
                 
                 <a href="https://twitter.com/adnen_rebai" class="" >
              <i class="fa fa-twitter white tw"></i>
            </a>
            <a href="https://www.facebook.com/adnen.rebai" class="" >
              <i class="fa fa-facebook fb"></i>
            </a>
            <a href="https://codepen.io/adnenrebai/" class="" >
              <i class=" fa fa-codepen cp"></i>
            </a>
            <a href="https://www.freecodecamp.com/arebai" class="">
              <i class="fa fa-free-code-camp white"></i>
            </a>
             <a href="https://github.com/adnenre" class=" ">
              <i class="fa fa-github git"></i>
            </a>
             </div>
          </div>
    </div>
  
            
          
!
            
              


body,.fa{
 
  transition:2s;
}
.title{
  color:white;
  font-family: 'Pacifico', cursive;
  font-size:25px;
  position:absolute;
  left:0;
  right:0;
    margin:0auto;
  text-align:center;
}

#author{
  display:block;
  text-align:right;
 
}
#button{
  float:right;
}
.btn{
 cursor:pointer; 
 color:white;
border-radius:5px;
  transition:2s;
    font-family: 'Architects Daughter',cursive;
}
#tweet-me{
  position:absolute;
  padding:5px 8px;
 
  
}
a{
  text-decoration:none;
}
#button{
  float:right;
   padding:5px 10px;
 
   
}
#text{
  font-size:20px;
}
.txt{
  font-family: 'Architects Daughter',cursive;
}

@media only screen and (max-width: 500px) {
    #quotes-box{
 position:absolute;
  width:80%;
 
  top:18%;
 
  padding:10px 20px 10px 10px;
 animation:wave linear infinite;
  
}

}

@media only screen and(min-width:768px){


}
 #quotes-box{
  
 position:absolute;
  width:60%;
  left:0;
  top:20%;
  transition: height 2s;
  right:0;
  margin:0 auto;
  padding:20px 20px 20px 20px;
  border-radius:10px;
  background:white;
  
  animation:wave 3s linear infinite;
}
@keyframes wave{
    0%{box-shadow:1px 1px 50px 10px #eee;};
   20%{box-shadow:1px 1px 100px 20px #eee;};
   40%{box-shadow:1px 1px 100px 60px #eee;};
   60%{box-shadow:1px 1px 100px 100px #eee;};
   80%{box-shadow:1px 1px 100px 60px #eee;};
   100%{;box-shadow:0px 0px 100px 40px #eee;};
}
@webkit-keyframes wave{
  0%{box-shadow:1px 1px 100px 5px #eee;};
   20%{box-shadow:10px 10px 100px 10px #eee;};
   40%{box-shadow:1px 1px 100px 10px #eee;};
   60%{box-shadow:1px 1px 50px 10px #eee;};
   80%{box-shadow:1px 1px 10px 10px #eee;};
   100%{box-shadow:1px 1px 10px 100px #eee;};
}

.footer{
  position:absolute;
  bottom:10px;
  right:0;
  left:0;
   text-align:center;
 
}
.fb,.tw,.git,.cp{
 color:white;
  transition:1s;
}
.cp:hover{
  color:black;
}
.git:hover{
  color:gray;
}
.fb:hover{
  color:#35359c;
}
.tw:hover{
  color:#03A9F4;
}
            
          
!
            
              /////   
//// random quotes by rebai adnen 
///  flow me on twitter https://twitter.com/adnen_rebai
//



var quotes=[
{"quoteText":"Go put your creed into the deed. Nor speak with double tongue",
"Author":"Ralph Emerson"},

{"quoteText":"Our lives are a sum total of the choices we have made.",
"Author":"Wayne Dyer"}
,
{"quoteText":"Every great mistake has a halfway moment, a split second when it can be recalled and perhaps remedied.",
"Author":"Pearl Buck"}
,
{"quoteText":"We are what we think. All that we are arises with our thoughts. With our thoughts, we make the world.",
"Author":"Buddha"}
,
{"quoteText":"Trusting our intuition often saves us from disaster.",
"Author":"Wilson Schaef"}
,
{"quoteText":"As soon as the fear approaches near, attack and destroy it.",
"Author":"Chanakya"}
,
{"quoteText":"Silence at the proper season is wisdom, and better than any speech.",
"Author":"Plutarch"}
,
{"quoteText":"Everyone thinks of changing the world, but no one thinks of changing himself.",
"Author":"Leo Tolstoy"}
,
{"quoteText":"Growth itself contains the germ of happiness.",
"Author":"Pearl Buck"}
,
{"quoteText":"Waste no more time arguing about what a good man should be. Be one.",
"Author":"Marcus Aurelius"}];

 

function changeColor(){
 var color=["#f44336","#e91e63","#9c27b0","#03a9f4","#9575cd","#8bc34a","#ff5722"];
  var c=Math.floor(Math.random()*color.length);
 $('body').css('background-color',color[c]);
  $('.btn').css('background-color',color[c]);
  $('.txt').css('color',color[c]);
  $('.fa-quote-left,.fa-quote-right').css('color',color[c]);

}






function myFunction(){
   
 
var a=Math.floor(Math.random()*quotes.length);
  
  $("#text").html('<i class="fa fa-quote-left"></i>   '+ quotes[a].quoteText);
  $("#author").text('-'+quotes[a].Author);
  
  $("#quotes-box").effect('bounce',{distance: 15 ,times:3}, 1000 );

   
}


$(document).ready(function(){
  myFunction();
  changeColor();
 
 


    $("#button").on("click",function(){
       myFunction();
       changeColor();
     
       
     });

    $("#tweet-me").on("click",function(){
      var quote=$("p").text();
      window.open("https://twitter.com/intent/tweet?text="+quote);
    });



});
            
          
!
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