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 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

Packages

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.

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 class="container">
  <header class="header fixed">
    <svg class="mainSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" viewBox="0 0 2405.9028 40.500001">
			<g class="path-morph visible-xs-block">
				<path fill-rule="evenodd" fill="#fff" path-rendering="crispEdges"
					  d="m -0.5,0.45 0,24.294 c 0,0 174.54834,-30.3509978 406.70293,-9.7778 267.4612,23.702 295.64023,22.772 468.20362,20.473 142.58885,-1.8993 387.16995,-51.839 785.30165,-21.429 183.4051,14.008 273.3707,29.308 451.1067,26.909 178.3677,-2.4078 295.5881,-18.195 295.5881,-18.195 l 0,-22.7242 z"
				/>
				<path class="path-morph-2 hide" fill-rule="evenodd" fill="red" path-rendering="crispEdges"
					  d="m 0,0 c 533.33333,0 1066.6667,0 1600,0 -533.3333,-0.0253 -1066.66667,-0.0534 -1600,0 z"
				/>
			</g>
			<g class="path-morph hidden-xs">
				<path fill-rule="evenodd" fill="#fff" path-rendering="crispEdges"
					  d="m -0.5,0.66933823 0,24.07466177 c 0,0 174.54834,-30.3509978 406.70293,-9.7778 267.4612,23.702 295.64023,22.772 468.20362,20.473 142.58885,-1.8993 387.16995,-51.839 785.30165,-21.429 183.4051,14.008 273.3707,29.308 451.1067,26.909 178.3677,-2.4078 294.5879,-18.195 294.5879,-18.195 l 0,-22.05486177 z"
				/>
				<path class="path-morph-2 hide" fill-rule="evenodd" fill="#fff" path-rendering="crispEdges"
					  d="m -0.5,0.45 0,24.294 c 0,0 99.54834,-1.184331 327.53626,1.333311 268.493,2.964935 737.64804,3.806333 737.64804,3.806333 0,0 797.2934,6.850733 1341.7187,-7.159444 l 0,-22.7242 z"
				/>
			</g>
		</svg>
  </header>
  
  <div class="dummy">Dummy content</div>
  <div class="dummy">Dummy content</div>
  <div class="dummy" id="fixed-passed">Dummy passed content</div>
  <div class="dummy">Dummy content</div>
  <div class="dummy">Dummy content</div>
  <div class="dummy">Dummy content</div>
  <div class="dummy">Dummy content</div>
</div>

              
            
!

CSS

              
                body {
  background-color: blue;
}

body,
html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.hide {
    display: none !important;
}
@media (max-width: 767px) {
  .hidden-xs {
      display: none !important;
  }
}

.header {
    height: 98px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
}
.mainSVG {
	top: 98%;
	content: "";
	display: block;
	height: auto;
	left: -1%;
	position: absolute;
	width: 102%;
	z-index: 100;
}

.dummy {
  font-size: 6rem;
  line-height: 20rem;
  border-bottom: 3px dashed red;
  text-align:center
}
              
            
!

JS

              
                (function($) {

	var $win = $(window);
	var $doc = $(document);
  var $body = $('body');
  var passedPoint,
      $svgClouds;

  var fixedNavScoll = function() {
    if (!passedPoint) return;
    
    var winTop = $(window).scrollTop();
    
    if (!$body.hasClass('-passed') && winTop > passedPoint) {
      $body.addClass('-passed');
      $svgClouds.trigger('nav.sticky.passed.on');
    } else if ($body.hasClass('-passed') && winTop <= passedPoint) {
      $body.removeClass('-passed');
      $svgClouds.trigger('nav.sticky.passed.off');
    }
  }
  
	$doc.ready(function() {
    passedPoint = $('#fixed-passed').offset().top;
  
    $svgClouds = $('.mainSVG');
    
    $('.path-morph').each(function() {
			var $svgMorphe = $(this).find('path').eq(0);
			var $svgMorphe2 = $(this).find('.path-morph-2').eq(0);
			if (!$svgMorphe2.length) return false;

			var svgTween = TweenLite;

			$svgClouds.on('nav.sticky.passed.on', function() {
        console.log('nav.sticky.passed.on');
				svgTween.to($svgMorphe, .9, {'morphSVG':$svgMorphe2});
			});

			$svgClouds.on('nav.sticky.passed.off', function() {
        console.log('nav.sticky.passed.off');
				TweenLite.killTweensOf(svgTween);
				svgTween.to($svgMorphe, .3, {'morphSVG':$svgMorphe});
			});
		});
    
    fixedNavScoll();
  });
    
  var scrollTimer;
  $doc.scroll(function() {
    clearTimeout(scrollTimer);
    scrollTimer = setTimeout(function(){
      fixedNavScoll();
    }, 10);
  });
    
	$win.load(fixedNavScoll);
  
})(jQuery);
              
            
!
999px

Console