css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

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.

            
              <script>document.body.className += ' fade-out';</script>

<div class="navbar navbar-fixed-top header">
  <img src="https://res.cloudinary.com/taltul/image/upload/c_fit,e_sharpen:100,h_120,q_auto:best/v1478553596/chuck_norris_578999_by_shinikami1-d6wjd8i_bmmjqe.png" alt="Chuck Norris smile" id="logo">
  <div id="welcome"><h2><strong> Welcome to random Chuck Norris joke generator!</strong></h2><h4>Click on one of the categories below and try not to get punched in the face ;)</h4>
  </div>
    <img src="https://res.cloudinary.com/taltul/image/upload/c_scale,e_sharpen:100,h_100,q_auto:best/v1478561899/chucknorris_brown_tbedda.png" alt="approved by Chuck Norris" id="logo2">
</div>

<div class="card-group group1">
  
  <div class="card card-outline-danger hidden" id="dev">
    <div class="card-block"><br>
      <h3 class="card-title title1"><strong>Development</strong></h3><hr>
      <blockquote class="card-text" id="devOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
 <div class="card card-outline-danger hidden" id="explicit">
    <div class="card-block"><br>
      <h3 class="card-title title2"><strong>Explicit</strong></h3><hr>
      <blockquote class="card-text" id="explicitOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
  <div class="card card-outline-danger hidden" id="movie">
    <div class="card-block"><br>
      <h3 class="card-title title3"><strong>Movies</strong></h3><hr>
      <blockquote class="card-text" id="movieOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
</div>


<div class="card-group group2">
  
  <div class="card card-outline-danger hidden" id="food">
    <div class="card-block"><br>
      <h3 class="card-title title4"><strong>Food</strong></h3><hr>
      <blockquote class="card-text" id="foodOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
 <div class="card card-outline-danger hidden" id="celebrity">
    <div class="card-block"><br>
      <h3 class="card-title title5"><strong>Celebrity</strong></h3><hr>
      <blockquote class="card-text" id="celebrityOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
  <div class="card card-outline-danger hidden" id="science">
    <div class="card-block"><br>
      <h3 class="card-title title6"><strong>Science</strong></h3><hr>
      <blockquote class="card-text" id="scienceOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
</div>

  </div>

<div class="card-group group3">
  
  <div class="card card-outline-danger hidden" id="sport">
    <div class="card-block"><br>
      <h3 class="card-title title7"><strong>Sport</strong></h3><hr>
      <blockquote class="card-text" id="sportOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
 <div class="card card-outline-danger hidden" id="religion">
    <div class="card-block"><br>
      <h3 class="card-title title8"><strong>Religion</strong></h3><hr>
      <blockquote class="card-text" id="religionOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
  <div class="card card-outline-danger hidden" id="animal">
    <div class="card-block"><br>
      <h3 class="card-title title9"><strong>Animals</strong></h3><hr>
      <blockquote class="card-text" id="animalOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
</div>
  </div>

<div class="card-group group4">
  
  <div class="card card-outline-danger hidden" id="music">
    <div class="card-block"><br>
      <h3 class="card-title title10"><strong>Music</strong></h3><hr>
      <blockquote class="card-text" id="musicOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
 <div class="card card-outline-danger hidden" id="history">
    <div class="card-block"><br>
      <h3 class="card-title title11"><strong>History</strong></h3><hr>
      <blockquote class="card-text" id="historyOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
  <div class="card card-outline-danger hidden" id="travel">
    <div class="card-block"><br>
      <h3 class="card-title title12"><strong>Travel</strong></h3><hr>
      <blockquote class="card-text" id="travelOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
</div>
  </div>

<div class="card-group group5">
  <div class="card card-outline-danger hidden" id="career">
    <div class="card-block"><br>
      <h3 class="card-title title13"><strong>Career</strong></h3><hr>
      <blockquote class="card-text" id="careerOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
 <div class="card card-outline-danger hidden" id="money">
    <div class="card-block"><br>
      <h3 class="card-title title14"><strong>Money</strong></h3><hr>
      <blockquote class="card-text" id="moneyOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
  <div class="card card-outline-danger hidden" id="fashion">
    <div class="card-block"><br>
      <h3 class="card-title title15"><strong>Fashion</strong></h3><hr>
      <blockquote class="card-text" id="fashionOutput"></blockquote>
    </div>
    <i class="fa fa-twitter fa-2x tweet" aria-hidden="true"></i>
  </div>
  
</div>
  </div>

  <div id="footer">by<a class="footerlink" href="https://twitter.com/websounds" target="_blank"> <strong>WebSounds</strong></a></div>

<img id="scrolldown" src="https://res.cloudinary.com/taltul/image/upload/c_scale,e_colorize:59,h_80,q_auto:best/v1478636362/54414-200_ljpdqa.png" alt="scroll-down">
            
          
!
            
              html {
  background-color: white;
}

body {
  font-family: ‘Lucida Console’, Monaco, monospace;
  cursor:url(https://res.cloudinary.com/taltul/image/upload/c_scale,h_35/v1478642240/click_jupxrb.png), auto;
  opacity: 1;
  transition: 3s opacity;
}


body::-webkit-scrollbar {
    width: 5px;
}

body.fade-out {
    opacity: 0;
    transition: none;
}

#logo {
  position: absolute; 
  left: 0px; 
  top: -10px; 

}

#logo2 {
  position: absolute; 
  top: 2px; 
  right: 10px; 
  opacity: 0.9;
}

.header {
  background-color: white;
  color: brown; 
  height: 110px; 
  text-align: center;
  border-bottom: 1px solid brown;
  margin: 10px 0px 10px 0px; 
  transition: all 0.2s ease;
}

