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

              
                <div class="container arm-section-container">
<div class="arm-inner-container text-center">
<div class="quote-container-full">
  <div class="quote-container-top">
    <p class="description"> QUOTE GENERATOR | <em>SELECT A CATEGORY BELOW</em></p>
    <div class="quote-container">
    <i class="fa fa-quote-left hidden"></i>
    <p id="quote"><span style="display: block; text-transform: uppercase;"> Random Quote Generator</span></p>
    <i class="fa fa-quote-right hidden"></i>
      <p class="by-line hidden"></p>
    </div>
  </div>
</div>
</div>



<h3>SELECT FROM ANY OF THE FOLLOWING OPTIONS</h3>

<div class="grid buttons">
  <figure class="btn" id="random-quote">
      <img src="http://www.mrwallpaper.com/wallpapers/green-wheat-field-sunset.jpg" alt="">
      <figcaption class="fig-caption-style">
        Random Quotes
      </figcaption>

    </figure>
    <figure class="btn" id="famous-quote">
      <img src="http://www.wallpaperup.com/uploads/wallpapers/2013/07/27/124596/big_thumb_496b16a28014c92e46e8a3b8c374f3a1.jpg" alt="">
      <figcaption class="fig-caption-style">
        Famous Quotes
      </figcaption>
    </figure>
    <figure class="btn" id="inspirational-quote">
      <img src="http://nogibogi.com/wp-content/uploads/2015/05/Jonathan_Wyatt_trail_run_1_2011-2.jpg" alt="">
      <figcaption class="fig-caption-style">
        Inspirational Quotes
      </figcaption>
    </figure>
</div>
  <div class="wrapper">
  <button class="share-button btn btn-block " id="tweet"> Share Quote on Twitter</button>
<div id="footer" class="text-center">
    </div>
  <p class="footer"> Made by <a href="https://codepen.io/alphakevy/" target="_blank">Kevin R on CodePen.io </a><span id="credits" class="hidden"></span></p>
</div>
</div>

 <!--
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
-->
                                                           

              
            
!

CSS

              
                * {
  transition: all 0.2s;
  outline:none;
}
*::-moz-selection {
  color: #679895;
  background: #fff;
}
*::selection {
  color: #679895;
  background: #fff;
}
html,body {
  height: 100%;
  width: 100%;
}

body {
  width: 90%;
  margin: 30px auto;
  font-family: Palatino Linotype;
  background-image: url("http://wallpapercave.com/wp/jXs1GVK.jpg"); 
  background-size: 100%; 
}
.social-buttons {
  display: inline-block;
}
#twitter {
  border:none;
  border-radius: 15px;
  width: 100px;
  height: 100px;
}
.quote-container-full {
  height: 400px;
  font-size: 25px;
  border: solid;
  border-color: black;
  background-color: rgba(0, 0, 0,   0.6); 
}
.quote-container-top {
  color: white;
background-color: rgba(0, 0, 0, 0.5);  
  height: 40px;
  padding-left: 5px;
}
p {
  text-align: left;
  line-height: 40px;
}
#quote {
  text-align: center;
  display: inline-block;
  width: 100%;
  margin: 0 auto;
  padding-top: 50px;
}
.description {
  color: #ffa500;
}

.description em {
  color: #fff;
}
.arm-section-container {
  height: 100%;
  margin-bottom: 10px;
}
.arm-inner-container {
  vertical-align: top;
  padding: 20px 0;
}
.hidden {
  display:none;
}
.quote-container {
  width: 90%;
  padding: 30px 0;
  margin: 0 auto;
  font-size: 25px;
  -moz-animation-duration: 0.5s;
  -webkit-animation-duration: 0.5s;
}
.italic {
  font-style: italic;
}
fa.fa-quote-left, fa-quote-right {
  display: block;
}
fa-quote-left {
  text-align: left;
  margin-bottom: 10px;
}
fa.fa-quote-right {
  margin-bottom: 10px;
  text-align: right;
}
.by-line {
  font-size: 20px;
  font-weight: 700;
  padding-top:30px;
  text-align: center;
}
.top-border {
  width:80%;
  background-color: #fff;
  height: 1px;
  display:block;
  margin: 0 auto 20px auto;
}

