cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              h1.intro Getting the most out of 
  em Talented
    .change-text
      span.active Animators
      span Designers
      span Directors
      span Coders
            
          
!
            
              $base: 16;

// Calculate pixels to rem units for font sizes
@mixin font-size($f) {
  font-size: $f+px;
  font-size: $f/$base+rem;
}

// transitions
@mixin transition($property, $duration) {
	-webkit-transition: $property $duration ease-in-out;
	-moz-transition: $property $duration ease-in-out;
	transition: $property $duration ease-in-out;
}

$mq1: 666; // Mid range breakpoint
$mq2: 800; // Med screen breakpoint
$mq3: 1024; // Large screen breakpoint
$mq4: 1325; // xlarge screen breakpoint

body {
  background: #2d2d2d;
  font-family: Chaparral Pro;
}

h1.intro {
  margin-top: 100px;
  margin-bottom: 0;
  font-weight: 200;
  @include font-size(26);
  line-height: 1.3;
  font-style: italic;
  color: white;
  text-align: center;

  @media all and (min-width: $mq3/$base+em) {
    @include font-size(30);
  }

  em {
    font-style: normal;
    font-weight: 700;
    display: block;
    @include font-size(28);
    margin-bottom: 15px;
    color: white;

    @media all and (min-width: $mq3/$base+em) {
      @include font-size(40);
    }

    .change-text {
      width: 130px;
      height: 28px;
      display: inline-block;
      position: relative;
      border-bottom: 1px solid rgba(255,255,255,.6);
      margin-bottom: -8px;

      @media all and (min-width: $mq1/$base+em) {
        height: 26px;
        width: 127px;
        margin-bottom: -6px;
      }

      @media all and (min-width: $mq2/$base+em) {
        height: 28px;
        width: 127px;
        margin-bottom: -6px;
      }

      @media all and (min-width: $mq3/$base+em) {
        width: 190px;
        height: 34px;
        margin-bottom: -6px;
      }

      &:before {
        content: '';
        background: white;
        position: absolute;
        right: -20px;
        bottom: -1px;
        height: 41px;
        width: 20px;
        display: none;
      }


      span {
        @include transition(all, .4s);
        text-align: left;
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0;
        line-height: 1;
        clip: rect(0px, 0px, 198px, 0px);

        &:after {
          content: '';
          background: white;
          position: absolute;
          right: -40px;
          bottom: -1px;
          height: 41px;
          width: 10px;
          display: none;
        }
      }

      span.active {
        @include transition(all, .85s);
        opacity: 1;
        clip: rect(0, 198px, 198px, 0px);
      }
    }
  }
}
            
          
!
            
              // text rotator
textRotator = function(element) {
  var words = $(element),
    total = words.length - 1,
    position = 0,
    current = null,
    timer = null;
  $(element).first().addClass('active');
  var autoSlide = function() {
    words.removeClass('active');
    if (position === total) {
      position = 0;
    } else {
      position = position + 1;
    }
    //console.log(position);
    words.eq(position).addClass('active');
  };
  timer = setInterval(autoSlide, 3000);
};
$(document).ready(function() {
  textRotator('.change-text span');
});
            
          
!
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