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

              
                // Inspired By this dribbble post https://dribbble.com/shots/2132841-Day-005-Music-Player

.player
	.image
		img.cover(src="http://fistintheair.com/wp-content/uploads/2016/12/quinn-xcii-straightjacket.jpg", alt="Cover")
		.filter
	.description
		p Quinn XCII
		h1 Straightjacket
	.buttons
		img.playButton(src="https://s29.postimg.org/5pit0vpk7/music_player_play_1.png", alt="PlayButton")
		img.pauseButton(src="https://s29.postimg.org/8nv0wtxef/pause_button.png", alt="pauseButton")
	.time
		p.timePlayed 1:27
		p.timeLeft 1:59
	.lines
		.songLength
		.lengthLeft
	.likeandfav
		.fa.fa-heart
		.fa.fa-star
              
            
!

CSS

              
                body
	background-color lighten(#FE5074,10%)
	height 1600px
.player
	height 600px
	width 450px
	position absolute
	top 10%
	left 50%
	transform translateX(-225px)
	background-color #111
	box-shadow 10px 10px 30px 0px rgba(0,0,0,0.5), -0px -0px 40px 0px rgba(0,0,0,0.4)
	.image
		position absolute
		left 0px
		top 0px
		.cover
			position absolute
			width 450px
			left 0px
			top 0px
		.filter
			position absolute
			width 450px
			height 450px
			background linear-gradient(transparent, #111)
	.description
		position absolute
		color #fff
		font-family Open Sans
		top 350px
		left 50px
		p
			margin 0
			color lighten(black, 40%)
		h1
			margin 5px 0px 0px 0px
	.buttons
		height 20px
		width 20px
		position absolute
		right 50px
		top 385px
		cursor pointer
		transition .2s
		.playButton,.pauseButton
			position absolute
			width 20px
			transition .2s
		.pauseButton
			opacity 0
	.buttons.active
		.playButton
			opacity 0
		.pauseButton
			opacity 1
	.time
		position absolute
		color #fff
		.timePlayed
			position absolute
			top 450px
			left 50px
			font-family Open Sans
		.timeLeft
			position absolute
			top 450px
			left 370px
			font-family Open Sans
			color lighten(black, 40%)
	.lines
		position absolute
		.songLength
			position absolute
			width 350px
			height 1px
			background-color lighten(black, 40%)
			top 500px
			left 50px
		.lengthLeft
			position absolute
			width 150px
			height 1px
			background-color #FE5074
			top 500px
			left 50px
	.likeandfav
		position absolute
		color lighten(black, 40%)
		.fa-heart
			position absolute
			top 530px
			left 50px
			font-size 25px
			transition .2s
		.fa-heart.active
			color #FE5074
		.fa-star
			position absolute
			top 530px
			left 375px
			font-size 25px
			transition .2s
		.fa-star.active
			color #FFDF00
              
            
!

JS

              
                $(()=>{
	$('.buttons').on('click', ()=>{
		$('.buttons').toggleClass('active')
	})
	$('.fa-heart').on('click', ()=>{
		$('.fa-heart').toggleClass('active')
	})
	$('.fa-star').on('click', ()=>{
		$('.fa-star').toggleClass('active')
	})
})
              
            
!
999px

Console