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. 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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
<div id="wrapper">
  <div id="quote-box">
    <div id="quote-text">
      <i id="quote-icon-1" class="fa fa-quote-left font-size: 28px"></i>
      <span id="text">The mind is everything. What you think you become</span> <i id="quote-icon-2" class="fa fa-quote-right font-size: 28px"></i>
    </div>
    <div id="author-box">
      -
      <span id="author" class="text-center">Buddha</span>
    </div>
    <div id="buttons">

      <button id="tweet-button" type="button" class="btn btn-outline-primary"><i class="fab fa-twitter"></i><a id="tweet-quote" class="twitter-share-button" href="twitter.com/intent/tweet" data-size="large" target="_blank"></a></button>

      <button id="new-quote" type="submit" class="btn btn-outline-primary">New Quote</button>
    </div>

  </div>
</div>
              
            
!

CSS

              
                div {
  position: relative;
  z-index: 2;
}

body {
  font-family: "Muli", sans-serif;
  background-image: url("https://img00.deviantart.net/c01b/i/2008/066/a/6/hokusai__s_great_wave_download_by_pooxie.jpg");
  background-repeat: no-repeat;
  background-size: 100vw 100vh;
  font-weight: 400;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
#wrapper {
  width: 500px;
  height: 425px;
}
#quote-box {
  border-radius: 5px;
  background-color: #ffebcd;
  width: 500px;
  padding: 40px 50px;
  display: table;
  border-style: solid;
  border-width: 3px;
  border-color: gray;
}

#quote-text {
  font-size: 25px;
  height: 150px;
  overflow-y: scroll;
}

#quote-icon-1 {
  margin-right: 10px;
}

#quote-icon-2 {
  margin-left: 10px;
}
#author-box {
  display: flex;
  padding: 0.4em;
  font-size: 20px;
  float: right;
}

#buttons {
  padding: 0.5em;
  display: inline-block;
  width: 100%;
  margin-top: 0.2em;
}

#tweet-button {
  float: left;
}

#new-quote {
  float: right;
  font-weight: bold;
}

              
            
!

JS

              
                $(document).ready(function() {
  function quote() {
    var quotes = [
      "A journey of a thousand miles begins with a single step",
      "Every morning we are born again. What we do today is what matters most",
      "A new command I give you: Love one another. As I have loved you, so you must love one another",
      "If your mind is empty, it is always ready for anything, it is open to everything. In the beginner’s mind there are many possibilities, but in the expert’s mind there are few",
      "Happiness is not something ready made. It comes from your own actions"
    ];
    var authors = [
      "Lao Tzu",
      "Buddha",
      "Jesus",
      "Shunryu Suzuki",
      "Dalai Lama"
    ];

    var randomNumber = Math.floor(Math.random() * quotes.length);
    var randomQuote = quotes[randomNumber];
    var randomAuthor = authors[randomNumber];

    $("#text").text(randomQuote);
    $("#author").text(randomAuthor);
  }
  $("#new-quote").on("click", function() {
    quote();
  });
  
  $("#tweet-button").on("click",function(){
    window.open("https://twitter.com/intent/tweet", "_blank")
  })
});

              
            
!
999px

Console