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

              
                <div class="music-player-container is-playing">

		<div class="music-player">
			<div class="player-content-container">
				<h1 class="artist-name">Incubus</h1><!--  /.track-title -->
				<h2 class="album-title">Make Yourself</h2><!--  /.album-title -->
				<h3 class="song-title">"Stellar"</h3><!--  /.song-title -->
				<div class="music-player-controls">
					<div class="control-back"></div><!--  /.control-back -->
					<div class="control-play"></div><!--  /.control-play -->
					<div class="control-forwards"></div><!--  /.control-forwards -->
				</div><!--  /.music-player-controls -->
			</div><!--  /.player-content-container -->
		</div><!--  /.music-player -->

		<div class="album">
			<div class="album-art"></div><!--  /.album-art -->
			<div class="vinyl"></div><!--  /.vinyl -->
		</div><!--  /.album-art -->

	</div><!--  /.music-player -->
              
            
!

CSS

              
                // Imports
@import 'bourbon';
@import url(https://fonts.googleapis.com/css?family=Raleway:400,300,700);

// Variables
$color-background: #fef29c;

// CSS

*, *:before, *:after {
	box-sizing: border-box;
}

body {
	background-color: $color-background;
	color: #515044;
	font-family: 'Raleway', sans-serif;
}// body

.music-player-container {
	@include transform( translate(-50%,-50%) );
	display: inline-block;
	height: 370px;
	position: absolute;
	min-width: 460px;
	left: 50%;
	top: 50%;

	&:after {
		@include filter(blur(8px));
		background-color: rgba(0,0,0,0.8);
		bottom: -2px;
		content: ' ';
		display: block;
		height: 10px;
		left: 19px;
		position: absolute;
		transform: rotate(-3deg);
		width: 70%;
		z-index: 0;
	}
}

.music-player {
	background-color: #fff;
	height: 370px;
	padding: 40px 250px 40px 40px;
	position: absolute;
	text-align: right;
	width: 460px;
	z-index: 3;
}// .music-player

.player-content-container {
	@include transform(translateY(-50%));
	top: 50%;
	position: relative;
}// .player-content-container

.artist-name {
	font-size: 28px;
	font-weight: normal;
	margin: 0 0 0.75em 0;
} // .artist-name

.album-title {
	font-weight: 200;
	font-size: 24px;
	margin: 0 0 1.75em 0;
}// .album-title

.song-title {
	font-size: 18px;
	font-weight: 200;
	margin: 0 0 1.5em 0;
}// .song-title

.album {
	box-shadow: 3px 3px 15px rgba(0,0,0,0.65);
	height: 315px;
	margin-left: 250px;
	margin-top: 27px;
	position: relative;
	width: 315px;
	z-index: 10;
}// .album

.album-art {
	background: #fff url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/83141/incubus-make-yourself.jpg') center / cover no-repeat;
	height: 315px;
	position: relative;
	width: 315px;
	z-index: 10;
}

.vinyl {
	@include animation(spin 2s linear infinite);
	@include transition(all 500ms);
	background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/83141/vinyl.png'), url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/83141/incubus-make-yourself.jpg');
	background-position: center, center;
	background-size: cover, 40% auto;
	background-repeat: no-repeat;
	border-radius: 100%;
	box-shadow: 0 0 10px rgba(0,0,0,0.8);
	height: 300px;
	left: 0;
	position: absolute;
	top: 5px;
	width: 300px;
	z-index: 5;
	will-change: transform, left;

	.is-playing & {
		left: 52%;
	}
}

.music-player-controls {
	text-align: center;
}// .music-player-controls

[class^="control-"] {
	@include filter(brightness(95%));
	border-radius: 100%;
	display: inline-block;
	height: 44px;
	margin: 0 3px;
	width: 44px;


	&:hover {
		@include filter(brightness(85%));
		cursor: pointer;
	}// :hover
}// [class^="control-"]

.control-play {
	background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/83141/play.svg') center / cover no-repeat;

	.is-playing & {
		background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/83141/pause.svg') center / cover no-repeat;
	}// .control-play
}// .control-play

.control-forwards {
	background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/83141/forwards.svg') center / cover no-repeat;
}// control-forwards

.control-back {
	background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/83141/backwards.svg') center / cover no-repeat;
}// .control-back

@include keyframes(spin) {
	0% {
		@include transform(rotate(0deg));
	}
	100% {
		@include transform(rotate(360deg));
	}
}

              
            
!

JS

              
                (function($) {
		$(document).ready(function() {

			// Pause/Play functionality
			var playButton = $('.control-play'),
				album = $('.album');

			playButton.on('click', function() {
				$('.music-player-container').toggleClass('is-playing');
			});
		});
	})(jQuery);
              
            
!
999px

Console