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

              
                <main>
	<div class="ui">
		<div class="ui-toolbar">
			<i class="fas fa-chevron-down"></i>
			
			<div>
				<i class="fas fa-volume-up"></i>
				<i class="fas fa-ellipsis-v"></i>
			</div>
		</div>
		
		<div class="ui-cover">
			<!-- Icon made by Freepik (https://www.freepik.com) -->
			<svg class="ui-cover-art" height="511pt" viewBox="1 -12 511.99976 511" width="511pt" xmlns="http://www.w3.org/2000/svg"><path d="m481.472656 256.59375-225.378906 225.378906c-7.027344 7.027344-18.417969 7.027344-25.445312 0l-225.378907-225.378906c-7.027343-7.027344-7.027343-18.417969 0-25.445312l225.378907-225.378907c7.027343-7.027343 18.417968-7.027343 25.445312 0l225.378906 225.378907c7.027344 7.027343 7.027344 18.417968 0 25.445312zm0 0" fill="#fab700"/><path d="m230.277344 6.140625-33.238282 33.238281 226.527344 226.527344c3.714844 3.714844 3.714844 9.738281 0 13.453125l-197.765625 197.765625 4.476563 4.476562c7.230468 7.230469 18.957031 7.230469 26.1875 0l224.636718-224.636718c7.234376-7.230469 7.234376-18.957032 0-26.1875l-224.636718-224.636719c-7.230469-7.230469-18.957032-7.230469-26.1875 0zm0 0" fill="#faa200"/><path d="m512 252.789062c0 102.949219-83.457031 186.402344-186.40625 186.402344-102.945312 0-186.402344-83.453125-186.402344-186.402344 0-102.949218 83.457032-186.40625 186.402344-186.40625 102.949219 0 186.40625 83.457032 186.40625 186.40625zm0 0" fill="#682c54"/><path d="m325.59375 66.382812c-7.027344 0-13.957031.40625-20.785156 1.160157 93.164062 10.339843 165.617187 89.324219 165.617187 185.246093 0 95.921876-72.453125 174.90625-165.617187 185.246094 6.828125.757813 13.757812 1.160156 20.785156 1.160156 102.949219 0 186.40625-83.457031 186.40625-186.40625 0-102.945312-83.457031-186.40625-186.40625-186.40625zm0 0" fill="#542a48"/><path d="m325.59375 66.382812c-102.945312 0-186.402344 83.457032-186.402344 186.40625 0 34.3125 9.28125 66.453126 25.457032 94.070313l255.015624-255.019531c-27.613281-16.171875-59.753906-25.457032-94.070312-25.457032zm0 0" fill="#723661"/><path d="m402.570312 108.933594 17.09375-17.09375c-27.613281-16.171875-59.753906-25.453125-94.070312-25.453125-7.027344 0-13.957031.402343-20.785156 1.160156 36.910156 4.09375 70.574218 18.953125 97.761718 41.386719zm0 0" fill="#682c54"/><path d="m418.285156 252.789062c0 51.191407-41.5 92.6875-92.691406 92.6875-51.1875 0-92.6875-41.496093-92.6875-92.6875 0-51.191406 41.5-92.691406 92.6875-92.691406 51.191406 0 92.691406 41.5 92.691406 92.691406zm0 0" fill="#542a48"/><path d="m389.765625 252.789062c0 35.441407-28.730469 64.167969-64.171875 64.167969-35.4375 0-64.167969-28.726562-64.167969-64.167969 0-35.441406 28.730469-64.171874 64.167969-64.171874 35.441406 0 64.171875 28.730468 64.171875 64.171874zm0 0" fill="#ff6914"/><path d="m338.429688 252.789062c0 7.089844-5.746094 12.835938-12.835938 12.835938-7.085938 0-12.832031-5.746094-12.832031-12.835938 0-7.089843 5.746093-12.835937 12.832031-12.835937 7.089844 0 12.835938 5.746094 12.835938 12.835937zm0 0" fill="#005ca0"/></svg>
			<div class="ui-cover-title">
				<p>Halsey</p>
				<p>Without Me</p>
			</div>
		</div>
		
		<div class="ui-actions">
			<i class="fas fa-list-ul"></i>
			<i class="fas fa-heart"></i>
			<i class="fas fa-plus"></i>
		</div>
		
		<div class="ui-seekbar">
			<input type="range" class="ui-slider" min="1" max="1200" value="0">
		</div>
		
		<div class="ui-controls">
			<i class="fas fa-random"></i>
			<i class="fas fa-step-backward"></i>
			<i class="fas fa-pause"></i>
			<i class="fas fa-step-forward"></i>
			<i class="fas fa-redo"></i>
		</div>
	</div>
</main>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Prompt&display=swap');

@import url('https://use.fontawesome.com/releases/v5.6.3/css/solid.css');

@import url('https://use.fontawesome.com/releases/v5.6.3/css/fontawesome.css');

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background: #001133;
	font-family: 'Prompt', sans-serif;
	-webkit-tap-highlight-color: transparent;
}

main {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100vw;
	height: 100vh;
}

.ui {
	width: 280px;
	height: 500px;
	padding: 5px 15px;
	border-radius: 4px;
	background: linear-gradient(45deg, #d2dfed 0%,#c8d7eb 26%,#bed0ea 51%,#a6c0e3 51%,#afc7e8 62%,#bad0ef 75%,#99b5db 88%,#799bc8 100%);
}

.ui-toolbar {
	height: 10%;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ui-cover {
	height: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
}

.ui-cover-art {
	width: 120px;
}

.ui-cover-title {
	text-align: center;
}

.ui-actions {
	height: 15%;
	display: flex;
	align-items: center;
	justify-content: space-evenly;
}

.ui-seekbar {
	height: 10%;
	text-align: center;
}

.ui-seekbar .ui-slider {
	width: 100%;
	height: 6px;
	border-radius: 8px;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	box-shadow: 0 0 3px rgba(0, 0, 0, .6);
	background: #FFF;
}

.ui-seekbar .ui-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #09F;
	cursor: pointer;
}

.ui-controls {
	height: 15%;
	display: flex;
	align-items: center;
	justify-content: space-evenly;
}
              
            
!

JS

              
                const seekbar = document.querySelector('.ui-slider');
const seekbarMax = seekbar.max;

setInterval(() => {
	let position = (parseInt(seekbar.value));
	
	if(position < seekbarMax) {
		seekbar.value = parseInt(position) + 1;
	}
	else {
		seekbar.value = 0;
	}
}, 1000);
              
            
!
999px

Console