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.

            
              
<div id="hero">
  <div class="wrapper">
    <h1>Hero</h1>
  </div>
</div>

<div id="scroll">
  <span class="arrow-bounce">&#8595;</span>
</div>

<div class="wrapper">
<section id="one">
  <h2>Section One</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
</section>

<section id="two">
  <h2>Section Two</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
</section>

<section id="three">
  <h2>Section Three</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
</section>

<section id="four">
  <h2>Section Four</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus non nostrum ut aut ab dolorem, dolorum voluptas expedita dolor maxime adipisci, fugit est error similique, ducimus! Aut debitis at omnis.</p>
</section>

<footer></footer>
</div> <!-- end .wrapper -->
            
          
!
            
              @import "bourbon";

html, body { 
  font-family: sans-serif;
  padding: 0;
  margin: 0;
}

h1, h2 { 
text-align: center;
}

$padding: 35px;

.wrapper {
  max-width: 600px;
  margin: 0 auto;
}

#hero {
  text-align: center;
  min-height: 100px;
  background: rgba(0, 0, 0, 0.1);
  margin-bottom: $padding;
}

#hero, section {
  padding: $padding;
}

#scroll {
  text-align: center;
	width: 50px;
	height: 50px;
	background: rgba(0,0,0,1);
	border-radius: 50%;
	margin: 0 auto;
  margin-top: -55px;
  // offset margin to absolutely center
  margin-right: -25px;
	color: white;
	padding-top: 0px;
	font-size: 26px;
  line-height: 26px;
	cursor: pointer;
	position: absolute;
	right: 50%;
	@include transition(transform 0.6s ease);


	&.clicked {
		-webkit-transform: rotate(360deg); 
		-moz-transform: rotate(360deg); 
		-o-transform: rotate(360deg);
		-ms-transform: rotate(360deg); 
	}

	&.rotate {
		-webkit-transform: rotate(180deg); 
		-moz-transform: rotate(180deg); 
		-o-transform: rotate(180deg);
		-ms-transform: rotate(3180deg); 
	}

	span {
		position: relative;
		bottom: -10px;
	}
}

.arrow-bounce{
	-webkit-animation:   arrow 1s infinite;
	-moz-animation:     arrow 1s infinite;
	-o-animation:       arrow 1s infinite;
	animation:          arrow 1s infinite;
	animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
}

@include keyframes(arrow) {
  0% { bottom: -13px; }
  50% { bottom: -8px; }
  100% { bottom: -13px; }
}


            
          
!
            
              function smoothScroll(target, time) {
	var margin = ($('#main-header').outerHeight() - 1);
	if (!time) { time = '1000'; }

	if (target === 'toTop') {
		$('html,body').animate({
			scrollTop: 0
		}, time);
	}
	else {
		$('html,body').animate({
			scrollTop: target.offset().top - margin
		}, time);
	}
}

// SCROLL DOWN ARROR BUTTON

	var count = 0;

	$('#scroll').on("click", function(){

		var sections = $('section');

    //+55px to offset the margin-top
		var $this = $(this),
			top = ($this.offset().top - $(window).scrollTop()) + 55,
			right = $this.offset().right;


		$this.css({
			position: 'fixed',
			top: top,
			right: right
		})
		.animate({
			right: '5%',
			top: '90%'
		}, 600)
		.addClass('clicked');

		var target;

		// END OF ARRAY HAS ALEADY BEEN REACHED
		if (count > (sections.length -1) ) { 
			count = -1;
			
			smoothScroll('toTop');
			$this.removeClass('rotate');
		}
		// JUST REACHED END OF ARRAY
		else { 
			target = $(sections[count]);
			if (count === (sections.length -1)) {
				$this.addClass('rotate');
			}
			smoothScroll(target);
		}
	
		count++;

		$(this).find('.arrow-bounce').removeClass('arrow-bounce');

	});
            
          
!
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