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

              
                <h1>Liverpool vs Manchester City <span></span></h1>
<div class="flex-parent">
	<div class="input-flex-container">
		<div class="input">
			<span data-year="Nov 2015" data-info="Liverpool Wins"></span>
		</div>
		<div class="input">
			<span data-year="Feb 2016" data-info="Draw"></span>
		</div>
		<div class="input active">
			<span data-year="Mar 2016" data-info="Liverpool Wins"></span>
		</div>
		<div class="input">
			<span data-year="Dec 2016" data-info="Liverpool Wins"></span>
		</div>
		<div class="input">
			<span data-year="Mar 2017" data-info="Draw"></span>
		</div>
		<div class="input">
			<span data-year="Sep 2017" data-info="Manchester City Wins"></span>
		</div>

	</div>
	<div class="description-flex-container">
		<p>Liverpool Win 4-1</p>
		<p>Match Drawn 1-1</p>
		<p class="active">Liverpool Win 3-0</p>
		<p>Liverpool Win 1-0</p>
		<p>Match Drawn 1-1</p>
		<p>Manchester City Win 5-0</p>
		
</div>

<div style="position: absolute; bottom: 40px; right: 10px; font-size: 12px">
	<a href="https://codepen.io/cjl750/pen/XMyRoB" target="_blank"></a></div>
<div style="position: absolute; bottom: 15px; right: 10px; font-size: 12px">
	<a href="https://codepen.io/cjl750/pen/wdVxzV" target="_blank"></a></div>
              
            
!

CSS

              
                $numDots: 7
$parentWidthBase: 0.6
$parentWidth: $parentWidthBase * 100vw
$parentMaxWidth: 600px
$dotWidth: 25px
$dotWidthSm: 17px
$active: #2C3E50
$inactive: #AEB6BF


html, body
	height: 100%
body
	font-family: 'Quicksand', sans-serif
	font-weight: 700
	color: #F00
	background-color: #F
	padding: 0 25px
	display: flex
	flex-direction: column
	position: relative
h1
	text-align: center
	height: 38px
	margin: 60px 0
	span
		white-space: nowrap
.flex-parent
	display: flex
	flex-direction: column
	justify-content: center
	align-items: center
	width: 100%
	height: 100%
.input-flex-container
	display: flex
	justify-content: space-around
	align-items: center
	width: $parentWidth
	height: 100px
	max-width: $parentMaxWidth
	position: relative
	z-index: 0
.input
	width: $dotWidth
	height: $dotWidth
	background-color: $active
	position: relative
	border-radius: 50%
	&:hover
		cursor: pointer
	&::before, &::after
		content: ''
		display: block
		position: absolute
		z-index: -1
		top: 50%
		transform: translateY(-50%)
		background-color: $active
		width: $parentWidth / $numDots
		height: 5px
		max-width: $parentMaxWidth / $numDots
	&::before
		left: calc(#{-$parentWidth / $numDots} + #{$dotWidth / 2})
	&::after
		right: calc(#{-$parentWidth / $numDots} + #{$dotWidth / 2})
	&.active
		background-color: $active
		&::before
			background-color: $active
		&::after
			background-color: $inactive
		span
			font-weight: 700
			&::before
				font-size: 13px
			&::after
				font-size: 15px
	&.active ~ .input
		&, &::before, &::after
			background-color: $inactive
	span
		width: 1px
		height: 1px
		position: absolute
		top: 50%
		left: 50%
		transform: translate(-50%, -50%)
		visibility: hidden
		&::before, &::after
			visibility: visible
			position: absolute
			left: 50%
		&::after
			content: attr(data-year)
			top: 25px
			transform: translateX(-50%)
			font-size: 14px
		&::before
			content: attr(data-info)
			top: -65px
			width: 70px
			transform: translateX(-5px) rotateZ(-45deg)
			font-size: 12px
			text-indent: -10px
.description-flex-container
	width: $parentWidth
	font-weight: 400
	font-size: 22px
	margin-top: 100px
	p
		margin-top: 0
		display: none
		&.active
			display: block
		
	
@media (min-width: $parentMaxWidth / $parentWidthBase)
	.input::before
		left: #{-($parentMaxWidth / $numDots) + ($dotWidth / 2)}
	.input::after
		right: #{-($parentMaxWidth / $numDots) + ($dotWidth / 2)}
@media (max-width: 850px)
	.input
		width: $dotWidthSm
		height: $dotWidthSm
		&::before, &::after
			height: 3px
		&::before
			left: calc(#{-$parentWidth / $numDots} + #{$dotWidthSm / 2})
		&::after
			right: calc(#{-$parentWidth / $numDots} + #{$dotWidthSm / 2})


//MOBILE
@media (max-width: 600px)
	.flex-parent
		justify-content: initial
	.input-flex-container
		flex-wrap: wrap
		justify-content: center
		width: 100%
		height: auto
		margin-top: 15vh
	.input
		width: 60px
		height: 60px
		margin: 0 10px 50px
		background-color: $inactive
		&::before, &::after
			content: none
		span
			width: 100%
			height: 100%
			display: block
			&::before
				top: calc(100% + 5px)
				transform: translateX(-50%)
				text-indent: 0
				text-align: center
			&::after
				top: 50%
				transform: translate(-50%, -50%)
				color: #ECF0F1
	.description-flex-container
		margin-top: 30px
		text-align: center

@media (max-width: 400px)
	body
		min-height: 950px //just so our links won't get in the way of our content
              
            
!

JS

              
                $(function(){
	var inputs = $('.input');
	var paras = $('.description-flex-container').find('p');
	$(inputs).click(function(){
		var t = $(this),
				ind = t.index(),
				matchedPara = $(paras).eq(ind);
		
		$(t).add(matchedPara).addClass('active');
		$(inputs).not(t).add($(paras).not(matchedPara)).removeClass('active');
	});
});
              
            
!
999px

Console