h3 {
  text-align: center;
  font-size: 1.65em;
  margin: 0 0 30px;
  font-size: 25px;
  padding-top:15px;
  color: white;
  text-decoration: underline;

}
.grid {
  text-align: center;
  display: inline-block;
}
.fig-caption-style {
  text-align:center;
  color:white;
  padding-bottom: 5px;
}
figure {
  font-size: 16px;
  display: inline-block;
  vertical-align:top;
  margin-bottom: 8px;
  width: calc(50% - 4px);
  margin-right: 8px;
  text-decoration: none;
    background-color: rgba(0, 0, 0,   0.3);
  border: solid;
}
.btn {
  font-size: 16px;
  display: inline-block;
  vertical-align:top;
  text-decoration: none;
  border: solid;
  border-color: black;
 
}


figure:nth-of-type(2n) {
  margin-right: 0;
}

@media screen and (min-width: 50em) {
  figure {
    width: calc(25% - 6px);
  }
  
  figure:nth-of-type(2n) {
    margin-right: 8px;
  }
  
  figure:nth-of-type(4n) {
    margin-right: 0;
  }
}

figure:hover img {
  transform: scale(1.10);
}

figure {
  margin: 0;
  overflow: hidden;
}

figcaption {
  margin-top: 5px;
}

img {
  border: none;
  max-width: 100%;
  height: auto;
  display: inline-block;
  transition: transform .2s ease-in-out;
}


.p figure {
  display: inline;
  font-size: 13px;
  margin: 0;
  text-decoration: underline;
  color: blue;
}
.btn:hover, .btn:active, btn:focus {
  border-color: grey;
}

.p {
  text-align: center;
  font-size: 13px;
}
.footer {
  text-align: right;
  color: white;
}
.wrapper {
  text-align: center;
}
#tweet {
  margin-top: 10px;
  width:75%;
  background-color: rgba(0, 0, 0,   0.3); 
  color: white;
  text-align: center;
}
              
            
!

JS

              
                $(document).ready(function () {
    var firstClick = true, quote, topBorder = '<span class=\'top-border\'></span>', author, credits;
    function responseHandler() {
        $('.quote-container').addClass('animated zoomOut').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
            if (firstClick) {
                /*$('#random-quote').html('<i class=\'fa fa-refresh\'></i> Random Quote');*/
                $('.hidden').each(function () {
                    $(this).removeClass('hidden');
                });
                $('#quote').addClass('italic');
                firstClick = false;
            }
            $('#quote').html(quote);
            $('.by-line').html(topBorder + '' + author);
            /*$('#random-quote').find('i').removeClass('fa-spin');*/
            $(this).removeClass('animated zoomOut').addClass('animated zoomIn');
            $('#credits').html(credits);
        });
    }
    $('#random-quote').click(function () {
        $(this).find('i').addClass('fa-spin');
            $.getJSON('https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?', function (json) {
                quote = json.quoteText;
                author = json.quoteAuthor === '' ? 'Anonymous' : json.quoteAuthor;
                credits = 'Credits: <a href=\'https://forismatic.com/en/\' target=\'_blank\'>Forismatic</a>';
                responseHandler();
            });
      
});
      $('#famous-quote').click(function () {
        $(this).find('i').addClass('fa-spin');
         $.ajax({
                url: 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=famous',
                type: 'POST',
                headers: {
                    'X-Mashape-Key': 'kxvN5S8YTJmshMSqWzhzbPm5uToip1oYkjxjsnbIh6WBdme5Zf',
                    'Content-Type': 'application/x-www-form-urlencoded',
                    'Accept': 'application/json'
                },
                success: function (responseJSON) {
                    quote = responseJSON.quote;
                    author = responseJSON.author === 'unknown' ? 'Anonymous' : responseJSON.author;
                    credits = 'Credits: <a href=\'https://market.mashape.com/andruxnet/random-famous-quotes\' target=\'_blank\'>Andruxnet - Mashape</a>';
                    responseHandler();
                },
                dataType: 'json'
            });
      
});
        $('#inspirational-quote').click(function () {
               $(this).find('i').addClass('fa-spin');
            $.getJSON('https://random-quote-generator.herokuapp.com/api/quotes/random', function (json) {
                quote = json.quote;
                author = json.author === '' ? 'Anonymous' : json.author;
                credits = 'Credits: <a href=\'https://random-quote-generator.herokuapp.com/\' target=\'_blank\'>Herokuapp</a>';
                responseHandler();
            });      
});
$('#tweet').click(function(){
  window.open('https://twitter.com/intent/tweet?text=' + encodeURIComponent($('#quote').text()) + ' - ' + $('.by-line').text() + '&hastags=FCC');
})
});
              
            
!
999px

Console