Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- 

Hello Camper!

For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding! 

- The freeCodeCamp Team 

-->
<script src="https://kit.fontawesome.com/0e6d1e369c.js" crossorigin="anonymous"></script>
<div class="r-q-project-wrapper">
  <div id="quote-box">
    <div class="r-q-quote-place-holder">&quot<span id="text"> The question isn’t who is going to let me; it’s who is going to stop me. </span></div>
    <div id="author"> -Nelson Mandela </div>
    <div id="social-share-new-quote-btn">
      <div id="social-share"> 
      <a href="https://www.facebook.com/target="_blank"><i class="fab fa-facebook-square"></i></a>
    
        <a id="tweet-quote" href="#" target="_blank"><i class="fab fa-twitter"></i></a> 
  </div>
  <input type="button" id="new-quote" value="next"> 
 </div>
</div>
                                                  <address id="h-q-copyright"> Project By @Yvana <a class="yvana" href="https://yvana.org" target="_blank"> https://yvana.org </a></address>
</div>

              
            
!

CSS

              
                
.r-q-project-wrapper{
    width: 100%;
    height: 600px;
    background-color: coral;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition : background-color 2s;
}

#quote-box{
    background-color: white;
    max-width: 750px;
    height: auto;
    transition: all 2s;
    border-radius:10px;
}

.r-q-quote-place-holder{
    font-family: "Roboto", cursive;
    font-size: 2rem;
    margin: 20px;
    color: var(--maincolor);
    transition: all 2s;
}

#author{
    font-family: cursive;
    font-size: 22px;
    text-align: right;
    margin: 30px;
    color: coral;
    transition: all 2s;
}

#text{
    color: coral;
    transition: color 2s;
}

#social-share-new-quote-btn{
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: space-around;
    margin: 50px;
}

#new-quote{
    background-color: coral;
    width: 150px;
    color: white;
    font-size: 20px;
    border:none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 2s;
}

#new-quote:focus{
  outline: none;
}

#h-q-copyright{
    margin: 20px;
    color: white;
}

.fa-facebook-square, .fa-twitter{
  font-size:35px;
  margin-right: 10px;
  color:var(--maincolor);
  transition: all 2s;
}

.yvana{
  color: darkgreen;
  text-decoration: none;
 }
              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 
jQuery(document).ready(function(){ 
  var quote = [
  "The greatest glory in living lies not in never falling, but in rising every time we fall",
  "Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma – which is living with the results of other people's thinking.",
  "Tell me and I forget. Teach me and I remember. Involve me and I learn.",
  "Spread love everywhere you go. Let no one ever come to you without leaving happier",
  "Whoever is happy will make others happy too.",
  "Only a life lived for others is a life worthwhile.",
  "Life is made of ever so many partings welded together.",
  "Success is not final; failure is not fatal: It is the courage to continue that counts.",
  "It is better to fail in originality than to succeed in imitation.",
  "Don't be afraid to give up the good to go for the great."
      ];

var author = [
  "- Nelson Mandela",
  "- Steve Jobs",
  "- Benjamin Franklin",
  "- Mother Teresa",
  "- Anne Frank",
  "- Albert Einstein",
  "- Charles Dickens",
  "- Winston S. Churchill",
  "- Herman Melville",
  "- John D"
];

var color = ["green", "coral", "red", "orange", "purple", "gray", "brown", "violet", "blueviolet", "aqua" ];

  $("#new-quote").click(function(){
      $randomIndex = Math.floor(Math.random()*(quote.length)); 
      $randomQuote = quote[$randomIndex];
      $randomAuthor = author[$randomIndex];
    
      $randomColorIndex = Math.floor(Math.random()*(color.length));  
      $randomColor = color[$randomColorIndex];

      $("#text").css("color", $randomColor);
      $('.r-q-project-wrapper').css("background-color", $randomColor);
      $("#author").css("color", $randomColor);
      $("#new-quote").css("background-color", $randomColor);
      $(".fa-twitter").css("color", $randomColor);
      $(".fa-facebook-square").css("color", $randomColor);
      $(".r-q-quote-place-holder").css("color", $randomColor);
      
      $tweetUrl = "https://twitter.com/intent/tweet?text="+$randomQuote + '  ---' +$randomAuthor;
      document.getElementById('tweet-quote').setAttribute("href", $tweetUrl);
    
      $("#text").html($randomQuote);
      $("#author").html($randomAuthor);
   });
});
              
            
!
999px

Console