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.

            
              <section id="timeline">
	<div class="section-wrapper">
		<div id="timeline-slider-wrapper">
			<div class="dot"></div>
			<div data-labelbottom="2017" data-labeltop="Open store" class="year dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<div data-labelbottom="2018" data-labeltop="Hire first staff" class="year dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<div data-labelbottom="2019" data-labeltop="Expand product offerings" class="year dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<div data-labelbottom="2020" data-labeltop="Open second store" class="year dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<div class="dot"></div>
			<input id="slider" type="range" min="1" max="17" value="2" />
		</div>
	</div>
</section>
<section id="description">
	<div class="section-wrapper">
		<h3>GOALS AND OBJECTIVES</h3>
		<div>
			<p>Year 2016, Quarter 4</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur, alias. Magni harum, earum fugit, officia eveniet minima, expedita accusantium, esse aspernatur omnis neque. Soluta, consequatur adipisci non molestiae omnis odit.</p>
		</div>
		<div class="text-default">
			<p>Year 2017, Quarter 1</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae, consequuntur.</p>
		</div>
		<div>
			<p>Year 2017, Quarter 2</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Officiis assumenda ipsa maiores sunt fugiat deserunt pariatur est incidunt, enim quis.</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Delectus facere necessitatibus illum debitis minus amet recusandae optio fugit tempora veritatis.</p>
		</div>
		<div>
			<p>Year 2017, Quarter 3</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et, nihil. Ea nesciunt sed, quidem sapiente dolorem voluptatum, adipisci recusandae ducimus amet sequi atque ipsa officiis pariatur consectetur velit alias. Officiis, at illo aperiam ex accusamus, vel ab obcaecati doloribus numquam fugiat unde, error. Atque iusto nulla porro, ducimus ex vel.</p>
		</div>
		<div>
			<p>Year 2017, Quarter 4</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Libero laudantium repudiandae quos magni iste cum, a quisquam eligendi quasi, at animi autem necessitatibus, cumque rem optio maiores. Placeat inventore repellat voluptate reprehenderit adipisci aperiam tempore?</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Optio, aut illum repellat, itaque ducimus eius.</p>
		</div>
		<div>
			<p>Year 2018, Quarter 1</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod, vel atque molestiae dolorum soluta magni, dolores a maxime iure illo.</p>
		</div>
		<div>
			<p>Year 2018, Quarter 2</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dicta non quam quae consectetur laborum eveniet, similique placeat illo velit enim eligendi facilis deleniti laboriosam iure natus totam! Nostrum ipsa debitis iste eum laborum odio, aliquam dolor fuga hic unde.</p>
		</div>
		<div>
			<p>Year 2018, Quarter 3</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet, eveniet?</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto officia, quam iste tempore eos, vel quis nulla, aliquid pariatur deleniti libero nesciunt dicta minus reiciendis.</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex dolor, atque repellat nulla doloribus nostrum.</p>
		</div>
		<div>
			<p>Year 2018, Quarter 4</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptates similique expedita cumque alias facilis commodi vitae recusandae, quisquam officia officiis autem distinctio quis consequuntur velit deleniti iusto illo accusantium earum, delectus blanditiis minima. Enim fugit totam, esse cumque consequatur dignissimos.</p>
		</div>
		<div>
			<p>Year 2019, Quarter 1</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad, laboriosam!</p>
		</div>
		<div>
			<p>Year 2019, Quarter 2</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sed odio iste harum quia facilis, omnis autem non, corporis ullam perspiciatis earum voluptas facere accusantium itaque asperiores, illo debitis ducimus. Facere nobis ipsam beatae voluptatum nisi possimus aliquam eum excepturi, quisquam odit, alias dolores enim, soluta nulla. Ratione quam architecto dolore.</p>
		</div>
		<div>
			<p>Year 2019, Quarter 3</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Est consequuntur unde laborum officiis minus, impedit voluptates. Fugiat perspiciatis nesciunt itaque!</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt doloribus eaque id in cumque aliquam voluptatem, officia unde assumenda corrupti!</p>
		</div>
		<div>
			<p>Year 2019, Quarter 4</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae officia quas aut autem a quibusdam quam voluptas, optio iure recusandae eum, similique voluptate excepturi nobis suscipit, laboriosam laborum veniam mollitia!</p>
		</div>
		<div>
			<p>Year 2020, Quarter 1</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minus quod adipisci dolores, consectetur aperiam aliquam.</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum ipsum vitae, consequuntur quidem, quasi quaerat.</p>
		</div>
		<div>
			<p>Year 2020, Quarter 2</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem, perferendis facilis neque vero nostrum asperiores aperiam tenetur debitis sunt labore magnam ipsum nesciunt quo inventore explicabo hic at. Sed minus optio est illum, placeat, corporis necessitatibus fuga aperiam et officia, nobis nihil quas! Quasi temporibus corrupti consectetur, id natus nobis commodi quis. Inventore voluptate porro, excepturi dicta quasi consequuntur beatae.</p>
		</div>
		<div>
			<p>Year 2020, Quarter 3</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci, veritatis.</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis ratione consequatur fugiat vero, dolor modi qui, libero rem repellat accusantium.</p>
		</div>
		<div>
			<p>Year 2020, Quarter 4</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non quam aliquam aperiam consectetur sequi libero laborum.</p>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
		</div>
	</div>
