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 id="container" class="container">
      <header class="header">
        <div id="logo" class="header__logo">
          <a href="index.html" class="header__link" id="linkIndex">  
          </a>
        </div>
        <div class="header__tittle">
          <h1>Citation</h1>
        </div><!-- Title -->
      </header>
      <div class="btnContainer" >
        <button id="getQuote" class="btn">Get your quote</button>
      </div><!--button container-->
      <section id="mainContent" class="mainContent">
        <article id="quotesWrapper" class="quotesWrapper">
          <div>
            <blockquote id="quoteContainer" class="" cite="">
            </blockquote>
          </div>
          <div id="citeContainer" class="citeContainer">  
          </div><!--Cite container-->
        </article>
      </section><!--mainContent-->
      <section class="socialMedia">
        <div class="social__logo">
          <a href="https://twitter.com/intent/tweet" class="social__link" title="Share in Twitter..." id="linkTwitter" target="_blank" rel="noopener noreferrer">
            <i class="fa fa-twitter" aria-hidden="true"></i>
          </a>
        </div>
        <div class="social__logo">
          <a href="https://www.tumblr.com/widgets/share/tool" class="social__link" title="Share this quote in tumbler..." id="linkTumbler" target="_blank" rel="noopener noreferrer">
            <i class="fa fa-tumblr" aria-hidden="true"></i>
          </a>
        </div>
      </section>    
  </div><!-- /.container -->
   <footer class="footer text-center">
      <div class="footer__credits">
        <p class="credits__text">Designed and coded by Jose S. Guti&eacute;rrez D. &copy; 2017 </p>
      </div>
    </footer>
              
            
!

CSS

              
                
body{
  background-color:#222 ; 
}
.container{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.header{
  align-items: center;
  background-color: #444;
  background-color: rgba(255, 255, 255, 0.01);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 90px;
}

.header__logo{
  background-color: #FF1361;
  background-image: url(http://res.cloudinary.com/jsgdcloudiary/image/upload/v1512580434/JSGDlogo_oaglif.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50px 50px;
  border-radius: 50% ;
  justify-content: center;
  padding: 20px;
 
}
.header__logo-Fallback{
  height: 70px;
  width: 70px;
}
a.header__link {
  display: inline-block;
  position: relative;
  width: 100%;
}

a.header__link:after {
  bottom: 0; 
  content: ""; 
  left: 0;
  position: absolute; 
  right: 0;
  top: 0; 
}


.header__tittle{
  color: white;
  font-family: 'Gruppo', cursive;
  font-size: 2em;
  margin-top: -75px;
}

.btnContainer{
  display: flex;
  justify-content: center;
  margin-top: 20px;
  width: 100%;
}

.btn{
  background-color: #444;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 5px;
  box-shadow: 0 0 1px transparent;
  color: #FF1361;
  cursor: pointer;
  font-family: 'Gruppo', cursive;
  font-size: 1.3em;
  padding: 5px;
  -ms-transform: perspective(1px) translateZ(0);
  -webkit-transform: perspective(1px) translateZ(0);
  transform: perspective(1px) translateZ(0);
  -webkit-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -webkit-transition-property: box-shadow color;
  transition-property: box-shadow color;
  width: 70%;
}

.btn:hover{
  box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 1);
  color: #FF8B2E;
}

.mainContent{
  align-items: center;
  background-color: #444;
  background-color: rgba(255, 255, 255, 0.01);
  border-radius: 5px;
  color: white;
  display: flex;
  flex-direction: column;
  font-family: 'Raleway', sans-serif;
  font-size: 1.5em;
  justify-content: center;
  margin-top: 20px;
  width: 95%;
}
.quotesWrapper{
  height: 0;
}
.citeContainer{
  margin: 15px;
  text-align: right;
}

.socialMedia{
  display: flex;
  justify-content: space-around;
  width: 50%;
}
.social__logo{
  margin-top: 20px;
}

.social__link{
  border-radius: 50%;
  color: #FF1361;
  cursor:pointer;
  font-size: 1.5em;
  padding: 10px;
  -ms-transform: perspective(1px) translateZ(0);
  -webkit-transform: perspective(1px) translateZ(0);
  transform: perspective(1px) translateZ(0);
  -webkit-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -webkit-transition-property: box-shadow color;
  transition-property: box-shadow color;
}

.social__link:hover{
  box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 1);
  color: #FF8B2E;
}

