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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div class="app">
	<div class="songs-wrapper">
		<div class="row">
			<div class="col s12 m6 l4 x3">
				<div class="active song">
					<div class="song-image" style="background-image:url(https://cbsradionews.files.wordpress.com/2016/02/death-of-a-bacherlor-album-art.jpg?w=555&h=548)"></div>
					<div class="song-info">
						<div class="song-title">Death Of A Bachelor</div>
						<div class="song-artist">by Panic! At The Disco</div>
						<div class="song-time">3:23</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(http://static.djbooth.net/pics-features/chance-3-artwork.jpg)"></div>
					<div class="song-info">
						<div class="song-title">Blessings</div>
						<div class="song-artist">by Chance The Rapper</div>
						<div class="song-time">3:41</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://i.pinimg.com/736x/f0/89/73/f089734bf401b9a7d59f48a5077b2907--music-covers-heart-art.jpg)"></div>
					<div class="song-info">
						<div class="song-title">A Walk</div>
						<div class="song-artist">by Tycho</div>
						<div class="song-time">5:16</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh3.googleusercontent.com/NFqQwY63RbJYCgrmEYsez-CDK2KAWKM_FIBTlaipK2zCB6CXvVO48ZjX2jWkgixu1_VIUA_Y=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">Come Hang Out</div>
						<div class="song-artist">by AJR</div>
						<div class="song-time">4:26</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh3.googleusercontent.com/4s6mMULoaDMdpQlhlBbF8Y_88kh1ugeLx4DimzRfOJg-H7IGVblWAPSc233C8R1liUL1L1zhCg=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">Cigarette</div>
						<div class="song-artist">by PANG!</div>
						<div class="song-time">4:15</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh3.googleusercontent.com/QXdqujkQXwuQzgpxSP8nzrOqq6i0NQnE_iD3XFkRNs9-3yC4jigcFTB94bn8BOVlFNnx2VztmQ=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">80's Films</div>
						<div class="song-artist">by Jon Bellion</div>
						<div class="song-time">3:36</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh6.ggpht.com/3FhBNLXAL-atLEQHojVxsC8exkGS16aRrT2AGGYg1P257vWJtZwnoXKkkBeXSt3wmUHQunE1hw=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">Cardiac Arrest</div>
						<div class="song-artist">by Bad Suns</div>
						<div class="song-time">3:02</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh3.googleusercontent.com/9gMEeE5JHaHYj_s25dr8wjyrZa8tQrfp-syYXoASdoTrZ5zgVUm8Z3gC6BbKcwOIdcI2uFiIm8E=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">Worst In Me</div>
						<div class="song-artist">by Julia Michaels</div>
						<div class="song-time">3:26</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh3.googleusercontent.com/J_xB101XKHvDsZWP0tHfCfVnQtLY_BZM9_S_6hc6RStGg6mbrJbDkD5xR8RJKMv98QDS7FzHlw=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">Rosie</div>
						<div class="song-artist">John Mayer</div>
						<div class="song-time">4:00</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh4.ggpht.com/QqjbOo_bnoKjsrpZlQSGoACKQYpQpbT6pPIkDl6UuTWvc4jrJgu4XaSY8_Lomb73l_JjuDtkUBM=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">IV. Sweatpants</div>
						<div class="song-artist">Childish Gambino</div>
						<div class="song-time">3:00</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh3.googleusercontent.com/1HKf4Wbp6DSwKnX6kVGUh3aANVW2WfWjC3cfyQ16l07N85xZLd4EBwkxM5AsY0XxfIwnJQTKdzg=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">Heavydirtysoul</div>
						<div class="song-artist">Twenty One Pilots</div>
						<div class="song-time">3:54</div>
					</div>
				</div>
			</div>
			<div class="col s12 m6 l4 x3">
				<div class="song">
					<div class="song-image" style="background-image:url(https://lh3.googleusercontent.com/CrIHeXpJPoZz63YneLoWOjUGswBEa5LHVoUEPYu9hvA2CJMZz2f8X6V4fve7hti5ww7GUvtYYA=s1024-c-e100-rwu-v1)"></div>
					<div class="song-info">
						<div class="song-title">Tech Noir</div>
						<div class="song-artist">GUNSHIP</div>
						<div class="song-time">4:57</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="music-player">
		<div class="progress-wrapper">
			<div class="progress-bar"></div>
		</div>
		<div class="times-row">
			<div class="start-time">0:00</div>
			<div class="current-song">Current Song</div>
			<div class="end-time">3:48</div>
		</div>
		<div class="player-actions">
			<button class="action-button">
				<i class="material-icons">skip_previous</i>
			</button>
			<button class="play-button">
				<i class="material-icons">pause</i>
			</button>
			<button class="action-button">
				<i class="material-icons">skip_next</i>
			</button>
		</div>
	</div>
</div>
              
            
!

CSS

              
                /* =======================================
	Imports
======================================= */
@import 'https://fonts.googleapis.com/icon?family=Material+Icons';
@import url('https://fonts.googleapis.com/css?family=Raleway:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i');

/* =======================================
	Variables
======================================= */
$border-radius: 3px;
$small-padding: 10px;
$player-height: 101px;

$body-font: 'Raleway', sans-serif;
$header-font: 'Raleway', sans-serif;

$box-shadow-1: 0 1px 5px rgba(0,0,0,0.05), 0 1px 10px rgba(0,0,0,0.08);
$box-shadow-2: 0 3px 6px rgba(0,0,0,0.1), 0 3px 12px rgba(0,0,0,0.12);
$box-shadow-3: 0 4px 10px rgba(0,0,0,0.12), 0 4px 20px rgba(0,0,0,0.24);
$box-shadow-4: 0 5px 12px rgba(0,0,0,0.14), 0 5px 24px rgba(0,0,0,0.3);
$box-shadow-5: 0 7px 18px rgba(0,0,0,0.2), 0 7px 36px rgba(0,0,0,0.4);

/* =======================================
	Extensions
======================================= */
%clearfix {
	&:after {
		clear: both;
		content: '';
		display: table;
	}
}

/* =======================================
	Styles
======================================= */
*, *:before, *:after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.app {
	line-height: 1.5;
	font-family: $body-font;
	background-color: black;
	padding-bottom: $player-height;
}

.songs-wrapper {
	min-height: 100vh;
	background-color: black;
	
	.song {
		width: 100%;
		overflow: hidden;
		position: relative;
		background-color: transparent;
		transition: all 0.2s ease-in;
		
		.song-image {
			width: 100%;
			padding: 50% 0;
			display: block;
			background-size: cover;
			background-position: center;
		}
		
		.song-info {
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			opacity: 0;
			color: white;
			display: flex;
			position: absolute;
			align-items: center;
			flex-direction: column;
			justify-content: center;
			padding: $small-padding;
			text-shadow: 0 1px 3px black;
			transition: opacity 0.2s ease-in;
			background: radial-gradient(circle at center, rgba(0,0,0,0.4) 0, rgba(0,0,0,0.9) 100%);
			
			.song-title {
				font-size: 20px;
				font-family: $header-font;
			}
		}
		
		&:hover {
			cursor: pointer;
			
			.song-info {
				opacity: 1;
			}
		}
		
		&.active {
			border: solid 3px white;
		}
	}
}

.row {
	@extend %clearfix;
	display: flex;
	flex-wrap: wrap;
	position: relative;

	.col {
		@extend %clearfix;
		flex: 1;
		margin-left: 0;
		position: relative;
		transition: all 0.2s ease-in;
		
		&.s1 {
			flex: 0 0 calc(100% * (1/12));
			max-width: calc(100% * (1/12));
		}
		&.s2 {
			flex: 0 0 calc(100% * (2/12));
			max-width: calc(100% * (2/12));
		}
		&.s3 {
			flex: 0 0 calc(100% * (3/12));
			max-width: calc(100% * (3/12));
		}
		&.s4 {
			flex: 0 0 calc(100% * (4/12));
			max-width: calc(100% * (4/12));
		}
		&.s5 {
			flex: 0 0 calc(100% * (5/12));
			max-width: calc(100% * (5/12));
		}
		&.s6 {
			flex: 0 0 calc(100% * (6/12));
			max-width: calc(100% * (6/12));
		}
		&.s7 {
			flex: 0 0 calc(100% * (7/12));
			max-width: calc(100% * (7/12));
		}
		&.s8 {
			flex: 0 0 calc(100% * (8/12));
			max-width: calc(100% * (8/12));
		}
		&.s9 {
			flex: 0 0 calc(100% * (9/12));
			max-width: calc(100% * (9/12));
		}
		&.s10 {
			flex: 0 0 calc(100% * (10/12));
			max-width: calc(100% * (10/12));
		}
		&.s11 {
			flex: 0 0 calc(100% * (11/12));
			max-width: calc(100% * (11/12));
		}
		&.s12 {
			flex: 0 0 calc(100% * (12/12));
			max-width: calc(100% * (12/12));
		}
		
		@media (min-width:601px) {
			&.m1 {
				flex: 0 0 calc(100% * (1/12));
				max-width: calc(100% * (1/12));
			}
			&.m2 {
				flex: 0 0 calc(100% * (2/12));
				max-width: calc(100% * (2/12));
			}
			&.m3 {
				flex: 0 0 calc(100% * (3/12));
				max-width: calc(100% * (3/12));
			}
			&.m4 {
				flex: 0 0 calc(100% * (4/12));
				max-width: calc(100% * (4/12));
			}
			&.m5 {
				flex: 0 0 calc(100% * (5/12));
				max-width: calc(100% * (5/12));
			}
			&.m6 {
				flex: 0 0 calc(100% * (6/12));
				max-width: calc(100% * (6/12));
			}
			&.m7 {
				flex: 0 0 calc(100% * (7/12));
				max-width: calc(100% * (7/12));
			}
			&.m8 {
				flex: 0 0 calc(100% * (8/12));
				max-width: calc(100% * (8/12));
			}
			&.m9 {
				flex: 0 0 calc(100% * (9/12));
				max-width: calc(100% * (9/12));
			}
			&.m10 {
				flex: 0 0 calc(100% * (10/12));
				max-width: calc(100% * (10/12));
			}
			&.m11 {
				flex: 0 0 calc(100% * (11/12));
				max-width: calc(100% * (11/12));
			}
			&.m12 {
				flex: 0 0 calc(100% * (12/12));
				max-width: calc(100% * (12/12));
			}
		}
		
		@media (min-width:993px) {
			&.l1 {
				flex: 0 0 calc(100% * (1/12));
				max-width: calc(100% * (1/12));
			}
			&.l2 {
				flex: 0 0 calc(100% * (2/12));
				max-width: calc(100% * (2/12));
			}
			&.l3 {
				flex: 0 0 calc(100% * (3/12));
				max-width: calc(100% * (3/12));
			}
			&.l4 {
				flex: 0 0 calc(100% * (4/12));
				max-width: calc(100% * (4/12));
			}
			&.l5 {
				flex: 0 0 calc(100% * (5/12));
				max-width: calc(100% * (5/12));
			}
			&.l6 {
				flex: 0 0 calc(100% * (6/12));
				max-width: calc(100% * (6/12));
			}
			&.l7 {
				flex: 0 0 calc(100% * (7/12));
				max-width: calc(100% * (7/12));
			}
			&.l8 {
				flex: 0 0 calc(100% * (8/12));
				max-width: calc(100% * (8/12));
			}
			&.l9 {
				flex: 0 0 calc(100% * (9/12));
				max-width: calc(100% * (9/12));
			}
			&.l10 {
				flex: 0 0 calc(100% * (10/12));
				max-width: calc(100% * (10/12));
			}
			&.l11 {
				flex: 0 0 calc(100% * (11/12));
				max-width: calc(100% * (11/12));
			}
			&.l12 {
				flex: 0 0 calc(100% * (12/12));
				max-width: calc(100% * (12/12));
			}
		}
		
		@media (min-width:1301px) {
			&.x1 {
				flex: 0 0 calc(100% * (1/12));
				max-width: calc(100% * (1/12));
			}
			&.x2 {
				flex: 0 0 calc(100% * (2/12));
				max-width: calc(100% * (2/12));
			}
			&.x3 {
				flex: 0 0 calc(100% * (3/12));
				max-width: calc(100% * (3/12));
			}
			&.x4 {
				flex: 0 0 calc(100% * (4/12));
				max-width: calc(100% * (4/12));
			}
			&.x5 {
				flex: 0 0 calc(100% * (5/12));
				max-width: calc(100% * (5/12));
			}
			&.x6 {
				flex: 0 0 calc(100% * (6/12));
				max-width: calc(100% * (6/12));
			}
			&.x7 {
				flex: 0 0 calc(100% * (7/12));
				max-width: calc(100% * (7/12));
			}
			&.x8 {
				flex: 0 0 calc(100% * (8/12));
				max-width: calc(100% * (8/12));
			}
			&.x9 {
				flex: 0 0 calc(100% * (9/12));
				max-width: calc(100% * (9/12));
			}
			&.x10 {
				flex: 0 0 calc(100% * (10/12));
				max-width: calc(100% * (10/12));
			}
			&.x11 {
				flex: 0 0 calc(100% * (11/12));
				max-width: calc(100% * (11/12));
			}
			&.x12 {
				flex: 0 0 calc(100% * (12/12));
				max-width: calc(100% * (12/12));
			}
		}
	}
}

.music-player {
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px;
	color: white;
	position: fixed;
	box-shadow: $box-shadow-5;
	background-color: rgba(0,0,0,0.85);
	
	.progress-wrapper {
		left: 0;
		right: 0;
		bottom: 100%;
		position: absolute;
		background-color: rgba(255,255,255,0.3);
		
		.progress-bar {
			width: 0;
			height: 3px;
			background-color: white;
			animation: play 60s linear 1s infinite;
		}
	}
	
	.times-row {
		display: flex;
		font-size: 12px;
		margin-bottom: 10px;
		pointer-events: none;
		justify-content: space-between;
		
		.current-song {
			font-size: 14px;
			font-family: $header-font;
		}
	}
	
	.player-actions {
		display: flex;
		align-items: center;
		justify-content: center;
		
		.action-button {
			width: 30px;
			height: 30px;
			color: white;
			border: none;
			outline: none;
			margin: 0 10px;
			line-height: 0;
			border-radius: 50%;
			background-color: transparent;
			transition: background-color 0.2s ease-in;
			
			&:hover {
				cursor: pointer;
				background-color: rgba(255,255,255,0.3);
			}
		}
	}
}

.play-button {
	width: 50px;
	height: 50px;
	color: white;
	outline: none;
	line-height: 0;
	border-radius: 50%;
	border: solid 1px white;
	background-color: transparent;
	transition: background-color 0.2s ease-in;

	i {
		font-size: 32px;
		transition: transform 0.2s ease-in;
	}

	&:hover {
		cursor: pointer;
		background-color: rgba(255,255,255,0.3);
	}

	&:active {
		i {
			transform: scale(1.3);
		}
	}
}

@keyframes play {
		from {
				width: 0%;
		}
		to {
				width: 100%;
		}
}
              
            
!

JS

              
                $('.song').on('click', function() {
	$('.song').removeClass('active');
	$(this).addClass('active');
});
              
            
!
999px

Console