</section>

<div style="background-color: #FBFCFC; width: 275px; height: 40px; padding: 10px; box-sizing: border-box; position: absolute; bottom: 5px; right: 5px; font-size: 0.9em;"><a href="https://codepen.io/cjl750/pen/XMyRoB" target="_blank">Alternate clickable, responsive version</a></div>
<div style="background-color: #FBFCFC; width: 275px; height: 55px; padding: 10px; box-sizing: border-box; position: absolute; bottom: 50px; right: 5px; font-size: 0.9em; line-height: 1.25"><a href="https://codepen.io/cjl750/pen/XMyRoB" target="_blank">Version 3: clickable, responsive, simplified code</a></div>
            
          
!
            
              $zero: #FBFCFC
// $one: #FFC107
$two: #34495E
$three: #F1C40F
$four: #C0392B

html
	background-color: $two
	font-family: 'Raleway'
	color: $zero
section
	width: 100%
	box-sizing: border-box
	min-height: 33vh
	.section-wrapper
		padding: 10px
		box-sizing: border-box
		height: 100%
#timeline
	padding-top: 50px
	padding-bottom: 50px
	background-color: $three
	color: $two
#timeline-slider-wrapper
	position: relative
	top: 11vh
	left: 5%
	height: 3px
	background-color: $zero
	width: 90%
	=circle
		background-color: $zero
		border-radius: 50%
		float: left
		position: relative
		left: 5.3% // (line width / # of dots)
		top: -6px
		box-sizing: border-box
		width: 14px
		height: 14px
		// MARGINS
		// (((line width ÷ # of dots) ÷ 2) - (dot width ÷ 2))
		// = (((0.9 ÷ 17) ÷ 2) - (14 ÷ 2))
		// = (2.65% - 7px)
		// 2.65% fudged slightly to 2.725% to make up for fact that range input thumb
		// is not centered over beginning/end of line in initial and final position,
		// but rather is left- or right-aligned
		margin-right: calc(2.725% - 7px)
		margin-left: calc(2.725% - 7px)
	.dot
		+circle
		&:first-child
			margin-left: calc(1.3625% - 7px)
		&:nth-child(17)
			margin-right: calc(1.3625% - 7px)
	.year
		&::before
			content: attr(data-labeltop)
			position: absolute
			top: -75px
			left: -15px
			width: 140px
			transform: rotateZ(-45deg)
			display: block
			font-size: 0.8em
			font-weight: bold
		&::after
			content: attr(data-labelbottom)
			position: absolute
			top: 23px
			left: -20px
			padding: 10px
#slider
	margin-top: 0
	margin-bottom: 50px
	width: 90%
	position: relative
	z-index: 1
	top: -26px
	left: 5%
#description
	min-height: 30vh
	background-color: $two
	h3
		color: $four
		font-weight: 600
	.section-wrapper > div
		display: none
		&.text-default
			display: block

/* RANGE INPUT
 * https://css-tricks.com/styling-cross-browser-
 * compatible-range-inputs-css/
 * /

// basic styles for cross-browser range input
input[type="range"]::-webkit-slider-thumb
	-webkit-appearance: none
input[type="range"]
	-webkit-appearance: none
	background: transparent
	width: 100%
input[type="range"]:focus
	outline: none
input[type="range"]::-ms-track
	width: 100%
	cursor: pointer
	background: transparent
	border-color: transparent
	color: transparent

// styles for our specific range input

// the circle you click and drag
=timeline-slider-thumb
	height: 25px
	width: 25px
	border-radius: 50%
	background: $two
	border: 2px solid $zero
	cursor: pointer

input[type="range"]::-webkit-slider-thumb
	+timeline-slider-thumb
	margin-top: -13px
input[type="range"]::-moz-range-thumb
	+timeline-slider-thumb
input[type="range"]::-ms-thumb
	+timeline-slider-thumb

// the track the circle sits on
=timeline-slider-track
	width: 100%
	cursor: pointer
	height: 2px
	background: $zero

input[type="range"]::-webkit-slider-runnable-track
	+timeline-slider-track
input[type="range"]::-moz-range-track
	+timeline-slider-track
input[type="range"]::-ms-track
	+timeline-slider-track
            
          
!
            
              $(function(){
	
	$('#slider').on('change', function(){
			var currentDesc = $('#description').find('.section-wrapper > div').filter(':visible');
			var matchedDesc = $('#description').find('.section-wrapper > div').filter(':nth-child(' + (Number($('#slider').val()) + 1 ) + ')');

			$(currentDesc).hide();
			$(matchedDesc).fadeIn();
	});
	
});
            
          
!
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