Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                .page
	.bg
	.overlay
	.cover-overlay
	
	header
		.title Online Radio
		
	.panel.panel-channel-list.available
		header
			.title Radio channels
		.list
			ul
				li
					.title 
						span.name RADIO ZUMA
						span.country (TR)
					.categories Pop, Electronic, Top 40
					.bitrate 64 kbit
					.star.fa.fa-star-o
				li
					.title 
						span.name andHow.FM
						span.country (NZ)
					.categories Rock, Reggae, Jazz, Electronic
					.bitrate 128 kbit
					.star.fa.fa-star-o
				li
					.title 
						span.name Power Zone Radio
						span.country (US)
					.categories Rock, Hard Rock, Electronic, Normal Rock
					.bitrate 128 kbit
					.star.fa.fa-star
				li
					.title 
						span.name Atlantic Radio Uk
						span.country (UK)
					.categories Trance, Electronic, Dance
					.bitrate 192 kbit
					.star.fa.fa-star-o
				li
					.title 
						span.name Xltrax Dance
						span.country (CA)
					.categories Dance, Electronic, House
					.bitrate 128 kbit
					.star.fa.fa-star
				li
					.title 
						span.name cue-radio - Channel #1
						span.country (FR)
					.categories Electronic, Hardstyle, Electronic Folk
					.bitrate 128 kbit
					.star.fa.fa-star-o
				li
					.title 
						span.name Casafonda Radio
						span.country (GB)
					.categories Dance, Electronic, House
					.bitrate 128 kbit
					.star.fa.fa-star-o

	.panel.panel-channel-list.favorites
		header
			.title Favorites
		.list
			ul
				li
					.title 
						span.name 247 A State Of Trance Armin Van Buuren
						span.country (UK)
					.categories Dance
					.bitrate 128 kbit
					.star.fa.fa-star
				li
					.title 
						span.name Sky Radio
						span.country (ES)
					.categories Top 40
					.bitrate 192 kbit
					.star.fa.fa-star
				li
					.title 
						span.name Energy Dance
						span.country (CH)
					.categories Trance, House
					.bitrate 64 kbit					
					.star.fa.fa-star
	
	.panel.panel-controls
		.cover-overlay
		.cover
		.playButton
			i.fa.fa-play
		.tracker
			.trackName
				span Beautiful Life - Radio Edit
			.artistName
				span Armin Van Buuren
			.slider
				.time
					i.fa.fa-clock-o
					span 00:13
				.slide
					.pos
				.totalTime
					i.fa.fa-time
					span 2:59
			.favorite				
				i.fa.fa-star-o
			.volume
				.slide
					.pos
				.icon
					i.fa.fa-volume-up

              
            
!

CSS

              
                @import "compass";

@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900|Dosis:300,400,600,700,800|Droid+Sans:400,700|Lato:300,400,700,900|PT+Sans:400,700|Ubuntu:300,400,500,700|Open+Sans:400,300,600,700|Roboto:400,300,500,700,900|Roboto+Condensed:400,300,700|Open+Sans+Condensed:300,700|Play:400,700|Maven+Pro:400,500,700,900&subset=latin,latin-ext);

$forestGreen: rgb(0, 255, 84);
$cityAqua: rgb(0, 233, 233);
$skyBlue: rgb(0, 181, 255);
$deepPurple: rgb(164, 49, 230);
$islandOrange: rgb(255, 49, 0);
$beachOrange: rgb(255, 97, 0);
		
$masterColor: $cityAqua;

$bg1: rgba($masterColor, 0.6);
$bg2: rgba($masterColor, 0.8);
$textColor: White;

$fontFamily: "Open Sans";

* {
  @include box-sizing(border-box);  
	
}

html {
  background-color: #1d1f20;
	font-size: 16px;
	font-family: $fontFamily;
	font-weight: 300;
	color: White;
	
	text-rendering: optimizeLegibility !important;
	-webkit-font-smoothing: antialiased !important;	
}

@mixin clearfix() {
    &:before,
    &:after {
        content: "";
        display: table;
    }
    &:after {
        clear: both;
    }
} 

