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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                -var elSet = 5
.bar
	-for(var n = 0; n < elSet; n++)
		input.bar-input(
			type="radio"
			name="input"
			id="input_" + n
		)
		.bar-view
			label.bar-button(
				for="input_" + n
			)
			
.command click on any one of the options
              
            
!

CSS

              
                $elSet: 5
$elCount: $elSet * 2
$orange: #FE9000
$orange-light: #FFB732
$yellow: #FFDD4A
$blue-light: #5ADBFF
$blue: #3C6997
$bounce: cubic-bezier(0, 0, 0, 1.97)
$smooth: cubic-bezier(0, 0.72, 0.58, 1)

.bar
	display: flex
	flex-direction: row-reverse
	margin: auto auto 0
	width: 300px
	max-width: calc(100% - 30px)

	&-input
		opacity: 0
		pointer-events: none
		position: absolute
		top: -9999px
		left: -9999px
	
		&:checked
			~ .bar-view
					@for $n from 1 through $elCount
						$r: $elCount - $n + 1
						@if $r % 2 == 0
							&:nth-child(#{$r})
								&:after
									transition-delay: 0.1s * ($n / 2 - 1)
								.bar-button:before
									transition-delay: 0.1s * ($n / 2 - 1) + 0.06s
								
					&:after
						transform: scaleX(1)
					.bar-button:before
						transform: none
						opacity: 1
			
			+ .bar-view
					.bar-button:after
						opacity: 1
						animation: bouncing 0.6s cubic-bezier(0, 0, 0.74, 1.04) infinite
	
	&-view
		display: flex
		flex-grow: 1
		position: relative
	
		&:after
			height: 2px
			top: calc(50% - 1px)
			transition: transform 0.06s $smooth
			transform: scaleX(0)
			background: $orange-light
			transform-origin: left
			z-index: 1
	
		&:not(:last-child)
			&:before,
			&:after
				content: ''
				width: calc(100% - 24px)
				position: absolute
				right: calc(50% + 12px)

			&:before
				height: 6px
				top: calc(50% - 3px)
				background: $blue
	
			@for $n from 1 through $elCount
				@if $n % 2 == 0
					&:nth-child(#{$n})
						&:after
							transition-delay: 0.1s * ($n / 2 - 1)
						.bar-button:before
							transition-delay: 0.1s * ($n / 2 - 1) + 0.06s
	
	&-button
		display: block
		width: 30px
		height: 30px
		margin: auto
		border-radius: 50%
		border: 3px solid $blue
		position: relative
		cursor: pointer
		box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.3), 2px 2px 8px rgba(0, 0, 0, 0.1)
	
		&:hover:after
			transform: none
			opacity: 1
	
		&:before,
		&:after
			content: ''
			position: absolute
			pointer-events: none
	
		&:before
			width: 100%
			height: 100%
			border-radius: 50%
			background: radial-gradient(circle at center, $yellow, $orange)	
			transform: scale(0.3)
			opacity: 0
			transition:
				property: transform, opacity
				duration: 0.2s
				timing-function: $smooth
		
		&:after
			border: 8px solid transparent
			border-top-color: $blue-light
			bottom: calc(100% + 10px)
			left: calc(50% - 8px)
			transform: translateY(-10px)
			opacity: 0
			transition:
				property: transform, opacity
				duration: 0.2s
				timing-function: $bounce

.command
	font-family: 'Ubuntu Mono', monospace
	letter-spacing: 1px
	margin: 30px auto auto
	animation: fade 1s ease infinite

html, body
	width: 100%
	height: 100%
	display: flex
	flex-direction: column
	background: linear-gradient(to bottom right, transparentize($yellow, 0.9), #fff)

*
	box-sizing: border-box
	&:before, &:after
		box-sizing: inherit

@keyframes bouncing
	0%, 100%
		transform: translateY(0)
	50%
		transform: translateY(5px)

@keyframes fade
	50%
		opacity: 0.3
              
            
!

JS

              
                /*
	no JS >|
*/
              
            
!
999px

Console