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


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


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.


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.


                <div id="mycarousel" class="carousel slide" data-ride="carousel">
  <!-- carousel indicators -->
  <ol class="carousel-indicators">
    <li data-target="#mycarousel" data-slide-to="0" class="active"></li>
    <li data-target="#mycarousel" data-slide-to="1"></li>

  <!-- wrapper for slides -->
  <div class="carousel-inner">

    <!-- first slide -->
    <div class="carousel-item first active" id="1">
      <div class="carousel-caption">
        <div class="container">
          <div class="row justify-content-md-center">
            <div class="col">
              <h2 class="title">Special Offers</h2>
              <p class="desc">Aliquam ac lectus vitae elit maximus rutrum. Ut vulputate elementum eleifend. </p>
              <ul class="list">
                <li>Quisque vel metus</li>
                <li>Aliquam vestibulum placerat ultrices</li>
                <li>Cras pretium et est at congue</li>
                <li>Sed euismod mollis fermentum</li>
                <li>Cras pretium et est at congue</li>
            <div class="col">
              <div class="pc-wrapper">
                <img class="pc" src="" alt="pc" width="250" height="250">
                <div class="price">From $300</div>
              <img class="keyboard" src="" alt="keyboard" width="96" height="96">
              <button type="button" class="btn btn-danger btn-lg">Start Shopping</button>
      </div><!-- /carousel-caption -->
    </div><!-- /item -->

    <!-- second slide -->
    <div class="carousel-item second" id="2">
      <div class="carousel-caption">
        <div class="container">
          <h2 class="title">
            <span>Which is the most popular CMS: WordPress, Drupal, or Joomla?</span>
          <div class="row justify-content-md-center">
            <div class="col cms-wrapper">
              <div class="cms">
                <div class="front">1</div>
                <div class="back">
                  <img class="img-fluid" src="" alt="WordPress logo" />
              <p class="info">WordPress</p>
            <div class="col cms-wrapper">
              <div class="cms">
                <div class="front">2</div>
                <div class="back">
                  <img class="img-fluid" src="" alt="Joomla logo" />
              <p class="info">Joomla</p>
            <div class="col cms-wrapper">
              <div class="cms">
                <div class="front">3</div>
                <div class="back">
                  <img class="img-fluid" src="" alt="Drupal logo" />
              <p class="info">Drupal</p>
          <div class="source">
            Source: <a href="" target="_blank"></a>
      </div><!-- /carousel-caption-->
    </div><!-- /item -->

  </div><!--/carousel-inner -->


html {font-size: 62.5%;}
body {font-size: 1.8rem; font-family: "Noto Sans", sans-serif; color: #272626;}
.carousel-item {height: 100vh;}
.first {background: #D98F4F;}
.second {background: #2c9cae;}
.carousel-caption {top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; padding: 0; opacity: 0;}
.col {text-align: left;}
.col:last-child {text-align: center;}
.title {font-size: 3rem; margin-top: 0;}
.carousel-indicators {margin-bottom: 0;}

.first .title, .first .desc {padding: 15px; background: #d37c32;}
.first .title {display: inline-block;}
.first .desc {font-size: 2rem;}
.first .list {list-style: none; padding: 0; margin: 30px 0;}
.first .list li {margin-bottom: 15px; }
.first .list li::before {content: '✔'; padding-right: 10px;}
.first img {display: block; margin: 0 auto;}
.first .pc-wrapper {position: relative; width: 250px; margin: 0 auto;}
.first .price {position: absolute; top: 90px; left: 40px; padding: 5px; background: #d9534f; transform: rotate(-45deg);}
.first button {margin-top: 40px; font-size: 1.8rem;}

.second .title {display: block; background: transparent;}
.second span {display: inline-block; padding: 15px; background: #33b6cb;}
.second .cms {position: relative; display: flex; align-items: center; justify-content: center; width: 150px; height: 150px; padding: 5px; margin: 50px auto 10px; background: #33b6cb; border-radius: 5px; }
.second .front {font-size: 8rem; backface-visibility: hidden;}
.second .info {width: 150px; font-size: 2.2rem; text-align: center; margin: 0 auto; opacity: 0; transform: translateY(40px)}
.second .back {display: none; transform: scale(0); backface-visibility: hidden;}
.second .back img {width: 110px;}
.second .source {font-style: italic; margin-top: 40px; opacity: 0; visibility: hidden;}
.second .source a {color: #fff;}

@media screen and (max-width: 767px) {
  body {font-size: 1.6rem;}
  .container {width: 100%;}
  .first p {display: none;}
  .first .pc-wrapper {width: 150px;}
  .first .price {top: 45px; left: 10px;}
  .first .pc {width: 150px; height: 150px;}
  .first .keyboard {width: 50px; height: 50px;}
  .second .cms {width: 100px; height: 100px;}
  .second .info {width: 100px;}



                (function($) {

  "use strict";
  var $carousel = $("#mycarousel"),

    interval: false

  function firstTimeline() {
    var tl = new TimelineLite(); 
      .to(".first .carousel-caption", 0.1, {opacity: 1})
      .from(".first .pc", 1, { y: -300, opacity: 0, ease: Bounce.easeOut})
      .from(".first .keyboard", 1, { y: 300, opacity: 0, ease: Bounce.easeOut}, "-=1")
      .staggerFrom(".first .list li", 0.75, {opacity: 0, cycle: {x: [-200, 200]}, ease: Power2.easeOut}, 0.15, "-=0.5" )
      .from(".first .desc", 0.7, {x: 500, opacity: 0, ease: Power4.easeOut}, "-=0.5" )
      .from(".first .title", 0.7, {x: -500, opacity: 0, ease: Power2.easeOut}, "-=0.7" )
      .from(".first .price", 0.7, {scale: 0.01, ease: Power4.easeOut})
      .from(".first button", 0.7, { y: -700, autoAlpha: 0, ease: Bounce.easeOut}, "-=0.3");
    return tl;

  $(window).on("load", function() {
    firstTl = firstTimeline();

  $(document).keyup(function(e) {
    if(e.which === 39) {
    } else if(e.which === 37) {