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

              
                <head><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
  </head>
  <body class="flexxy">
    <div class="qCon colorMe">
        <div class="qConInner"><i class="fa fa-quote-left colorMe"></i>
            <h1 id="quote-content" class="colorMe"></h1><i class="fa fa-quote-right colorMe"></i>
        </div>
        <div class="qConInner2">
            <h1 id="quote-title" class="colorMe"></h1>
        </div>
        <div id="quote-source" class="colorMe">
        </div>
        <div class="icons">
            <div><a id="get-another-quote-button"><p class="colorMe"><i class="fa fa-refresh colorMe"></i>
               <br> New Quote</p>
              </a>
            </div>
            <div><a id="tweetButt" target="_blank"><p  class="colorMe"><i class="fa fa-twitter colorMe"></i>
                <br>Tweet This</p>
              </a>
            </div>
        </div>

    </div>
    <div id="ps">Created by <a href="https://codepen.io/BobbyMcWho" target="_blank">Bobby McDonald <i class="fa fa-hand-o-left" aria-hidden="true"></i></a></div>
</body>

              
            
!

CSS

              
                .flexxy {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    height: auto;
    min-height: 100vh !important;
    background-color: orange;
    width: 100vw;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    font-size: 2rem;
}

.qCon {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    background-color: white;
    border-radius: 15px;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    max-width: 80%;
}

.colorMe {
    color: orange;
    font-family: 'Oswald', sans-serif;
  transition: background-color 0.5s ease;
  transition: color 0.5s ease;
}

.qConInner {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

.qCon i {
    font-size: 1em;
    padding: .5em;
}


.fa-quote-right {
    -webkit-align-self: flex-end;
    -ms-flex-item-align: end;
    align-self: flex-end;
}

#quote-title {
    -webkit-align-self: flex-end;
    -ms-flex-item-align: end;
    align-self: flex-end;
    margin-right: 6rem;
}

.qConInner2 {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: end;
    -webkit-justify-content: flex-end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    padding-right: 2rem;
    margin-top: -3rem;
    width:auto;
}

.icons {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin: 2rem 2rem 0 2rem;
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    -webkit-align-content: stretch;
    -ms-flex-line-pack: stretch;
    align-content: stretch;
}

.icons i {
    padding: 0 2rem 0 2rem;
}



.icons a:hover i {
    color: #000000 !important;
    cursor: pointer;
}

.icons a:hover p {
    color: #000000 !important;
}

.icons a:hover {
    text-decoration: none;
}
#quote-source {
    margin-right: 8rem;
    -webkit-align-self: flex-end;
    -ms-flex-item-align: end;
    align-self: flex-end;
}
#quote-source a{
    color:inherit;
    text-decoration: underline;
}
#ps{
    color:white;
    font-family: Oswald, sans-serif;
    margin-top: 1rem;
  font-size:.5em;
}
#ps a{
    color:Black;
    text-decoration: none;
}
.icons p, .icons a{
    font-size: 1em !important;
    text-decoration: none;
}
h1 {
    font-size: 1em;
}
#quote-title{
    font-size: 1em;
}
#quote-source {
    font-size: .5em;
}
#ps i{
    color: #000000 !important;
}
@media only screen and (max-width:768px){
  html {
    font-size:.5rem;
  }
}

              
            
!

JS

              
                $(document).ready(function() {
  var cc = 0;
  var curColor = "";
  var colors = ['#03A9F4', '#F44336', '#3F51B5'];
  function colorChange(input) {
    if (input < (colors.length - 1)) {
      cc += 1;
      curColor = colors[cc];
    } else {
      cc = 0;
      curColor = colors[cc];
    }
  }

  function newQuote() {
    $.ajax({
      type: 'GET',
      dataType: "JSON",
      url: 'https://quotesondesign.com/wp-json/wp/v2/posts/?orderby=rand',
      success: function(data) {
        var post = data.shift();
        $('#quote-title').html("&mdash; " + post.title.rendered);
        $('#quote-content').html(post.content.rendered);

        if (typeof post.custom_meta !== 'undefined' && typeof post.custom_meta.Source !== 'undefined') {
          $('#quote-source').html('Source:' + post.custom_meta.Source);
        } else {
          $('#quote-source').text('');

        }
      },
      cache: false,
      complete:function tweetIt () {
  var author = document.getElementById('quote-title').innerText || document.getElementById('quote-title').textContent;
        var quote = document.getElementById('quote-content').innerText || document.getElementById('quote-content').textContent;
  var tweetUrl = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(quote) + '-' +
    encodeURIComponent(author);
    $('#tweetButt').attr('href',tweetUrl);
  // window.open(tweetUrl);
}
    });
    colorChange(cc);
    $("i").css({
      "color": curColor
    });
    $("body").css({
      "background-color": curColor
    });
    $(".colorMe").css({
      "color": curColor
    });

    $(".colorMe a").css({
      "color": curColor
    });

    $(".qCon").fadeOut(100, "linear");
 setTimeout(function(){$(".qCon").fadeIn(800, "linear");},400);
    $(".colorMe").fadeOut(100, "linear");
      setTimeout(function(){$(".colorMe").fadeIn(800, "linear");},400);
    $('#ps').fadeOut(100, "linear");
     setTimeout(function(){$('#ps').fadeIn(800, "linear");},400);
  }  
  
   
  $('#get-another-quote-button').on('click', newQuote);
  newQuote();


    // $('#tweetButt').on('click', tweetIt);

  //Optional future wiki-author
  // function wikiIt() {
  //   var author = document.getElementById('quote-title').innerText;
  //   var wikiUrl = 'https://wikipedia.org/wiki/' +
  //     encodeURIComponent(author);
  //   window.open(wikiUrl);
  // }
  //$('#quote-title').on('click', wikiIt);

  // Optional future Google quote on click
  // function googleQuote() {
  //   var quote = document.getElementById('quote-content').innerText;
  //   var googleUrl = 'https://www.google.com/search?q=' +
  //     encodeURIComponent(quote);
  //   window.open(googleUrl);
  // }
  // $('#quote-content').on('click', googleQuote);
  $('body').keyup(newQuote);

});
              
            
!
999px

Console