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

HTML

              
                <div class="container text-center mo-text">
<div class="well mo-frame mo-color">
  <div class="row">
    <div class="col-xs-offset2">
 <div class="mo-title">
  Random Quote Generator
      <button id="mo-getquote" class="btn btn-primary mo-button">Quote Me!
  </button>
  </div>
    </div>
  </div>
  <div class="row">
    <div class="col-xs-offset2">
      <div id="quote" class="mo-quote">
        This is a quote 
      </div>
      <div id="attrib" class="mo-attribution">
        - weed
      </div>
    </div>
  </div>
  
  <div class="row">
    <div class="col-xs-offset2">
<button id="mo-twitter" class = "btn btn-primary btn-circle fa fa-twitter" alt="Share on Twitter">
  </button>
    </div>
  </div>
</div>
  <!-- end of main well -->

  <div class = "mo-credits">
    by <a href="https://codepen.io/pcblues">Mark Daniel Osborne</a>
</div>
</div>
  


              
            
!

CSS

              
                .mo-text {
  font-family:"Bree Serif",serif;
}

.mo-button {
  font-size:20px;
  margin-left:20px;
  margin-bottom:21px;
 
}

.container {
  padding:10px 10px 10px 10px;

}

.row {
  padding:20px;
}

.well {

}

.mo-frame {
  font-size:20px;

}
.mo-credits {
  font-size:15px;
  text-align:left;
}

.mo-title {
  font-size:30px;
}

.mo-quote {
  font-size:22px;
}
.mo-attribution {
  margin-top:10px;
  font-size:18px;
}

.btn-circle {
  border-radius:50%;
  height:40px;
  width:40px;
}

.mo-color {
    background: #ffffff;
    transition: background 0.2s linear;
    -webkit-transition: background 0.2s linear;
    -moz-transition: background 0.2s linear;
}
              
            
!

JS

              
                /* LIST

TODO:
Transition Effects:
Change colour/fade
Move bits around?
Fading text

LATER:
Look at:
- jquery ui
- bootstrap theme

DONE:
Circle button not circle
Choose font
Twitter button
Center everything
Credit link to your own name
Look at:
- fontawesome
Twitter API


*/

 function getRandomColor() {
        var letters = '789ABCDEF';
        var color = '#';
        for (var i = 0; i < 6; i++ ) {
            color += letters[Math.floor(Math.random() * 9)];
        }
        return color;
    };

function tweet() {
  window.open('https://twitter.com/intent/tweet?hashtags= freecodecamp&text=' 
              +encodeURIComponent($("#quote").text()+$("#attrib").text() ));
};
              
function quote() {
      $.ajax({
    url: "https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=",
    async: false,
        cache: false
  }).then(function(a) {
  $("#quote").html(a[0].content);
  $("#attrib").html(" - "+a[0].title);
        $('.mo-color').css('background', getRandomColor());
  })};

$("document").ready(
  function(){
  $(".mo-quote").html("To forgive is divine, to forget is alcohol.");
  $(".mo-attribution").html(" - Anon");
  $('.mo-color').css('background', getRandomColor()); 
  document.getElementById("mo-getquote").addEventListener("click",quote
  );// addeventlistener
    document.getElementById("mo-twitter").addEventListener("click",tweet
  );// addeventlistener
}); // ready



              
            
!
999px

Console