footer{
  background-color: #444;
  background-color: rgba(255, 255, 255, 0.01);
  bottom: 0;
  color: #FF1361;
  font-size: 0.8em;
  margin: 100px auto 0 auto;
  padding: 5px;
  text-align: center;
  width: 95%;
}

.credits__text{
  margin: 0;
  
}

@media screen and (min-width: 576px){
  .header{
    flex-direction: row;
    margin-top: 50px;
  }

  .header__logo{
    top:0;
    width: 70px;
  }
  .header__tittle{
    font-size: 2.5em;
    margin-left: 50px;
    margin-top: 0;
  }

}

@media screen and (min-width: 768px){
  .header__logo{
    top: 0;
  }
  .header__tittle{
    font-size: 2.5em;
    margin-top: 0;
  }

  .btnContainer{
      margin-top: 60px;
    }

  .mainContent{
    margin-top: 60px;
    width: 70%;
  }

}

              
            
!

JS

              
                $(document).ready(function() {
  var quoteContainer = $("#quoteContainer");
  var citeContainer = $("#citeContainer");
  var quotesWrapper = $("#quotesWrapper");
  var mainContent = $("#mainContent");
  quotesWrapper.css({ opacity: 0 });
  mainContent.css({ opacity: 0 });
  var quotesObj;
  var quotesFileUrl ='https://cors-anywhere.herokuapp.com/http://res.cloudinary.com/jsgdcloudiary/raw/upload/v1512580462/quotes_smwxuy.json';
  var response = $.getJSON(quotesFileUrl, function(json) {
      //json file made by @nasrulhazim - https://gist.github.com/nasrulhazim/54b659e43b1035215cd0ba1d4577ee80
      quotesObj = json;
       }); 
  $("#getQuote").on("click", function(){
    quotesWrapper.css({ opacity: 0 });
    mainContent.css({ opacity: 0 });
    var max = quotesObj.quotes.length;
    var quoteIndex = Math.floor(Math.random() * (max + 1));
    var quote = quotesObj.quotes[quoteIndex].quote;
    var author = quotesObj.quotes[quoteIndex].author;
    var htmlQuote = "<p>\"" + quote + "\"</p>";
    var htmlCite = "<cite>-" + author + "</cite>";
    var linkTwitter = 'https://twitter.com/intent/tweet?text=';
    linkTwitter +='"' + encodeURIComponent(quote) + '"%20By%20' + encodeURIComponent(author);
    var linkTumbler = 'http://tumblr.com/widgets/share/tool?posttype=quote?tags=quote,quoteoftheday?';
    linkTumbler += 'title=Quote%20by%20'+ encodeURIComponent(author) + '?content=' + encodeURIComponent(quote); 
    linkTumbler += '?caption=' + escape(author) + '.?&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button';
    quoteContainer.html(htmlQuote);
    citeContainer.html(htmlCite);
    $("#linkTwitter").attr("href", linkTwitter);
    $("#linkTumbler").attr("href", linkTumbler);
    $("#getQuote").html("Get another quote");
    if( !quotesWrapper.is(':animated')){
      quotesWrapper.animate({
          opacity: 1,
          height: "100%",
        }, 500, function() {
          // Animation complete.
        });
      mainContent.animate({
          opacity: 1,
        }, 800, function() {
          // Animation complete.
        });
    }  
  });
});
              
            
!
999px

Console