Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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">
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440.81 14707.15">
		<defs>
			<style>.cls-1 {
					opacity: 0.11;
        fill:#36C3F2;
				}

				.cls-2 {
          fill:#59C1A7;
					opacity: 0.15;
				}

				.cls-3 {
          fill:#6A266D;
					opacity: 0.15;
				}

				.cls-4 {
          fill:#EF3D55;
					opacity: 0.1;
				}</style>
		</defs>
		<g id="Layer_2">
			<g id="Layer_1-2" >
				<polygon class="cls-1" points="246.28 0 910.97 0 1440 529.04 1440 1193.72 246.28 0"/>
				<polygon class="cls-2" points="1440 778.43 1440.81 1442.3 0 2883.11 0 2218.43 1440 778.43"/>
				<polygon class="cls-3" points="1440 3907.52 1440 4572.2 0 3132.2 0 2467.52 1440 3907.52"/>
				<polygon class="cls-4" points="1440 4156.91 1440.81 4820.79 0 6261.6 0 5596.91 1440 4156.91"/>
				<polygon class="cls-1" points="1440 7286.01 1440 7950.69 0 6510.69 0 5846.01 1440 7286.01"/>
				<polygon class="cls-3" points="1440 10663.99 1440 11328.67 0 9888.67 0 9223.99 1440 10663.99"/>
				<polygon class="cls-4" points="1440 10913.38 1440.81 11577.25 0 13018.06 0 12353.38 1440 10913.38"/>
				<polygon class="cls-1" points="1440 14042.47 1440 14707.15 0 13267.15 0 12602.47 1440 14042.47"/>
				<polygon class="cls-2" points="1440 7535.4 1440.81 8199.27 0 9640.08 0 8975.4 1440 7535.4"/>
			</g>
		</g>
	</svg>
</div>	
<div class="body">
  
</div>



              
            
!

CSS

              
                body{
  margin: 0;
}

.body{
  height: 3000px;
  
}

.container{
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0;
  right:0;
  z-index: -1;
  filter: blur(72px);
  transform: scale(1.2);
  opacity: .5
 
    
}
              
            
!

JS

              
                console.clear();
/**
Features:
 - Scroll Easing
 - changes timeline progression on scroll
 - Slowly progresses in the timeline
 - YoYo's at the end of timelime, reverses and heads to start
 - Probably the most reliable version
 
 Cons:
 - Not a seamless infinite scroll
 
*/

$(function() {
  var $window = $(window);
  var scrollTop = $window.scrollTop();
  const diagonalGroup = $("#Layer_1-2");
  const container = $('.container');
  var lastScrollTop = 0;
  var scrollDir;
  var timeline = null;
  var proxyTween = null;
  
  TweenLite
    .to(container, 2, { 'filter': 'none', scale : 1, opacity : 1 });
  
  var timeline = new TimelineMax({ paused: true }).to(diagonalGroup, 1, {
    yPercent: -95,
    yoyo : true,
    ease: Linear.easeNone
  });

  var proxyTween = TweenLite.to({}, 1500, { repeat : -1});

  //TweenLite.defaultEase = Linear.easeNone;

  $window.on("scroll", function() {
    var scrollDiff;
    var scrollVal = .00001;
    //get document height
    var documentHeight = $(document).height();
    //get window height
    var windowHeight = $window.height();
    //get distance of window scrollbar
    scrollTop = $(window).scrollTop();

    //var scrollPercent = Math.max( scrollTop / (documentHeight - windowHeight), 0 );

    scrollDir = scrollTop < lastScrollTop;
    // get difference to use as new progress
    scrollDiff = (scrollTop - lastScrollTop) / (documentHeight - windowHeight); // use this to tie scrolling to scroll progress of the window
    //scrollDiff = (scrollDir) ? -1 * scrollVal : scrollVal;
    scrollDiff = (scrollTop - lastScrollTop) * scrollVal;
    
    // make sure new progress is between 0 and 1 to avoid jumps
    var newProgress = Math.min(Math.max(0, proxyTween.progress() + scrollDiff), 1);
    
    proxyTween.progress(newProgress);
    
    if (scrollDir) {
      proxyTween.reverse();
    } else {
      proxyTween.play();
    }

    lastScrollTop = scrollTop;
  });

  TweenLite.ticker.addEventListener("tick", function() {
    var progress = timeline.progress();
    // ease can be anything from 0.5 to 0.01
    // Change ease to tweak effect
    progress += (proxyTween.progress() - progress) * 0.07;
    timeline.progress(progress);
  });
  
});

              
            
!
999px

Console