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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console