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

              
                <section class="slide top-xs middle-sm">
  <h1 class="rellax">
    <div class="toBeCloned toTop" data-split="letters"><div class="original">JACK MAGMA</div></div><br />
    <div class="toBeCloned toBottom" data-split="letters"><div class="original">CREATIVE AGENCY</div></div>
  </h1>
</section>

              
            
!

CSS

              
                html, body {
  margin: 0;
  padding: 0;
}

/*#pinContainer {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}
*/
[class*="col-"] {
  padding: 0
}
section {
  height: 100vh;
  width: 100vw;
  position: relative;
  justify-content: center;
}
section + section {
  z-index: -10
}
.slide {
  text-align: center;
  display: flex;
  position: relative;
  
  background: #3C3C3B;
  color: #EE4D40;
}

h1 {
  user-select: none;
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2vw;
  /*  margin-bottom: 6em;
  margin-top: 3em;*/
  text-align-last: center;
  text-align: center;
  @media (max-width:768px) {
    font-size: 5vw;
    margin-top: 10em;
    margin-bottom: 5em;
  }
  
  > div:first-child {
    font-size: 200%
  }
}
.original {
  position: relative;
}
.alpha {
  bottom: 0;
  position: absolute;
  user-select: none;
  pointer-events: none;
  left: 0;
}

@for $i from 1 through 10 {
  .toTop {
    .alpha_#{$i} {
      transform: translateY( round(percentage(-$i/10*8)) )
    }    
  }
  
  .toBottom { 
    .alpha_#{$i} {
      transform: translateY( round(percentage($i/10*8)) )
    }
  }
}

.alpha_1 {opacity:0.8}
.alpha_2 {opacity:0.6}
.alpha_3 {opacity:0.4}
.alpha_4 {opacity:0.3}
.alpha_5 {opacity:0.2}
.alpha_6 {opacity:0.1}

.alpha_7 {opacity:0.4}
.alpha_8 {opacity:0.3}
.alpha_9 {opacity:0.2}
.alpha_10 {opacity:0.1}


.toBeCloned {
  position: relative;
  display: inline-block;
  .original {
  }
}


#mc_embed_signup {
  .mc-field-group {
    position: relative;
    label {
      display: none;
      user-select: none;
      pointer-events: none;
      padding-bottom: 1em;
    }
    input {
      display: block;
      border: 0;
      font-size: 16px;
      padding: 0.5em;
      border-bottom: 2px solid #00FF9D;
      -webkit-box-shadow: none;
      box-shadow: none;
      background: none;
      
      &:focus {
        outline: 0;
      }
    }
  }
  
  .button {
    
  }
}
              
            
!

JS

              
                function genRand(min, max, decimalPlaces) {  
    var rand = Math.random()*(max-min) + min;
    var power = Math.pow(10, decimalPlaces);
    return Math.floor(rand*power) / power;
}

$(function () {
  
  var timeout;
  var force = 0.01;
  var scrollDir = 0;
  var scrollPos = 0;
  
  var master = new TimelineLite();
  var tlArray = [];

  var controller = new ScrollMagic.Controller();

  // Listen for resize events
  window.addEventListener('scroll', function ( event ) {
    force += 0.31 ;
  }, false);
  
  function animate() {
				requestAnimationFrame( animate );
    
        if ((document.body.getBoundingClientRect()).top > scrollPos)
          scrollDir = -1;
        else
          scrollDir = 1;
        // saves the new position for iteration.
        scrollPos = (document.body.getBoundingClientRect()).top;
    
    
        force *= 0.95;
   
    $('.alpha').each(function(){
      //console.log( $(this).eq() )
      var variation = force * genRand(1, 2, 2)/10 * force;
      $(this).css('padding',force+'px 0')
    })

  }
  animate();

  $('section').each(function(){
    var _this = $(this);
    var _thisH1 = _this.find('h1');
    console.log(_this,_thisH1)
    var percentage = _this.data("percentage");
   

    var wipeAnimation = new TimelineMax();
    
    wipeAnimation.fromTo( _thisH1 , 1,{
      y: -150,
      //skewY: -12
    },{
      y: 0,
      skewY: 0
    });
    
    
    new ScrollMagic.Scene({
      triggerElement: this,
      duration: "50%",
      triggerHook: 'onCenter',
      offset: '-80%'
    })
    .setTween(wipeAnimation)
    .addTo(controller);
  });
  $('.toBeCloned').each(function() {
    var _this = $(this);
    var cloned = _this.find('.original');
    
    var spliType = _this.attr('data-split');
    
    
    var list = [];
    
    
    cloned.lettering(spliType);
    if (spliType == 'words' || spliType == null) {
      split = 'word'
    } else if (spliType == 'letters') {
      split = 'char'
    }


    var childrenAll = cloned.find('span[class*="'+split+'"]:not("alpha")');

    for(var i = 0; i < childrenAll.length; i++){
        var el = cloned.find('span[class*="'+split+'"]:eq('+i+')');
        el.addClass('original');
        var elText = el.text();
        //console.log('EL',el);
        
        var SplitChildren = [];

        for(var p = 0; p < 4; p++){
          //console.log(p,el.text())
          
          var elClone = $('<b>'+elText+'</b>');
          elClone.addClass('alpha alpha_'+(p+1)).appendTo(el);
          
          //var elClone = el.clone().removeClass('char'+(i+1)).addClass('alpha alpha_'+(p+1));
          //console.log(elClone)
          //el.append(elText)
          //elClone.appendTo(el);
          SplitChildren.push(elClone);
          
        }
        
        //console.log(SplitChildren);
        
        var SplitChildren2 = SplitChildren.slice(0, 1);
        var SplitChildren3 = SplitChildren.slice(0, 2);
        var SplitChildren4 = SplitChildren.slice(0, 6);
                
        var duration = genRand(0.6, 2, 2)/60;
        console.log(duration)
        var stagger = 0.05;
        var tl = new TimelineMax({
          delay: 0.5,
          repeat: -1,
          repeatDelay: 0,
          ease: Power4.easeOut,
        });
        tl.set(SplitChildren,{visibility:'hidden'});
        
        tl.staggerTo(SplitChildren, duration, {
          visibility: 'visible',
          ease: Power4.easeOut,
          paddingTop : force+'px'
        }, stagger)
        tl.staggerTo(SplitChildren, duration*genRand(0.1, 2, 2), {
          visibility: 'hidden',
          ease: Power4.easeOut,
        }, -stagger)
        tl.staggerTo(SplitChildren2, duration, {
          visibility: 'visible',
          ease: Power4.easeOut,
        }, stagger)
        tl.staggerTo(SplitChildren2, duration*genRand(0.1, 2, 2), {
          visibility: 'hidden',
          ease: Power4.easeOut,
        }, -stagger)
        tl.staggerTo(SplitChildren3, duration, {
          visibility: 'visible',
          ease: Power4.easeOut,
        }, stagger)
        tl.staggerTo(SplitChildren3, duration*genRand(0.1, 2, 2), {
          visibility: 'hidden',
          ease: Power4.easeOut,
        }, -stagger)
        tl.staggerTo(SplitChildren4, duration, {
          visibility: 'visible',
          ease: Power4.easeOut,
        }, stagger)
        tl.staggerTo(SplitChildren4, duration*genRand(0.1, 2, 2), {
          visibility: 'hidden',
          ease: Power4.easeOut,
        }, -stagger)
        
        tlArray.push(tl);
      

      }

    
    
  });
  
});


              
            
!
999px

Console