.header:hover {
  cursor: default; 
}

.shrink {
  opacity: 0;
}

h2, h4 {
  font-size: 7vh;
  font-size: 1.8vw; 
}

#welcome {
  width: 80%; 
  margin: 0 auto;  
}

.group1 {
  margin-top: 111px;
  border-bottom: 1px dotted grey;
  animation: 1s animateBorder infinite;
}

.group2 {
  border-bottom: 1px dotted grey;
  animation: 2s animateBorder infinite;
}

.group3 {
  border-bottom: 1px dotted grey;
  animation: 3s animateBorder infinite;
}

.group4 {
  border-bottom: 1px dotted grey;
  animation: 4s animateBorder infinite;
}

.group5 {
  border-bottom: 1px dotted grey;
  animation: 5s animateBorder infinite;
}

@keyframes animateBorder {
  to {
    border-bottom: 1px dotted brown;
  }
}

hr {
  border-width: 1px; 
  border-color: whitesmoke; 
  border-style: dotted;
}

.title1 {
  position: relative; 
  padding-left: 45px; 
}

.title1:after {
  content: '\f2c5';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}

.title2 {
  position: relative; 
  padding-left: 40px; 
}

.title2:after {
  content: '\f1ab';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}

.title3 {
  position: relative; 
  padding-left: 40px; 
}

.title3:after {
  content: '\f03d';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}

.title4 {
  position: relative; 
  padding-left: 40px; 
}

.title4:after {
  content: '\f0f5';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}

.title5 {
  position: relative; 
  padding-left: 45px; 
}

.title5:after {
  content: '\f083';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}

.title6 {
  position: relative; 
  padding-left: 40px; 
}

.title6:after {
  content: '\f0c3';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}

.title7 {
  position: relative; 
  padding-left: 40px; 
}

.title7:after {
  content: '\f1e3';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title8 {
  position: relative; 
  padding-left: 40px; 
}

.title8:after {
  content: '\f059';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title9 {
  position: relative; 
  padding-left: 40px; 
}

.title9:after {
  content: '\f17c';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title10 {
  position: relative; 
  padding-left: 40px; 
}

.title10:after {
  content: '\f001';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title11 {
  position: relative; 
  padding-left: 40px; 
}

.title11:after {
  content: '\f1da';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title12 {
  position: relative; 
  padding-left: 40px; 
}

.title12:after {
  content: '\f072';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title13 {
  position: relative; 
  padding-left: 45px; 
}

.title13:after {
  content: '\f2b5';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title14 {
  position: relative; 
  padding-left: 40px; 
}

.title14:after {
  content: '\f15a';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.title15 {
  position: relative; 
  padding-left: 40px; 
}

.title15:after {
  content: '\f21b';
  font-family: fontAwesome;
  position: absolute;
  left: 0px; 
  top: 0px; 
}


.hidden {
  height: 280px; 
  opacity: 0; 
  background: brown;
  color: white; 
  text-shadow: 1px 1px 1px black; 
  font-size: 105%;
  border-right: 1px dotted brown;
}

.hidden:hover {
  opacity: 0.5; 
  transition: opacity .2s ease-in-out;
}

.active {
  opacity: 1; 
}

.active:hover {
  opacity: 1;
  cursor: url(https://res.cloudinary.com/taltul/image/upload/c_scale,h_35/v1478642701/click3_c4ntii.png), auto; 
}

.tweet {
  position: absolute;
  right: 20px; 
  bottom: 10px; 
}

.tweet:hover {
  color: #1DA1F2; 
/*   cursor: pointer; */
  transform: scale(1.5);
}

#footer {
  text-align: center;
  color: brown; 
  font-size: 15px; 
  vertical-align: middle;
  padding-top: 40px;
}

#footer:hover {
  cursor: default;
}

.footerlink {
  color:brown;
}

.footerlink:hover {
  text-decoration: none; 
  color:#0084B4;
}

.footerlink:active {
  text-decoration: none; 
  color:#0084B4;
}

.footerlink:focus {
  text-decoration: none; 
  color:#0084B4;
}

#scrolldown {
  position: fixed;
  opacity: 0.9;
  bottom: 20px;
  right: 48%;
}
            
          
!
            
              $(document).ready(function(){
  
  $(function() {
    $('body').removeClass('fade-out');
  });
  
  $(window).scroll(function() {
  if ($(document).scrollTop() > 50) {
    $('.header').addClass('shrink');
  } else {
    $('.header').removeClass('shrink');
  }
  });
  
  $(".tweet").on("click", function tweetIt() {
    var idForOutput = $(this).parent().attr("id") + "Output";
    var phrase = $("#" + idForOutput).text();
    var tweetUrl = 'https://twitter.com/share?text=' +
        encodeURIComponent(phrase) + '&url=' +
        'https://codepen.io/websounds/full/GNgpWJ';
    window.open(tweetUrl);
  });
  
  var lastActiveId = "logo";
  
  $(".card").on("click", function() {
    $("#" + lastActiveId).removeClass("active");
    $(this).addClass("active");
    lastActiveId = this.id;    
    $.getJSON("https://api.chucknorris.io/jokes/random?category=" + lastActiveId, function(json) {
    var html = json["value"]; 
    var idForOutput = lastActiveId + "Output"
    $("#" + idForOutput).html(html);
    });
  });
    
  $(window).scroll(function() {
    if($(window).scrollTop() + $(window).height() ==
       $(document).height()) {
      $("#scrolldown").css("bottom","-200px");
    } else {
      $("#scrolldown").css("bottom","20px");
    }
  });
  
});

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console