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

              
                <!-- The header.  The progress bar will sit under this. -->
<div class="fixed header">
	<h1>Random.  Awesome.  Stuff.</h1>
</div>

<!-- 
        The progress bar 
            - Value is 0 so it doesn't have any size to start with
            - Max is set to 1 in case of an older browser that doesn't support progress bars.
        -->
<progress value="0" max="1">
            <!-- Older browsers look to the old div style of progress bars -->
            <!-- Newer browsers ignore this stuff but it allows older browsers to 
                    still have a progress bar. -->
            <div class="progress-container">
                <span class="progress-bar"></span>    
            </div>
        </progress>


<!-- Space filling stuff -->
<!-- A scroll indicator doesn't show up if there isn't enough 
                content to scroll through, duh -->

<div class="article-content">
	<h1>Space filling article</h1>

	<p>Sometimes you just need to take up space. This is a great way to do so, as it looks sort of professional, and fills up quite a bit of space. The user can even read it if he/she wants to, and learn how to make their own space filling article of mass destruction.
		Or maybe not mass destruction, but I don't know.</p>

	<h3>Step 1: Asses Why This is Necessary</h3>

	<p>Why do you need a space filling article in the first place? Maybe it's because you are doing a tutorial or showcase about scroll bars, or scroll indicators, or thermonuclear war - who knows, you might need it. If you decide that a space filling article
		is the thing for you, then so is this article/tutorial/teaching thingy.</p>

	<h3>Step 2: Come up with a topic</h3>

	<div class="quote-container">
		<p class="quote-text">A topic's a topic no matter how random.</p>
		<p class="quote-author">Dr. Moose*</p>
	</div>

	<p>Coming up with a topic is not that hard. In fact, this article about space filling articles is actually a space filling article itself! I came up with this topic so that I could test a scroll position indicator. I didn't actually do this to provide the
		world with quality, useful information. I know, shame on me, but it works. I get to test my scroll position thingymajig without the style of the standard 'Lorem ipsum' space fillers. By the way, if anyone knows what language that is, tell me.  I think it is Latin. Now, hopping off that tangent, I will proceed to talk more about random topic choosing just so that I can fill up my page. Just choose the first thing that comes into your head and write an article about it. Don't worry, feel free to go off on
		tangents, talk about other random things, or even just type one word per line; <strong>no one cares</strong>. This is your space filling article and sould be of no concern to anyone other than yourself.  If anyone decides to berate you about it for any reason, do what you need to do to make them stop**.</p>
	<p>--</p>
	<p>*The 'Dr. Moose' in question is a figment of my imagination and is not referenced to a certain person in any way, shape, or form.</p>
	<p>**I assume no responsibility for any conflict and/or injuries that are caused by the statement in question.  Using physical force to solve problems is not the way to do things, we have been learning that since kindergarten.  Why the supposedly smartest people in the world, namely our leaders, use guns, bombs, missiles, tanks, and heavy artillery to solve problems is beyond me and is not to be compared to our situation.</p>
	
	<h3>Step 3: Write</h3>
	
	<p>Writing is always a good thing when trying to write an article.  It actually is impossible to <strong>write</strong> an article without actually <strong>writing</strong>.  I guess you could have someone write it for you; then <strong>you</strong> wouldn't technically be writing it, but because manual labor is a good character building device, I am going to ask that you please do this yourself.  You can not employ, ask, or even blackmail someone to do this for you, or by the official book of Space Filling Article Rules, it doesn't count.  Just kidding.  There's no such thing, so feel free to do whatever you like.<br> <strong>Disclaimer: Blackmailing is not reccomended.  I reccomend either the employ or ask options.</strong></p>
</div>
              
            
!

CSS

              
                * {
	margin: 0;
	padding: 0;
}

html,
body {
	font-family: "Avenir" sans-serif;
	background: #444;
}

.fixed {
	position: fixed;
}

.header {
	background-color: #BBB;
	width: 100%;
	height: 70px;
	z-index: 10;
}

.header > h1 {
	font-family: "Black Ops One" "Avenir Light" sans-serif;
	line-height: 70px;
	margin: 0 20px 0 20px;
}

::-webkit-scrollbar {
	display: none;
}

::-webkit-scrollbar-thumb {
	display: none;
}

progress {
	position: fixed;
	left: 0;
	top: 70px;
	width: 100%;
	height: 5px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	border: none;
	background-color: transparent;
	color: #D4AF37;
	z-index: 10;
}

progress::-webkit-progress-bar {
	background-color: transparent;
	z-index: 10;
}

progress::-webkit-progress-value {
	background-color: #D4AF37;
	z-index: 10;
}

progress::-moz-progress-bar {
	background-color: #D4AF37;
	z-index: 10;
}

.progress-container {
	width: 100%;
	background-color: transparent;
	position: fixed;
	top: 0;
	left: 0;
	height: 5px;
	display: block;
	z-index: 10;
}

.progress-bar {
	background-color: #D4AF37;
	width: 0%;
	display: block;
	height: inherit;
	z-index: 10;
}

.article-content {
	position: absolute;
	margin: 90px 2vw 20px 2vw;
	background: #777;
	width: 96vw;
	height: auto;
	box-shadow: 0 2px 10px 2px rgba(0, 0, 0, 0.2);
}

.article-content > h1 {
	font-family: "Poiret One" sans-serif;
	margin: 10px;
}

.article-content > h3 {
	font-family: "Poiret One" sans-serif;
	margin: 10px;
}

.article-content > p {
	font-family: "Coming Soon" sans-serif;
	margin: 10px;
}

.quote-container {
	margin: 20px;
	padding: 5px;
	background-color: #AAA;
	width: 300px;
	height: auto;
}

.quote-text {
	font-style: italic;
	color: #333;
}

.quote-author {
	font-style: none;
	color: #666;
	margin-left: 40px;
}

.quote-author:before {
	content: "- ";
}
              
            
!

JS

              
                $(document).ready(function() {

	var getMax = function() {
		return $(document).height() - $(window).height();
	}

	var getValue = function() {
		return $(window).scrollTop();
	}

	if ('max' in document.createElement('progress')) {
		var progressBar = $('progress');
		
		progressBar.attr({
			max: getMax()
		});

		$(document).on('scroll', function() {
			progressBar.attr({
				value: getValue()
			});
		});

		$(window).resize(function() {
			
			progressBar.attr({
				max: getMax(),
				value: getValue()
			});
		});

	} else {

		var progressBar = $('.progress-bar'),
			max = getMax(),
			value, width;

		var getWidth = function() {
			
			value = getValue();
			width = (value / max) * 100;
			width = width + '%';
			return width;
		}

		var setWidth = function() {
			progressBar.css({
				width: getWidth()
			});
		}

		$(document).on('scroll', setWidth);
		$(window).on('resize', function() {
			
			max = getMax();
			setWidth();
		});
	}
});
              
            
!
999px

Console