@mixin absolute($w: 100%, $h: 100%) {
	position: absolute;
	left: 0; right: 0; bottom: 0; top: 0;
	width: $w;
	height: $h;
	margin: auto auto;
}

@mixin add-flex() {
	@include display-flex();
	align-items: center;
	justify-content: space-around;		
}

@mixin ellipsis() {
	white-space: nowrap;
	text-overflow: ellipsis;	
}


@mixin scrollStyle($c) {
	/* scrollbar design Chrome */
	&::-webkit-scrollbar {
		height: 10px;
		width: 10px;
		//background: #000;
	}

	&::-webkit-scrollbar-thumb {
		border-radius: 10px;
		background-color: $c;
		border: 1px solid darken($c, 10%);
	}

	&::-webkit-scrollbar-corner {
		background: $c;
		display: none;
		opacity: 0;
	}
	
}

@mixin blur($blur) {
    -webkit-filter: blur($blur);
    -moz-filter: blur($blur);
    -o-filter: blur($blur);
    -ms-filter: blur($blur);
    filter: blur($blur);        
}

body {
	overflow: hidden;
}

$width: 800px;
$height: 480px;


.page {
	$c: $deepPurple;
	
	width: 98%;
	height: 98%;
	max-width: $width;
	max-height: $height;
	position: absolute;
	left: 0; right: 0; top: 0; bottom: 0;
	margin: auto;
	@include border-radius(8px);
	overflow: hidden;
	@include box-shadow(0 0 20px rgba(Black, 0.6));
	
	.bg {
		@include absolute($width, $height);
		
		background-size: cover;

		background-image: url('https://i.imgur.com/Jp5wKOR.jpg');

		@include blur(2px);
	} // .bg
	
	.overlay {
		@include absolute($width, $height);
		background-color: rgba($c, 0.10);
	}

		.cover-overlay {
			display: none;
			@include absolute(100%, 100%);
			background-image: url('https://i.imgur.com/07S4eUb.jpg');
			background-size: cover;
			opacity: 0.1;
		}
		
	
	> header {
		position: absolute;
		width: 92%;
		top: 2%;
		left: 0; right: 0;
		margin: auto;
		
		text-align: center;
		font-size: 1.6rem;
		line-height: 2.3rem;
    
		background-color: rgba(Black, 0.2);
		@include border-radius(8px);
		
		font-family: "Open Sans";
		font-weight: 400;
		@include text-shadow(1px 1px 4px rgba(Black, 0.6));		
	} // header

	.panel {
		background-color: rgba(Black, 0.2);
		@include border-radius(8px);
		overflow: hidden;
		
		.content {
			padding: 4px;
		}
		
		header {
			text-align: center;
			.title {
				font-size: 1.5rem;
				line-height: 2.0rem;				
				background-color: rgba($c, 0.8);			
			}
		}
	}

	.panel.panel-channel-list {
		position: absolute;
		top: 12%; bottom: 6rem;
		
		.list {
			overflow: auto;
			position: absolute;
			top: 2rem; bottom: 0;
			left: 0; right: 0;
			//@include scrollStyle(lighten($c, 20%));
			
			.ps-scrollbar-y-rail {
				background-color: transparent;
				
				&:hover {
					background-color: transparent;
				}
			}
			
			.ps-scrollbar-y {
				background-color: darken($c, 10%);
			}
		}		
		
		ul {
			padding: 0;
			list-style: none;
			
			li {
				position: relative;
				cursor: pointer;
				padding: 0.1rem;
				margin: 0.5rem 0.5rem;
				padding: 0.2rem 0.3rem;
				
				@include border-radius(4px);
				
				&:hover {
					background-color: rgba(Black, 0.2);
				}
				
				.title {
					font-weight: 600;
					
					.country {
							padding-left: 5px;
							font-size: 0.8rem;
					}	// .country				
				} // .title
				
				.categories {
					font-size: 0.8rem;
					float: left;
				}
				
				.bitrate {
					font-size: 0.8rem;
					float: right;
				}
				
				.star {
					position: absolute;
					top: 0.5rem;
					right: 0.1rem;					
				}
				
				@include clearfix();
				
			} // li
			
		} // ul
		
	} // .channels
	
	.panel.panel-channel-list.available {
		left: 4%; right: 52%;	
	} // .channels
	
	.panel.panel-channel-list.favorites {
		left: 52%; right: 4%;	
	} // .favorites	
	
	.panel.panel-controls {
		position: absolute;
		left: 4%; right: 4%;		
		bottom: 2%;
		height: 5rem;
		padding: 0.5rem;
		
		.cover-overlay {
			display: none;
			@include absolute(100%, 100%);
			background-image: url('https://i.imgur.com/07S4eUb.jpg');
			background-size: cover;
			background-position: center;
			opacity: 0.2;
		}
			
		.cover {
			float: left;
			width: 4rem;
			//margin: 0.5rem;
			height: 4rem;
			margin-right: 0.5rem;
			
			background-image: url('https://i.imgur.com/N6OqT4T.jpg');
			background-size: cover;
			
			@include border-radius(4px);
		}
		
		.playButton {
			float: left;
			width: 3rem;
			height: 3rem;
			margin: 0.5rem;
			border: 2px solid lighten($c, 10%);
			@include border-radius(3rem);
			line-height: 3rem;
			text-align: center;
			vertical-align: center;
			
			i {
				margin-left: 2px;
				font-size: 1.4rem;
				color: lighten($c, 40%);
			}
			
			&.playing i:before {
				content: "\f04c";
			}
		}
		
		.tracker {
			position: relative;
			margin-left: 9rem;
			
			.slider {
				margin-top: 0.2rem;
				
				.time, .totalTime {
					float: left;
					font-size: 0.8rem;
					i {
						margin-right: 5px;
					}

				}
				
				.slide {
					float: left;
					width: 60%;
					height: 0.5rem;
					overflow: hidden;
					background-color: rgba(White, 0.3);
					@include border-radius(0.5rem);
					margin: 0.4rem 0.5rem;
					
					.pos {
						width: 21%;
						height: 0.5rem;
						background-color: White;
						@include border-radius(0.5rem);
					}
				}
				
				@include clearfix();
			}
			
			.trackName {
				font-weight: 600;
				i {
					width: 1.2rem;
				}
			}

			.artistName {
				font-size: 0.9rem;
			}
		
			.favorite {
				position: absolute;
				top: 0rem;
				right: 0.5rem;
				i {
					font-size: 1.2rem;
				}
				
				&.starred i:before {
					content: "\f005"
				}
			} // .favorite
			
			.volume {
				position: absolute;
				right: 0;
				bottom: 0;
				
				.icon {
					display: inline-block;
					padding-bottom: 0.2rem;
					width: 1rem;
				} // .icon
				
				.slide {
					display: inline-block;
					width: 4rem;
					height: 0.5rem;
					background-color: rgba(White, 0.3);
					@include border-radius(0.5rem);
					margin: 0.0rem 0.5rem;
					
					.pos {
						width: 80%;
						height: 0.5rem;
						background-color: White;
						@include border-radius(0.5rem);
					}
					
				} // .slide
				
			} // .volume
			
		} // .tracker
		
	} // .favorites		
}
              
            
!

JS

              
                $(".favorite").on "click", ->
	$(this).toggleClass("starred");
	
$(".playButton").on "click", ->
	$(this).toggleClass("playing");	
	
	
$(".slider .slide").on "click", (e)->
	$this = $(this)
	pos = (e.offsetX / $this.width()) * 100
	console.log pos.toFixed(0) + "%"
	$this.find(".pos").width(pos + "%");
	
$(".volume .slide").on "click", (e)->
	$this = $(this)
	pos = (e.offsetX / $this.width()) * 100
	roundPos = Math.round(pos / 25) * 25
	console.log pos.toFixed(0) + "%, " + roundPos + "%"
	$this.find(".pos").width(roundPos + "%")
	
	if roundPos > 50
		$(".volume .icon i").removeClass().addClass "fa fa-volume-up"
	else if roundPos > 0
		$(".volume .icon i").removeClass().addClass "fa fa-volume-down"
	else
		$(".volume .icon i").removeClass().addClass "fa fa-volume-off"
		
$ ->
	$(".list").perfectScrollbar()
              
            
!
999px

Console